{{-- PARTIAL: OPERATIONAL SECTIONS FOR MODULE DASHBOARD / INDEX HUB Used across: - Final Planning Dashboard (final-planning/index.blade.php) - Evaluation Dashboard (evaluation/index.blade.php) Variables expected: - $plannings: Paginator / Collection of planning records - $moduleSlug: e.g. 'pre-planning', 'interm-planning', 'final-planning', 'evaluation' - $moduleName: e.g. 'Pre Planning', 'Interm Planning', 'Final Planning', 'Evaluation' --}} @php $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 {{-- ============================================================== --}} {{-- SEKSI 4: SEQUENCING CARGO OPERATION --}} {{-- ============================================================== --}}

Sequencing Cargo Operation

Estimasi standar performa (STD) vs realisasi aktual durasi pembongkaran & pemuatan kargo

@forelse($plannings as $pObj) @php $rawSeq = $pObj->sequencing_cargo_data ?? []; $dischargingData = $rawSeq['discharging'] ?? (isset($rawSeq['rows']) ? $rawSeq : null); $loadingData = $rawSeq['loading'] ?? null; $shiftingData = $rawSeq['shifting'] ?? null; $hasDischarging = false; if (!empty($dischargingData) && !empty($dischargingData['rows'])) { foreach ($dischargingData['rows'] as $r) { if (!empty($r['qty']) && $r['qty'] !== '0' && $r['qty'] !== '-') { $hasDischarging = true; break; } } if (!$hasDischarging && !empty($dischargingData['totals']['std_duration_time']) && $dischargingData['totals']['std_duration_time'] !== '0:00') { $hasDischarging = true; } } $hasLoading = false; if (!empty($loadingData) && !empty($loadingData['rows'])) { foreach ($loadingData['rows'] as $r) { if (!empty($r['qty']) && $r['qty'] !== '0' && $r['qty'] !== '-') { $hasLoading = true; break; } } if (!$hasLoading && !empty($loadingData['totals']['std_duration_time']) && $loadingData['totals']['std_duration_time'] !== '0:00') { $hasLoading = true; } } $hasShifting = false; if (!empty($shiftingData) && !empty($shiftingData['rows'])) { foreach ($shiftingData['rows'] as $r) { if (!empty($r['qty']) && $r['qty'] !== '0' && $r['qty'] !== '-') { $hasShifting = true; break; } } if (!$hasShifting && !empty($shiftingData['totals']['actual_duration_time']) && $shiftingData['totals']['actual_duration_time'] !== '0:00') { $hasShifting = true; } } // Fallback: If neither has explicit qty, but discharging rows exist, allow display if (!$hasDischarging && !$hasLoading && !$hasShifting && !empty($dischargingData['rows'])) { $hasDischarging = true; } @endphp
{{-- Vessel Header Bar --}}
{{ $pObj->no_planning }} {{ $pObj->vessel ?: ($pObj->nama_kapal ?: '-') }} @if($pObj->no_voyage) (Voy: {{ $pObj->no_voyage }}) @endif
Detail @if(auth()->user()?->canModule(($moduleSlug ?? '') === 'evaluation' ? 'evaluation' : 'planning', 'edit')) Edit Sequencing @endif
@if($hasDischarging || $hasLoading || $hasShifting) {{-- Discharging Squancing Table --}} @if($hasDischarging && !empty($dischargingData['rows']))
Discharging (Bongkar) @if(!empty($dischargingData['totals']['total_qty'])) Total Qty: {{ number_format((float)$dischargingData['totals']['total_qty']) }} Unit @endif
@foreach($dischargingData['rows'] as $row) @php $stdRateDisplay = !empty($row['std_performance']) ? ($row['std_performance'] . ' ' . ($row['std_unit'] ?? 'Unit/hrs')) : ''; $qtyDisplay = (!empty($row['qty']) && $row['qty'] !== '0') ? $row['qty'] : '-'; $stdTimeDisplay = (!empty($row['std_duration_time']) && $row['std_duration_time'] !== '00:00' && $row['std_duration_time'] !== '-') ? $row['std_duration_time'] : '00:00'; $actPerfDisplay = (!empty($row['actual_performance']) && $row['actual_performance'] !== '-') ? $row['actual_performance'] : '-'; $actUnitDisplay = $row['actual_unit'] ?? ($row['std_unit'] ?? 'Unit/hrs'); $actDurDisplay = (!empty($row['actual_duration']) && $row['actual_duration'] !== '-') ? $row['actual_duration'] : '00:00'; @endphp @endforeach @if(!empty($dischargingData['totals'])) @endif
Discharging STD Performance Qty (Unit/Pkgs) Approx STD Duration Actual Performance Actual Duration
{{ $row['category'] ?? '-' }} @if($stdRateDisplay) ({{ $stdRateDisplay }}) @endif
{{ $qtyDisplay }} {{ $stdTimeDisplay }} Hrs {{ $actPerfDisplay }} {{ $actUnitDisplay }} {{ $actDurDisplay }}
Total Discharging {{ $dischargingData['totals']['total_qty'] ?? '0' }} {{ $dischargingData['totals']['std_duration_time'] ?? '0:00' }} Hrs {{ $dischargingData['totals']['actual_performance'] ?? '-' }} Rate {{ $dischargingData['totals']['actual_duration_time'] ?? '0:00' }}
@endif {{-- Loading Squancing Table --}} @if($hasLoading && !empty($loadingData['rows']))
Loading (Muat) @if(!empty($loadingData['totals']['total_qty'])) Total Qty: {{ number_format((float)$loadingData['totals']['total_qty']) }} Unit @endif
@foreach($loadingData['rows'] as $row) @php $stdRateDisplay = !empty($row['std_performance']) ? ($row['std_performance'] . ' ' . ($row['std_unit'] ?? 'Unit/hrs')) : ''; $qtyDisplay = (!empty($row['qty']) && $row['qty'] !== '0') ? $row['qty'] : '-'; $stdTimeDisplay = (!empty($row['std_duration_time']) && $row['std_duration_time'] !== '00:00' && $row['std_duration_time'] !== '-') ? $row['std_duration_time'] : '00:00'; $actPerfDisplay = (!empty($row['actual_performance']) && $row['actual_performance'] !== '-') ? $row['actual_performance'] : '-'; $actUnitDisplay = $row['actual_unit'] ?? ($row['std_unit'] ?? 'Unit/hrs'); $actDurDisplay = (!empty($row['actual_duration']) && $row['actual_duration'] !== '-') ? $row['actual_duration'] : '00:00'; @endphp @endforeach @if(!empty($loadingData['totals'])) @endif
Loading STD Performance Qty (Unit/Pkgs) Approx STD Duration Actual Performance Actual Duration
{{ $row['category'] ?? '-' }} @if($stdRateDisplay) ({{ $stdRateDisplay }}) @endif
{{ $qtyDisplay }} {{ $stdTimeDisplay }} Hrs {{ $actPerfDisplay }} {{ $actUnitDisplay }} {{ $actDurDisplay }}
Total Loading {{ $loadingData['totals']['total_qty'] ?? '0' }} {{ $loadingData['totals']['std_duration_time'] ?? '0:00' }} Hrs {{ $loadingData['totals']['actual_performance'] ?? '-' }} Rate {{ $loadingData['totals']['actual_duration_time'] ?? '0:00' }}
@endif {{-- Shifting Squancing Table --}} @if($hasShifting && !empty($shiftingData['rows']))
Shifting @if(!empty($shiftingData['totals']['total_qty'])) Total Qty: {{ number_format((float)$shiftingData['totals']['total_qty']) }} Unit @endif
@foreach($shiftingData['rows'] as $row) @php $qtyDisplay = (!empty($row['qty']) && $row['qty'] !== '0') ? $row['qty'] : '-'; $actPerfDisplay = (!empty($row['actual_performance']) && $row['actual_performance'] !== '-') ? $row['actual_performance'] : '-'; $actDurDisplay = (!empty($row['actual_duration']) && $row['actual_duration'] !== '-') ? $row['actual_duration'] : '00:00'; @endphp @endforeach @if(!empty($shiftingData['totals']) || !empty($shiftingData['rows'])) @php $shiftingActPerfMinutes = 0; foreach ($shiftingData['rows'] as $r) { $val = trim((string)($r['actual_performance'] ?? '')); if ($val !== '' && $val !== '-' && $val !== '00:00' && $val !== '0:00') { if (str_contains($val, ':')) { $PART = explode(':', $val); $shiftingActPerfMinutes += (intval($PART[0]) * 60) + intval($PART[1] ?? 0); } elseif (str_contains($val, '.')) { $PART = explode('.', $val); $shiftingActPerfMinutes += (intval($PART[0]) * 60) + intval($PART[1] ?? 0); } else { $shiftingActPerfMinutes += intval(floatval($val) * 60); } } } $shiftingActPerfH = floor($shiftingActPerfMinutes / 60); $shiftingActPerfM = $shiftingActPerfMinutes % 60; $defaultShiftingActPerfTime = sprintf('%d:%02d', $shiftingActPerfH, $shiftingActPerfM); $defaultShiftingActPerfFormatted = sprintf('%dhr%02dmin', $shiftingActPerfH, $shiftingActPerfM); $shiftingActPerfTotal = !empty($shiftingData['totals']['actual_performance_time']) && $shiftingData['totals']['actual_performance_time'] !== '0:00' ? $shiftingData['totals']['actual_performance_time'] : ($shiftingActPerfMinutes > 0 ? $defaultShiftingActPerfTime : ($shiftingData['totals']['actual_performance'] ?? '0:00')); $shiftingActPerfFormatted = !empty($shiftingData['totals']['actual_performance_formatted']) && $shiftingData['totals']['actual_performance_formatted'] !== '0hr00min' ? $shiftingData['totals']['actual_performance_formatted'] : ($shiftingActPerfMinutes > 0 ? $defaultShiftingActPerfFormatted : ''); @endphp @endif
Shifting Qty (Unit/Pkgs) Actual Working Time Actual Duration
{{ $row['category'] ?? '-' }} {{ $qtyDisplay }} {{ $actPerfDisplay }} {{ $actDurDisplay }}
TOTAL {{ (!empty($shiftingData['totals']['total_qty']) && $shiftingData['totals']['total_qty'] !== '0') ? number_format((float)$shiftingData['totals']['total_qty']) : '-' }}
{{ $shiftingActPerfTotal }} @if(!empty($shiftingActPerfFormatted) && $shiftingActPerfFormatted !== '0hr00min') ({{ $shiftingActPerfFormatted }}) @endif
{{ $shiftingData['totals']['actual_duration_time'] ?? '0:00' }}
@endif @else

