@extends('documents.inventory._layout', [ 'documentTitle' => 'Dispatch Note', 'reference' => $order->transfer_reference, 'documentDate' => $order->dispatched_date ? \Carbon\Carbon::parse($order->dispatched_date)->format('d M Y') : now()->format('d M Y'), ]) @section('header-meta')
Status: {{ ucwords(str_replace('_', ' ', $order->status)) }}
@endsection @section('content') {{-- Route summary --}} @if($order->dispatch_date) @endif @if($order->dispatcher_comment) @endif
From {{ $order->fromLocation?->name ?? '—' }} ({{ $order->fromLocation?->type ?? '' }})
To {{ $order->toLocation?->name ?? '—' }} ({{ $order->toLocation?->type ?? '' }})
Dispatched By {{ $order->dispatchedBy?->name ?? '—' }}
Dispatch Date {{ \Carbon\Carbon::parse($order->dispatched_date)->format('d M Y') }}
Dispatcher Notes {{ $order->dispatcher_comment }}
{{-- Items dispatched --}}

Items Dispatched

@foreach($order->items as $i => $item) @php $hasVariance = $item->dispatched_quantity !== null && $item->dispatched_quantity < $item->requested_quantity; @endphp @if($hasVariance && $item->dispatch_variance_reason) @endif @endforeach
# Product Lot Requested Dispatched UoM
{{ $i + 1 }} {{ $item->product?->name ?? '—' }} @if($item->product?->sku)
{{ $item->product->sku }}@endif
{{ $item->lot?->lot_number ?? 'Any' }} {{ number_format($item->requested_quantity) }} {{ $item->dispatched_quantity !== null ? number_format($item->dispatched_quantity) : '—' }} {{ $item->quantity_uom ?? $item->product?->uom ?? '' }}
⚠ Variance reason: {{ $item->dispatch_variance_reason }}
Totals {{ number_format($order->items->sum('requested_quantity')) }} {{ number_format($order->items->sum('dispatched_quantity')) }}
{{-- Signature block --}}
Dispatched by
Name: {{ $order->dispatchedBy?->name ?? '___________________________' }}
Date: ___________________________
Signature: ______________________
Received at Destination
Name: ___________________________
Date: ___________________________
Signature: ______________________
@endsection