@extends('documents.procurement._layout', [ 'documentTitle' => 'Haulage / Delivery Note', 'reference' => $shipment->shipment_reference, 'documentDate' => now()->format('d M Y'), ]) @section('header-meta')
Status: {{ ucwords(str_replace('_', ' ', $shipment->status)) }}
@if($shipment->haulageRecords->count())
Haulage Records: {{ $shipment->haulageRecords->count() }}
@endif @endsection @section('content') @if($shipment->haulageRecords->isEmpty())

No haulage records have been created for this shipment yet.

@else @foreach($shipment->haulageRecords as $idx => $haul) @if($idx > 0)
@endif {{-- Haulage header --}}

Delivery Note — {{ $haul->haulage_reference ?? "Haulage #".($idx+1) }}

@if($haul->haulageCompany) @endif @if($haul->driver_name) @endif @if($haul->driver_contact) @endif @if($haul->vehicle_registration) @endif @if($haul->external_waybill_number) @endif
Haulage Company {{ $haul->haulageCompany->name }}
Driver Name {{ $haul->driver_name }}
Driver Contact {{ $haul->driver_contact }}
Vehicle Registration {{ $haul->vehicle_registration }}
Waybill Number {{ $haul->external_waybill_number }}
{{-- Route --}}
From (Origin) To (Destination Warehouse) Departure Date Arrival Date Status
{{ $haul->originPort?->name ?? '—' }} @if($haul->originPort?->code) ({{ $haul->originPort->code }}) @endif {{ $haul->destinationLocation?->name ?? '—' }} {{ $haul->departure_date ? \Carbon\Carbon::parse($haul->departure_date)->format('d M Y') : '—' }} {{ $haul->arrival_date ? \Carbon\Carbon::parse($haul->arrival_date)->format('d M Y') : '—' }} {{ ucwords(str_replace('_', ' ', $haul->status ?? '')) }}
{{-- Items being delivered --}} @foreach($shipment->items as $i => $item) @endforeach
# Product SKU Qty Shipped UoM Received
{{ $i + 1 }} {{ $item->sourcingTripItem?->product?->name ?? '—' }} {{ $item->sourcingTripItem?->product?->sku ?? '—' }} {{ number_format($item->quantity_shipped, 0) }} {{ $item->quantity_uom ?? $item->sourcingTripItem?->product?->uom ?? '—' }}
{{-- Signature block --}}
Driver Sign-Out
Name: ___________________________
Date: ___________________________
Signature: ______________________
Warehouse Manager Sign-In
Name: ___________________________
Date: ___________________________
Signature: ______________________
@endforeach @endif @endsection