Belum ada rincian data Sequencing Cargo Operation untuk kapal ini

Anda dapat mengisi standar performa dan durasi kerja melalui tombol Edit Sequencing.

@endif
@empty

Belum ada data {{ $moduleName }}

@endforelse
{{-- ============================================================== --}} {{-- SEKSI 5: OPERATION STRATEGIC --}} {{-- ============================================================== --}}

Operation Strategic

Estimasi durasi waktu Operational (Plan) vs realisasi aktual (Actual)

@forelse($plannings as $pObj) @php $rawOpStrat = $pObj->ops_strategic_data ?? $pObj->operation_strategic_data ?? \App\Models\FinalPlanning::getDefaultOperationStrategicData(); $opStrat = \App\Models\FinalPlanning::normalizeOperationStrategicTimesToColon(is_array($rawOpStrat) ? $rawOpStrat : []); $hasOpStrat = !empty($opStrat['total_approx_duration']) || !empty($opStrat['meal_break']) || !empty($opStrat['available_time']) || !empty($opStrat['actual_duration']) || !empty($opStrat['actual_meal_break']) || !empty($opStrat['actual_available_time']); @endphp
{{-- Vessel Header Bar --}}
{{ $pObj->no_planning }} {{ $pObj->vessel ?: ($pObj->nama_kapal ?: '-') }} @if($pObj->no_voyage) (Voy: {{ $pObj->no_voyage }}) @endif
Detail @if(auth()->user()?->canModule(($moduleSlug ?? '') === 'evaluation' ? 'evaluation' : 'planning', 'edit')) Edit Strategic @endif
{{-- 3 Quick KPI Cards --}}
Total Approx Duration
Plan: {{ $opStrat['total_approx_duration'] ?? '-' }} Hrs Actual: {{ $opStrat['actual_duration'] ?? '-' }} Hrs
Meal Break
Plan: {{ $opStrat['meal_break'] ?? '-' }} Hrs Actual: {{ $opStrat['actual_meal_break'] ?? '-' }} Hrs
Available Time
Plan: {{ $opStrat['available_time'] ?? '-' }} Hrs Actual: {{ $opStrat['actual_available_time'] ?? '-' }} Hrs
{{-- Operation Strategic Table --}}
{{-- Row 1: Total Approx Duration --}} {{-- Row 2: Waiting Cargo / Document --}} {{-- Row 3: Idle Time / Stop Operation --}} {{-- Row 4: Shifting --}} {{-- Row 5: MEAL BREAK --}} {{-- Row 3: AVAILABLE TIME --}}
Operation Strategic (Plan) Plan Duration Time Operation Strategic (Actual) Actual Duration Time
Total Approximately Duration Time {{ $opStrat['total_approx_duration'] ?? '-' }} Hrs Actual Duration Time {{ $opStrat['actual_duration'] ?? '-' }} Hrs
Waiting Cargo / Document {{ $opStrat['waiting_cargo_doc'] ?? '-' }} Hrs Waiting Cargo / Document {{ $opStrat['actual_waiting_cargo_doc'] ?? '-' }} Hrs
Idle Time / Stop Operation {{ $opStrat['idle_time'] ?? '-' }} Hrs Idle Time / Stop Operation {{ $opStrat['actual_idle_time'] ?? '-' }} Hrs
Shifting {{ $opStrat['shifting'] ?? '-' }} Hrs Shifting {{ $opStrat['actual_shifting'] ?? '-' }} Hrs
MEAL BREAK {{ $opStrat['meal_break'] ?? '-' }} Hrs Meal Break (Actual) {{ $opStrat['actual_meal_break'] ?? '-' }} Hrs
AVAILABLE TIME {{ $opStrat['available_time'] ?? '-' }} Hrs Available Time (Actual) {{ $opStrat['actual_available_time'] ?? '-' }} Hrs
@empty

