@extends('documents.inventory._layout', [ 'documentTitle' => 'Receipt Confirmation', 'reference' => $order->transfer_reference, 'documentDate' => $order->received_date ? \Carbon\Carbon::parse($order->received_date)->format('d M Y') : now()->format('d M Y'), ]) @section('header-meta')
✓ Received
@endsection @section('content') {{-- Header details --}} @if($order->receiver_comment) @endif
From Location {{ $order->fromLocation?->name ?? '—' }}
Received At {{ $order->toLocation?->name ?? '—' }}
Received By {{ $order->receivedBy?->name ?? '—' }}
Receipt Date {{ $order->received_date ? \Carbon\Carbon::parse($order->received_date)->format('d M Y') : '—' }}
Receiver Notes {{ $order->receiver_comment }}
{{-- Summary strip --}} @php $totalDispatched = $order->items->sum('dispatched_quantity'); $totalReceived = $order->items->sum('received_quantity'); $totalVariance = $totalReceived - $totalDispatched; $hasAnyVariance = $order->items->filter(fn($i) => ($i->received_quantity ?? 0) < ($i->dispatched_quantity ?? 0))->isNotEmpty(); @endphp
Total Dispatched: {{ number_format($totalDispatched) }} Total Received: {{ number_format($totalReceived) }} Net Variance: {{ $totalVariance >= 0 ? '+' : '' }}{{ number_format($totalVariance) }}
{{-- Items table --}}

Items Received

@foreach($order->items as $i => $item) @php $dispatched = $item->dispatched_quantity ?? 0; $received = $item->received_quantity ?? 0; $variance = $received - $dispatched; $rowClass = $variance < 0 ? 'bg-amber' : ($variance > 0 ? 'bg-green' : ''); @endphp @endforeach
# Product Lot Dispatched Received Variance Variance Reason
{{ $i + 1 }} {{ $item->product?->name ?? '—' }} @if($item->product?->sku)
{{ $item->product->sku }}@endif
{{ $item->lot?->lot_number ?? '—' }} {{ number_format($dispatched) }} {{ number_format($received) }} {{ $variance >= 0 ? '+' : '' }}{{ number_format($variance) }} {{ $item->reception_variance_reason ?? ($variance === 0 ? '—' : 'Not specified') }}
Totals {{ number_format($totalDispatched) }} {{ number_format($totalReceived) }} {{ $totalVariance >= 0 ? '+' : '' }}{{ number_format($totalVariance) }}
{{-- Signature block --}}
Received by
Name: {{ $order->receivedBy?->name ?? '___________________________' }}
Date: ___________________________
Signature: ______________________
Approved by (Warehouse Manager)
Name: ___________________________
Date: ___________________________
Signature: ______________________
@endsection