@php /** @var \App\Models\TallySheet $tallySheet */ $currentType = old('operation_type', $tallySheet->operation_type ?? 'discharging'); if (!in_array($currentType, ['discharging', 'loading'])) { $currentType = 'discharging'; } $rawSheets = old('sheets', $tallySheet->resolved_sheets ?? []); if (empty($rawSheets)) { $rawSheets = [ [ 'sheet_no' => old('sheet_no', $tallySheet->sheet_no ?: '1'), 'date' => old('commenced_date', $tallySheet->commenced_date ?: ($tallySheet->berthed_date ?: '')), 'tally_items' => old('tally_items', $tallySheet->tally_items ?? \App\Models\TallySheet::getDefaultTallyItems(10)), 'totals' => $tallySheet->totals ?? \App\Models\TallySheet::getDefaultTotals(), ] ]; } $titleVal = old('title', $tallySheet->title ?: \App\Models\TallySheet::getTitleForType($currentType)); @endphp @if(isset($errors) && $errors->any())
Terdapat beberapa kesalahan pengisian form:
@endif
@csrf @if($tallySheet->exists) @method('PUT') @endif @include('partials.vessel-berthing-pull-bar') {{-- Hidden Operation Type --}} {{-- Top Card: Sheet No & Status --}}
{{-- 1. Sheet No --}}

No lembar default.

{{-- 2. Status Dokumen --}}

Draft atau Selesai.

{{-- Main Document Card (Matching the exact Tally Sheet Paper Sheet) --}}
{{-- Document Header --}}

{{ $titleVal }}

{{ old('sheet_no', $tallySheet->sheet_no ?? '1') }}
{{-- Section 1: Vessel & Port Info (Unified 2-Column Grid) --}}
{{-- Left Column --}}
NAME OF VESSEL : MV.
VOY. NO :
BERTH :
LOADING PORT :
DISCHARGING PORT :
{{-- Right Column --}}
BERTHED TIME : ON :
COMMENCED TIME : ON :
COMPLETED TIME : ON :
{{-- Section 2: Multi-Sheet Navigation & Tables --}}
@foreach($rawSheets as $sIdx => $sheet) @endforeach
{{-- Containers for each Sheet --}}
@foreach($rawSheets as $sIdx => $sheet) @php $sItems = $sheet['tally_items'] ?? \App\Models\TallySheet::getDefaultTallyItems(10); $sTotals = $sheet['totals'] ?? \App\Models\TallySheet::getDefaultTotals(); $sNo = $sheet['sheet_no'] ?? ($sIdx + 1); @endphp
{{-- Sheet Info Header --}}
{{-- Main Tally Table for this Sheet --}}
@for($col = 1; $col <= 10; $col++) @endfor @foreach($sItems as $rIdx => $item) @php $rowTally = $item['tally'] ?? array_fill(0, 10, ''); @endphp @for($c = 0; $c < 10; $c++) @endfor @endforeach
B/L NO. DESCRIPTION OF CARGO TALLY TOTAL #
{{ $col }}UNITS PKGS
TOTAL SHEET INI {{ number_format((float)($sTotals['total_units'] ?? 0)) }} {{ number_format((float)($sTotals['total_pkgs'] ?? 0)) }}
Total Units & Pkgs otomatis dihitung per sheet
@endforeach
{{-- Keterangan Tambahan --}}
{{-- Action Buttons --}}
Batal