Belum ada data {{ $moduleName }}

@endforelse
{{-- ============================================================== --}} {{-- SEKSI 6: DEPLOYMENT / MAN POWER --}} {{-- ============================================================== --}}

Deployment / Man Power

Alokasi personel regu kerja (Operational & Logistic) vs realisasi aktual di lapangan

@forelse($plannings as $pObj) @php $mpData = $pObj->manpower_data ?? \App\Models\FinalPlanning::getDefaultManpowerData(); $opManpower = $mpData['operational'] ?? \App\Models\FinalPlanning::getDefaultManpowerData()['operational']; $logManpower = $mpData['logistic'] ?? \App\Models\FinalPlanning::getDefaultManpowerData()['logistic']; $mpTotals = $mpData['totals'] ?? ['total_man_power' => 0, 'total_actual' => 0, 'total_diff' => 0]; @endphp
{{-- Vessel Header Bar --}}
{{ $pObj->no_planning }} {{ $pObj->vessel ?: ($pObj->nama_kapal ?: '-') }} @if($pObj->no_voyage) (Voy: {{ $pObj->no_voyage }}) @endif
Detail @if(auth()->user()?->canModule(($moduleSlug ?? '') === 'evaluation' ? 'evaluation' : 'planning', 'edit')) Edit Deployment @endif
{{-- Summary Pills --}}
Plan Man Power: {{ $mpTotals['total_man_power'] ?? 0 }} Men Actual: {{ $mpTotals['total_actual'] ?? 0 }} Men @php $totDiff = abs((int)($mpTotals['total_diff'] ?? 0)); @endphp Diff: {{ $totDiff }} Men
{{-- Deployment Table --}}
{{-- Operational Group --}} @foreach($opManpower as $row) @php $planDisplay = (!empty($row['man_power']) && $row['man_power'] !== '0') ? ($row['man_power'] . ' Men') : '-'; $actDisplay = (!empty($row['actual']) && $row['actual'] !== '0') ? ($row['actual'] . ' Men') : '-'; $diffVal = abs((int)($row['diff'] ?? 0)); @endphp @endforeach {{-- Logistic Group --}} @foreach($logManpower as $row) @php $planDisplay = (!empty($row['man_power']) && $row['man_power'] !== '0') ? ($row['man_power'] . ' Men') : '-'; $actDisplay = (!empty($row['actual']) && $row['actual'] !== '0') ? ($row['actual'] . ' Men') : '-'; $diffVal = abs((int)($row['diff'] ?? 0)); @endphp @endforeach
Deployment / Role Man Power (Plan) Actual Difference (Men)
Operational :
{{ $row['role'] }} {{ $planDisplay }} {{ $actDisplay }} {{ $diffVal }}
Logistic :
{{ $row['role'] }} {{ $planDisplay }} {{ $actDisplay }} {{ $diffVal }}
Total Man Power {{ $mpTotals['total_man_power'] ?? 0 }} Men {{ $mpTotals['total_actual'] ?? 0 }} Men {{ $totDiff }}
@empty

