Logo
GERER LE SECRETARIAT GENERAL
{{ $projectName }}
Date {{ $date }} Date {{ $periodReference }}
@php $months = $data ? [] : null; foreach($data['budget'] as $category){ foreach($category['children'] as $row){ foreach($row['months'] as $monthKey => $val){ if(!in_array($monthKey, $months)){ $months[] = $monthKey; } } } } @endphp @foreach($months as $month) @endforeach @foreach($months as $month) @endforeach @php function displayValue($key, $value) { if ($value === null || $value === '') return ''; if ($value == 0) return '-'; if (str_contains($key, 'percentage')) { return number_format($value, 2, ',', ' ') . ' %'; } return number_format($value, 0, ',', ' '); } @endphp @foreach($data['budget'] as $category) @foreach($category['children'] as $row) @foreach(['b0','b1','b2','b3','prevision_finale','percentage_prevision_final','realisation_final','percentage_realisation_final'] as $key) @endforeach @foreach($months as $month) @php $monthData = collect($row['months'])->first(fn($val, $k) => stripos($k, $month) !== false) ?? []; @endphp @endforeach @endforeach @foreach(['b0','b1','b2','b3'] as $key) @endforeach @foreach(['prevision_finale','percentage_prevision_final','realisation_final','percentage_realisation_final'] as $key) @endforeach @foreach($months as $month) @endforeach @endforeach @php $totalData = $data['total'] ?? []; @endphp @foreach(['b0','b1','b2','b3','prevision_finale','percentage_prevision_final','realisation_final','percentage_realisation_final'] as $key) @endforeach @foreach($months as $month) @endforeach
N° COMPTE LIGNES BUDGETAIRES UNITÉS QTE BUDGETS ACTUALISÉS Prévision finale à date Réalisation à date{{ ucfirst($month) }}
B0 B1 B2 B3 Prévisionnel Réalisé
{{ $category['poste'] }} {{ strtoupper($category['libelle']) }}
{{ $row['poste'] }} {{ $row['libelle'] }} {{ $row['unit'] ?? '' }} {{ $row['quantity'] ?? '' }}{{ displayValue($key, $row[$key] ?? null) }}{{ displayValue('prevision', $monthData['prevision'] ?? null) }} {{ displayValue('realisation', $monthData['realisation'] ?? null) }}
Sous-total {{ $category['libelle'] }}{{ displayValue($key, $category[$key] ?? null) }}{{ displayValue($key, $category[$key] ?? null) }}{{ displayValue('prevision', $category['months'][$month]['prevision'] ?? null) }} {{ displayValue('realisation', $category['months'][$month]['realisation'] ?? null) }}
TOTAL BUDGET{{ displayValue($key, $totalData[$key] ?? null) }}{{ displayValue('realisation', $totalData['months'][$month]['realisation'] ?? null) }} {{ displayValue('prevision', $totalData['months'][$month]['prevision'] ?? null) }}