{{-- Dashboard Fix — PMS / PCFMS pipeline matrix (BPMS + PC-I + PDWP) --}} @php $fixMetrics = $dashboardFixPipeline['metrics'] ?? []; $fixPms = $dashboardFixPipeline['pms'] ?? []; $fixPcfms = $dashboardFixPipeline['pcfms'] ?? []; $fixBudgetYear = $dashboardFixPipeline['budget_year'] ?? ($defaultBudgetYear ?? ''); $fixShortLabels = [ 'new_schemes' => 'New Sch / Year', 'carry_forward' => 'Carry Fwd', 'estimated_cost' => 'Est. Cost', 'allocation' => 'Allocation', 'pc1_created' => 'PC-I', 'cleared_by_pdwp' => 'Clr PDWP', 'deferred_by_pdwp' => 'Def PDWP', 'minutes_by_pdwp' => 'MoM PDWP', 'pdwp_meeting_held' => 'PDWP Held', 'approved_by_pdwp' => 'Appr PDWP', 'minutes_issued' => 'MoM Issued', 'advise_issued' => 'Advise', ]; $fixBmsPmsOnlyMetrics = ['new_schemes', 'carry_forward', 'estimated_cost', 'allocation']; $metricFormats = collect($fixMetrics)->pluck('format', 'id')->all(); $fmtCell = static function (string $metricId, mixed $value) use ($metricFormats): string { $format = (string) ($metricFormats[$metricId] ?? 'count'); if ($format === 'money') { return number_format((float) $value, 1).' M'; } return number_format((int) $value); }; $pmsReportUrl = route('dashboard.pc-pipeline-report', ['source' => 'pms', 'year' => $fixBudgetYear]); $pcfmsReportUrl = route('dashboard.pc-pipeline-report', ['source' => 'pcfms', 'year' => $fixBudgetYear]); @endphp
| Source | @foreach ($fixMetrics as $metric) @php $metricId = (string) ($metric['id'] ?? ''); $fullLabel = (string) ($metric['label'] ?? $metricId); $shortLabel = $fixShortLabels[$metricId] ?? $fullLabel; @endphp{{ $shortLabel }} | @endforeach
|---|---|
| PMS | @foreach ($fixMetrics as $metric) @php $metricId = (string) ($metric['id'] ?? ''); @endphp{{ $fmtCell($metricId, $fixPms[$metricId] ?? 0) }} | @endforeach
| PCFMS | @foreach ($fixMetrics as $metric) @php $metricId = (string) ($metric['id'] ?? ''); $isBmsPmsOnly = in_array($metricId, $fixBmsPmsOnlyMetrics, true); @endphp{{ $isBmsPmsOnly ? '—' : $fmtCell($metricId, $fixPcfms[$metricId] ?? 0) }} | @endforeach