Belum ada data {{ $moduleName }}

@endforelse
{{-- ============================================================== --}} {{-- SEKSI 7: MECHANICAL EQUIPMENT --}} {{-- ============================================================== --}}

Mechanical Equipment

Alokasi kesiapan alat berat mekanikal (Forklift, Dolly, Trailer, Tronton, Crane, Tug Master) rencana vs aktual

@forelse($plannings as $pObj) @php $eqData = $pObj->equipment_data ?? \App\Models\FinalPlanning::getDefaultEquipmentData(); @endphp
{{-- Vessel Header Bar --}}
{{ $pObj->no_planning }} {{ $pObj->vessel ?: ($pObj->nama_kapal ?: '-') }} @if($pObj->no_voyage) (Voy: {{ $pObj->no_voyage }}) @endif
Detail @if(auth()->user()?->canModule(($moduleSlug ?? '') === 'evaluation' ? 'evaluation' : 'planning', 'edit')) Edit Equipment @endif
{{-- Equipment Table --}}
@foreach($eqData as $gIdx => $group) @php $subCount = count($group['sub_items'] ?? []); @endphp @foreach($group['sub_items'] ?? [] as $sIdx => $sub) @php $pUnit = (!empty($sub['planning_unit']) && $sub['planning_unit'] !== '-') ? $sub['planning_unit'] : '-'; $pShift = (!empty($sub['shift_rit_rencana']) && $sub['shift_rit_rencana'] !== '-') ? $sub['shift_rit_rencana'] : '-'; $aUnit = (!empty($sub['aktual_unit']) && $sub['aktual_unit'] !== '-') ? $sub['aktual_unit'] : '-'; $aShift = (!empty($sub['shift_rit_aktual']) && $sub['shift_rit_aktual'] !== '-') ? $sub['shift_rit_aktual'] : '-'; $isFirst = ($sIdx === 0); @endphp @if($isFirst) @endif @endforeach @endforeach
No Equipment Capacity / Type Planning Unit Shift/Rit Rencana Aktual Unit Shift/Rit Aktual
{{ $group['no'] ?? ($gIdx + 1) }} {{ $group['item'] }} {{ $sub['capacity'] }} {{ $sub['unit'] ?? '' }} {{ $pUnit }} {{ $pShift }} {{ $aUnit }} {{ $aShift }}
@empty

