@php $mpData = $planning->manpower_data ?? \App\Models\FinalPlanning::getDefaultManpowerData(); $opManpower = $mpData['operational'] ?? \App\Models\FinalPlanning::getDefaultManpowerData()['operational']; $hasChiefChecker = false; foreach ($opManpower as $r) { if (strcasecmp($r['role'] ?? '', 'Chief Checker') === 0) { $hasChiefChecker = true; break; } } if (!$hasChiefChecker) { $newOp = []; $inserted = false; foreach ($opManpower as $r) { $newOp[] = $r; if (strcasecmp($r['role'] ?? '', 'Jr. Driver') === 0 || strcasecmp($r['role'] ?? '', 'Jr Driver') === 0) { $newOp[] = ['role' => 'Chief Checker', 'man_power' => '', 'actual' => '', 'diff' => 0]; $inserted = true; } } if (!$inserted) { $newOp[] = ['role' => 'Chief Checker', 'man_power' => '', 'actual' => '', 'diff' => 0]; } $opManpower = $newOp; } $logManpower = $mpData['logistic'] ?? \App\Models\FinalPlanning::getDefaultManpowerData()['logistic']; $hasHeadWarehouse = false; foreach ($logManpower as $r) { if (strcasecmp($r['role'] ?? '', 'Head Warehouse') === 0) { $hasHeadWarehouse = true; break; } } if (!$hasHeadWarehouse) { $newLog = []; $inserted = false; foreach ($logManpower as $r) { if (!$inserted && strcasecmp($r['role'] ?? '', 'Signal') === 0) { $newLog[] = ['role' => 'Head Warehouse', 'man_power' => '', 'actual' => '', 'diff' => 0]; $inserted = true; } $newLog[] = $r; } if (!$inserted) { array_unshift($newLog, ['role' => 'Head Warehouse', 'man_power' => '', 'actual' => '', 'diff' => 0]); } $logManpower = $newLog; } $mpTotals = $mpData['totals'] ?? ['total_man_power' => 0, 'total_actual' => 0, 'total_diff' => 0]; $eqData = $planning->equipment_data ?? \App\Models\FinalPlanning::getDefaultEquipmentData(); $budData = $planning->estimate_budget_data ?? \App\Models\FinalPlanning::getDefaultEstimateBudgetData(); $budOp = $budData['operational'] ?? ['personnel_fee' => '', 'supporting_fee' => '']; $budLog = $budData['logistic'] ?? ['personnel_fee' => '', 'supporting_fee' => '']; $budTotals = $budData['totals'] ?? ['sum_personnel_fee' => 0, 'sum_supporting_fee' => 0, 'total_budget' => 0]; // Helper formatter for budget in rupiah $formatRupiah = function($val) { if ($val === '' || $val === null || $val === '-') return '-'; $num = (float) preg_replace('/[^\d]/', '', (string)$val); return $num > 0 ? ('Rp ' . number_format($num, 0, ',', '.')) : '-'; }; @endphp {{-- ============================================================== --}} {{-- 1. DEPLOYMENT / MAN POWER PREVIEW --}} {{-- ============================================================== --}}
Alokasi personel regu kerja (Operational & Logistic) vs realisasi aktual di lapangan
| Deployment | Man Power | Actual | Difference (Men) |
|---|---|---|---|
| Operational : | |||
| {{ $row['role'] }} | {{ $planDisplay }} | {{ $actDisplay }} | {{ abs($diffVal) }} |
| Logistic : | |||
| {{ $row['role'] }} | {{ $planDisplay }} | {{ $actDisplay }} | {{ $diffVal }} |
| Total | {{ ($mpTotals['total_man_power'] ?? 0) > 0 ? ($mpTotals['total_man_power'] . ' Men') : '-' }} | {{ ($mpTotals['total_actual'] ?? 0) > 0 ? ($mpTotals['total_actual'] . ' Men') : '-' }} | {{ abs((int)($mpTotals['total_diff'] ?? 0)) }} |
Kebutuhan armada alat mekanik Operational dan rotasi rencana vs aktual
| No | Item | Capacity | Unit | Planning (Unit) | Shift/Rit Rencana | Aktual (Unit) | Shift/Rit Aktual | Note |
|---|---|---|---|---|---|---|---|---|
| {{ $eq['no'] ?? ($eqIdx + 1) }} | {{ $eq['item'] ?? '-' }} | @endif{{ $sub['capacity'] ?? '-' }} | {{ $sub['unit'] ?? '-' }} | {{ !empty($sub['planning_unit']) ? $sub['planning_unit'] : '-' }} | {{ !empty($sub['shift_rit_rencana']) ? $sub['shift_rit_rencana'] : '-' }} | {{ !empty($sub['aktual_unit']) ? $sub['aktual_unit'] : '-' }} | {{ !empty($sub['shift_rit_aktual']) ? $sub['shift_rit_aktual'] : '-' }} | {{ !empty($sub['note']) ? $sub['note'] : '-' }} |
Perhitungan estimasi biaya Personnel Fee & Supporting Fee (Operational & Logistic)
| Kategori Biaya | Personnel Fee | Supporting Fee |
|---|---|---|
| Operational | {{ $formatRupiah($budOp['personnel_fee'] ?? '') }} | {{ $formatRupiah($budOp['supporting_fee'] ?? '') }} |
| Logistic | {{ $formatRupiah($budLog['personnel_fee'] ?? '') }} | {{ $formatRupiah($budLog['supporting_fee'] ?? '') }} |
| Sum | {{ $formatRupiah($budTotals['sum_personnel_fee'] ?? 0) }} | {{ $formatRupiah($budTotals['sum_supporting_fee'] ?? 0) }} |
| Total | {{ $formatRupiah($budTotals['total_budget'] ?? 0) }} | |