@php $resolvedSheets = $timeSheet->resolved_sheets; $vPos = $timeSheet->vessel_positions ?? []; $cargoRows = [ 'cars_cbu' => 'CARS / CBU', 'heavy_high' => 'HEAVY HIGH', 'truck' => 'TRUCK', 'bus' => 'BUS', 'parts_static' => 'PART / STATIC', 'cargo_on_mafi' => 'CARGO ON MAFI', ]; $leftPositions = [ 'time_arrival' => 'TIME ARRIVAL', 'time_pob' => 'TIME POB BERTHING', 'time_first_line' => 'TIME FIRST LINE', 'time_berthed' => 'TIME BERTHED', 'time_open_ramp' => 'TIME OPEN RAMP', 'time_close_ramp' => 'TIME CLOSE RAMP', 'time_sailed' => 'TIME SAILED', ]; $pairedG = [ [ 'left' => ['key' => 'superintendent', 'label' => '- SUPERINTENDENT'], 'right' => ['key' => 'manager_logistic', 'label' => '- MANAGER LOGISTIC'], ], [ 'left' => ['key' => 'chief_foreman', 'label' => '- CHIEF FOREMAN'], 'right' => ['key' => 'ass_manager_logistic', 'label' => '- ASS. MANAGER LOGISTIC'], ], [ 'left' => ['key' => 'chief_checker', 'label' => '- CHIEF CHECKER'], 'right' => ['key' => 'signalman', 'label' => '- SIGNALMAN'], ], [ 'left' => ['key' => 'checker', 'label' => '- CHECKER'], 'right' => ['key' => 'head_yard', 'label' => '- HEAD YARD'], ], [ 'left' => ['key' => 'hatch_boss', 'label' => '- HATCH BOSS'], 'right' => ['key' => 'yard_cbu', 'label' => '- YARD CBU'], ], [ 'left' => ['key' => 'leadman', 'label' => '- LEADMAN'], 'right' => ['key' => 'yard_hh', 'label' => '- YARD HH'], ], [ 'left' => ['key' => 'operator', 'label' => '- OPERATOR'], 'right' => ['key' => 'yard_document', 'label' => '- YARD DOCUMENT'], ], [ 'left' => ['key' => 'parking_drivers', 'label' => '- PARKING DRIVERS'], 'right' => ['key' => 'yard_key_man', 'label' => '- YARD KEY MAN'], ], [ 'left' => ['key' => 'shifting_drivers', 'label' => '- SHIFTING DRIVERS'], 'right' => ['key' => 'hatch_boss_lashing', 'label' => '- HATCH BOSS LASHING'], ], [ 'left' => ['key' => 'junior_drivers', 'label' => '- JUNIOR DRIVERS'], 'right' => ['key' => 'total', 'label' => '- TOTAL'], ], ]; $fmtDate = function($val) { if (!$val) return ''; if (preg_match('/^\d{4}-\d{2}-\d{2}$/', $val)) { return date('d/m/Y', strtotime($val)); } return $val; }; @endphp
← Kembali
Dokumen Time Sheet: {{ $timeSheet->vessel_name ?: 'MV. -' }} • {{ count($resolvedSheets) }} Halaman / Sheet
@foreach($resolvedSheets as $sheetIndex => $sheet) @php $cSum = $sheet['cargo_summary'] ?? []; $sGangs = $sheet['ships_gangs'] ?? []; $tCargo = $sheet['toyota_cargo'] ?? []; $cTotals = $cSum['totals'] ?? []; $laden = $cSum['laden_mafi'] ?? []; $emptyMafi = $cSum['empty_mafi'] ?? []; $sheetNo = $sheet['sheet_no'] ?? ($sheetIndex + 1); @endphp
{{-- Kop Surat Perusahaan --}}
Kop Surat PT. Anugrah Permata Samudra
{{-- Title Header --}}

TIME SHEET