Belum ada data {{ $moduleName }}

@endforelse
{{-- ============================================================== --}} {{-- SEKSI 8: ESTIMASI BUDGET --}} {{-- ============================================================== --}}

Estimasi Budget

Proyeksi anggaran Operational & logistik (Personnel Fee & Supporting Fee) serta total biaya

@forelse($plannings as $pObj) @php $budData = $pObj->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]; @endphp
{{-- Vessel Header Bar --}}
{{ $pObj->no_planning }} {{ $pObj->vessel ?: ($pObj->nama_kapal ?: '-') }} @if($pObj->no_voyage) (Voy: {{ $pObj->no_voyage }}) @endif
Detail @if(auth()->user()?->canModule(($moduleSlug ?? '') === 'evaluation' ? 'evaluation' : 'planning', 'edit')) Edit Budget @endif
{{-- 3 KPI Cards for Budget --}}
Total Personnel Fee {{ $formatRupiah($budTotals['sum_personnel_fee'] ?? 0) }}
Total Supporting Fee {{ $formatRupiah($budTotals['sum_supporting_fee'] ?? 0) }}
Grand Total Estimasi Budget {{ $formatRupiah($budTotals['total_budget'] ?? 0) }}
{{-- Budget Breakdown Table --}}
{{-- Operational --}} {{-- Logistic --}}
Divisi Operational Personnel Fee Supporting Fee
1. Operational Cost {{ $formatRupiah($budOp['personnel_fee'] ?? '') }} {{ $formatRupiah($budOp['supporting_fee'] ?? '') }}
2. Logistic Cost {{ $formatRupiah($budLog['personnel_fee'] ?? '') }} {{ $formatRupiah($budLog['supporting_fee'] ?? '') }}
Subtotal Fee {{ $formatRupiah($budTotals['sum_personnel_fee'] ?? 0) }} {{ $formatRupiah($budTotals['sum_supporting_fee'] ?? 0) }}
@empty

Belum ada data {{ $moduleName }}

@endforelse