@section('page-title', 'Loading Cargo Summary: MV. ' . ($loadingCargoSummary->vessel_name ?: '-')) @php $items = $loadingCargoSummary->cargo_items ?? []; $totals = $loadingCargoSummary->totals ?? []; $totUnits = $totals['total_units'] ?? 0; $totPkgs = $totals['total_pkgs'] ?? 0; $totMTons = $totals['total_m_tons'] ?? 0; $totCbm = $totals['total_cbm'] ?? 0; $displayRowsCount = max(count($items), 15); @endphp
Kembali ke daftar Loading Cargo Summary

Loading Cargo Summary: MV. {{ $loadingCargoSummary->vessel_name ?: '-' }}

Voyage: {{ $loadingCargoSummary->voyage ?: '-' }} • Dermaga: {{ $loadingCargoSummary->berth ?: '-' }} • Loading Port: {{ $loadingCargoSummary->loading_port ?: '-' }}

@if(auth()->user()?->canModule('checker', 'edit')) Edit @endif Cetak / Print
@if(session('success'))
{{ session('success') }}
@endif {{-- Main Document Card (Matches Attached Document Exactly) --}}
{{-- Document Header --}}

LOADING CARGO SUMMARY

{{ $loadingCargoSummary->sheet_no ?: '1' }}
{{-- Vessel & Voyage Header Info --}}
NAME OF VESSEL : MV. {{ $loadingCargoSummary->vessel_name ?: '-' }} VOY. : {{ $loadingCargoSummary->voyage ?: '-' }}
BERTH : {{ $loadingCargoSummary->berth ?: '-' }} BERTHED ON :
{{ $loadingCargoSummary->berthed_date ?: '-' }} AT : {{ $loadingCargoSummary->berthed_time ?: '-' }} HRS
LOADING PORT : {{ $loadingCargoSummary->loading_port ?: '-' }} DEPARTURE ON :
{{ $loadingCargoSummary->departure_date ?: '-' }} AT : {{ $loadingCargoSummary->departure_time ?: '-' }} HRS
@php $sheets = $loadingCargoSummary->resolved_sheets; @endphp {{-- Cargo Summary Tables (Multi-Sheet Supported) --}}
@if(count($sheets) > 1)
@foreach($sheets as $sIdx => $sh) @endforeach
@endif @foreach($sheets as $sIdx => $sh) @php $sItems = $sh['cargo_items'] ?? []; $sTotals = $sh['totals'] ?? []; $sUnits = $sTotals['total_units'] ?? 0; $sPkgs = $sTotals['total_pkgs'] ?? 0; $sMtons = $sTotals['total_m_tons'] ?? 0; $sCbm = $sTotals['total_cbm'] ?? 0; $sNo = $sh['sheet_no'] ?? ($sIdx + 1); $displayRowsCount = max(count($sItems), 12); @endphp

Sheet {{ $sNo }} @if(!empty($sh['date'])) Tanggal: {{ $sh['date'] }} @endif

Lembar ke-{{ $sIdx + 1 }} dari {{ count($sheets) }}
@for($i = 0; $i < $displayRowsCount; $i++) @php $row = $sItems[$i] ?? []; @endphp @endfor
DISCHARGING PORT
B/L NO
DESTINATION
PORT
DESCRIPTION OF CARGO UNITS PKGS TONS CBM
{{ $row['discharging_port_bl'] ?? '' }} {{ $row['destination_port'] ?? '' }} {{ $row['description'] ?? '' }} {{ isset($row['units']) && $row['units'] !== '' ? $row['units'] : '' }} {{ isset($row['pkgs']) && $row['pkgs'] !== '' ? $row['pkgs'] : '' }} {{ isset($row['m_tons']) && $row['m_tons'] !== '' ? $row['m_tons'] : '' }} {{ isset($row['cbm']) && $row['cbm'] !== '' ? $row['cbm'] : '' }}
TOTAL {{ number_format((float)$sUnits) }} {{ $sPkgs > 0 ? number_format((float)$sPkgs) : '' }} {{ formatDecimal($sMtons, 3, true) }} {{ formatDecimal($sCbm, 3, true) }}
@endforeach
{{-- Danger Zone: Hapus Dokumen --}} @if(auth()->user()?->canModule('checker', 'delete'))
@csrf @method('DELETE')
@endif