{{ $sheetNo }}
{{-- Vessel & Voyage Info --}}
NAME OF VESSEL : MV. {{ $timeSheet->vessel_name ?: '' }}
BERTH : {{ $timeSheet->berth ?: '' }}
FLAG : {{ $timeSheet->flag ?: '' }}
LOA / G.R.T. : {{ $timeSheet->loa ?: '' }} METERS {{ $timeSheet->grt ?: '' }} TONS
VOY. : {{ $timeSheet->voyage ?: '' }}
SHIPPING LINE : {{ $timeSheet->shipping_line ?: '' }}
SHIP AGENT : {{ $timeSheet->ship_agent ?: '' }}
STEVEDORING : {{ $timeSheet->stevedoring ?: '' }}
@php $printMilestones = [ 'vessel_arrived' => [ 'label' => 'VESSEL ARRIVED', 'aliases' => ['time_arrival'], ], 'pilot_attended_on_board' => [ 'label' => 'PILOT ATTENDED ON BOARD', 'aliases' => ['time_pob', 'time_pob_berthing'], ], 'first_lines' => [ 'label' => 'FIRST LINES', 'aliases' => ['first_line', 'time_first_line'], ], 'berthed_ikt' => [ 'label' => 'BERTHED AT IKT CAR TERMINAL 2 PORT', 'aliases' => ['time_berthed', 'berthed_terminal'], ], 'open_ramp' => [ 'label' => 'OPEN RAMP', 'aliases' => ['time_open_ramp'], ], 'commenced_discharging' => [ 'label' => 'COMMENCED OF DISCHARGING', 'aliases' => ['commenced_disch', 'commenced_operation'], ], 'completed_discharging' => [ 'label' => 'COMPLETED OF DISCHARGING', 'aliases' => ['completed_disch', 'completed_operation'], ], 'commenced_loading' => [ 'label' => 'COMMENCED OF LOADING', 'aliases' => ['commenced_load', 'commenced_of_loading'], ], 'completed_loading' => [ 'label' => 'COMPLETED OF LOADING', 'aliases' => ['completed_load', 'completed_of_loading'], ], 'close_ramp' => [ 'label' => 'CLOSE RAMP', 'aliases' => ['time_close_ramp'], ], 'pilot_on_board_sailing' => [ 'label' => 'PILOT ON BOARD FOR SAILING', 'aliases' => ['time_pob_sailing'], ], 'vessel_sailed_wharf' => [ 'label' => 'VESSEL SAILED FROM WHARF', 'aliases' => ['time_sailed', 'vessel_sailed'], ], ]; $resolvePrintHrs = function($key, $cfg) use ($vPos) { if (!empty($vPos[$key.'_hrs'])) return $vPos[$key.'_hrs']; foreach ($cfg['aliases'] as $al) { if (!empty($vPos[$al.'_hrs'])) return $vPos[$al.'_hrs']; } return ''; }; $resolvePrintDate = function($key, $cfg) use ($vPos) { if (!empty($vPos[$key.'_date'])) return $vPos[$key.'_date']; foreach ($cfg['aliases'] as $al) { if (!empty($vPos[$al.'_date'])) return $vPos[$al.'_date']; } return ''; }; $msPairs = []; foreach ($printMilestones as $k => $c) { $msPairs[] = ['key' => $k, 'cfg' => $c]; } $leftColumn = array_slice($msPairs, 0, 6); $rightColumn = array_slice($msPairs, 6, 6); @endphp {{-- VESSEL POSITION --}}
VESSEL POSITION
@foreach($leftColumn as $item) @php $h = $resolvePrintHrs($item['key'], $item['cfg']); $d = $resolvePrintDate($item['key'], $item['cfg']); @endphp
{{ $item['cfg']['label'] }} : {{ $h }} HRS DATE: {{ $fmtDate($d) }}
@endforeach
@foreach($rightColumn as $item) @php $h = $resolvePrintHrs($item['key'], $item['cfg']); $d = $resolvePrintDate($item['key'], $item['cfg']); @endphp
{{ $item['cfg']['label'] }} : {{ $h }} HRS DATE: {{ $fmtDate($d) }}
@endforeach
{{-- CARGO TABLE --}} @foreach($cargoRows as $k => $label) @php $r = $cSum['rows'][$k] ?? []; @endphp @endforeach
TYPE CARGO DISCHARGING LOADING T O T A L
UNITS PKGS TONS M3 UNITS PKGS TONS M3 UNITS PKGS TONS M3
{{ $label }} {{ $r['disch_units'] ?? '' }} {{ $r['disch_pkgs'] ?? '' }} {{ $r['disch_tons'] ?? '' }} {{ $r['disch_m3'] ?? '' }} {{ $r['load_units'] ?? '' }} {{ $r['load_pkgs'] ?? '' }} {{ $r['load_tons'] ?? '' }} {{ $r['load_m3'] ?? '' }} {{ $r['total_units'] ?? '' }} {{ $r['total_pkgs'] ?? '' }} {{ $r['total_tons'] ?? '' }} {{ $r['total_m3'] ?? '' }}
TOTAL {{ $cTotals['disch_units'] ?? '0' }} {{ $cTotals['disch_pkgs'] ?? '0' }} {{ $cTotals['disch_tons'] ?? '0' }} {{ $cTotals['disch_m3'] ?? '0' }} {{ $cTotals['load_units'] ?? '0' }} {{ $cTotals['load_pkgs'] ?? '0' }} {{ $cTotals['load_tons'] ?? '0' }} {{ $cTotals['load_m3'] ?? '0' }} {{ $cTotals['total_units'] ?? '0' }} {{ $cTotals['total_pkgs'] ?? '0' }} {{ $cTotals['total_tons'] ?? '0' }} {{ $cTotals['total_m3'] ?? '0' }}
LADEN MAFI {{ $laden['disch_units'] ?? '' }} {{ $laden['disch_pkgs'] ?? '' }} {{ $laden['disch_tons'] ?? '' }} {{ $laden['disch_m3'] ?? '' }} {{ $laden['load_units'] ?? '' }} {{ $laden['load_pkgs'] ?? '' }} {{ $laden['load_tons'] ?? '' }} {{ $laden['load_m3'] ?? '' }} {{ $laden['total_units'] ?? '' }} {{ $laden['total_pkgs'] ?? '' }} {{ $laden['total_tons'] ?? '' }} {{ $laden['total_m3'] ?? '' }}
EMPTY MAFI {{ $emptyMafi['disch_units'] ?? '' }} {{ $emptyMafi['disch_pkgs'] ?? '' }} {{ $emptyMafi['disch_tons'] ?? '' }} {{ $emptyMafi['disch_m3'] ?? '' }} {{ $emptyMafi['load_units'] ?? '' }} {{ $emptyMafi['load_pkgs'] ?? '' }} {{ $emptyMafi['load_tons'] ?? '' }} {{ $emptyMafi['load_m3'] ?? '' }} {{ $emptyMafi['total_units'] ?? '' }} {{ $emptyMafi['total_pkgs'] ?? '' }} {{ $emptyMafi['total_tons'] ?? '' }} {{ $emptyMafi['total_m3'] ?? '' }}
LOAD PORT {{ $cSum['load_port'] ?? '' }}
DISCH PORT {{ $cSum['disch_port'] ?? '' }}
{{-- SHIP'S GANGS --}}
@foreach($pairedG as $p) @php $lk = $p['left']['key']; $ll = $p['left']['label']; $rk = $p['right']['key']; $rl = $p['right']['label']; $isTot = ($rk === 'total'); @endphp @endforeach
ANUGRAH PERMATA SAMUDRA CO., LTD.
SHIP'S GANGS
{{ $ll }} : {{ $sGangs[$lk] ?? '' }} PERSON {{ $rl }} : {{ $sGangs[$rk] ?? '' }} PERSON
{{-- TOYOTA / DAIHATSU CARGO (Only for MITSUI O.S.K CO., LTD) --}} @if($timeSheet->isMitsuiOsk())
TOYOTA / DAIHATSU CARGO
@php $tCbu = $tCargo['rows']['cars_cbu'] ?? []; $tHh = $tCargo['rows']['hh_truck_bus'] ?? []; $tParts = $tCargo['rows']['parts_static'] ?? []; $tTotals = $tCargo['totals'] ?? []; @endphp
TYPE CARGO DISCHARGING LOADING TOTAL REMARKS
UNITS PKGS TONS UNITS PKGS TONS UNITS PKGS TONS
CARS / CBU {{ $tCbu['disch_units'] ?? '' }} {{ $tCbu['disch_pkgs'] ?? '' }} {{ $tCbu['disch_tons'] ?? '' }} {{ $tCbu['load_units'] ?? '' }} {{ $tCbu['load_pkgs'] ?? '' }} {{ $tCbu['load_tons'] ?? '' }} {{ $tCbu['total_units'] ?? '' }} {{ $tCbu['total_pkgs'] ?? '' }} {{ $tCbu['total_tons'] ?? '' }} {{ $tCbu['remarks'] ?? '' }}
HH / TRUCK / BUS {{ $tHh['disch_units'] ?? '' }} {{ $tHh['disch_pkgs'] ?? '' }} {{ $tHh['disch_tons'] ?? '' }} {{ $tHh['load_units'] ?? '' }} {{ $tHh['load_pkgs'] ?? '' }} {{ $tHh['load_tons'] ?? '' }} {{ $tHh['total_units'] ?? '' }} {{ $tHh['total_pkgs'] ?? '' }} {{ $tHh['total_tons'] ?? '' }} @if(!empty($tHh['comm_loading'])) COMM LOADING: {{ $tHh['comm_loading'] }} @endif
PART / STATIC {{ $tParts['disch_units'] ?? '' }} {{ $tParts['disch_pkgs'] ?? '' }} {{ $tParts['disch_tons'] ?? '' }} {{ $tParts['load_units'] ?? '' }} {{ $tParts['load_pkgs'] ?? '' }} {{ $tParts['load_tons'] ?? '' }} {{ $tParts['total_units'] ?? '' }} {{ $tParts['total_pkgs'] ?? '' }} {{ $tParts['total_tons'] ?? '' }} @if(!empty($tParts['complt_loading'])) COMPLT LOADING: {{ $tParts['complt_loading'] }} @endif
TOTAL {{ $tTotals['disch_units'] ?? '0' }} {{ $tTotals['disch_pkgs'] ?? '0' }} {{ $tTotals['disch_tons'] ?? '0' }} {{ $tTotals['load_units'] ?? '0' }} {{ $tTotals['load_pkgs'] ?? '0' }} {{ $tTotals['load_tons'] ?? '0' }} {{ $tTotals['total_units'] ?? '0' }} {{ $tTotals['total_pkgs'] ?? '0' }} {{ $tTotals['total_tons'] ?? '0' }}
@endif {{-- Signatures --}}
CHIEF CHECKER
{{ $timeSheet->chief_checker ?: '' }}
CHIEF OFFICER
{{ $timeSheet->chief_officer ?: '' }}
@endforeach