@extends('documents.procurement._layout', [ 'documentTitle' => 'Material Picking List', 'reference' => $order->production_reference, 'documentDate' => now()->format('d M Y'), ]) @section('header-meta')
{{ strtoupper(str_replace('_', ' ', $order->status)) }}
Product: {{ $order->product?->name ?? '—' }}
Planned Qty: {{ number_format($order->planned_quantity) }} {{ $order->quantity_uom ?? $order->product?->uom ?? '' }}
@endsection @section('content') @php $estimatedConsumptions = $order->materialConsumptions->filter(fn ($c) => $c->consumed_at === null); $hasConsumptions = $estimatedConsumptions->isNotEmpty(); $hasBomItems = $order->bom && $order->bom->items->isNotEmpty(); @endphp {{-- Location + Date block --}}
Production Location:
{{ $order->location?->name ?? '—' }}
Production Date:
{{ \Carbon\Carbon::parse($order->production_date)->format('d M Y') }}
@if($order->bom) BOM: {{ $order->bom->bom_reference }} @if($order->bom->name) — {{ $order->bom->name }} @endif @endif
{{-- Picking rows — prefer materialConsumptions (estimated) if available, else fall back to BOM items --}} @if($hasConsumptions)

Materials to Pick

Pre-populated from Bill of Materials. Tick each line when picked.

@foreach($estimatedConsumptions->values() as $i => $c) @endforeach
# Raw Material SKU Inventory Lot Est. Quantity UoM Picked ✓
{{ $i + 1 }} {{ $c->product?->name ?? '—' }} {{ $c->product?->sku ?? '—' }} {{ $c->lot?->lot_number ?? '— any lot —' }} {{ number_format((float) ($c->estimated_quantity ?? 0), 4) }} {{ $c->quantity_uom ?? $c->product?->uom ?? '—' }}
@elseif($hasBomItems)

Materials to Pick

Calculated from BOM — quantities include wastage allowance.

@foreach($order->bom->items as $i => $item) @php $effPerUnit = (float) $item->quantity_per_unit * (1 + ($item->wastage_pct ?? 0) / 100); $totalRequired = $effPerUnit * $order->planned_quantity; @endphp @endforeach
# Raw Material SKU Qty / Unit Wastage % Total Required UoM Picked ✓
{{ $i + 1 }} {{ $item->componentProduct?->name ?? '—' }} {{ $item->componentProduct?->sku ?? '—' }} {{ number_format((float) $item->quantity_per_unit, 4) }} {{ number_format((float) ($item->wastage_pct ?? 0), 2) }}% {{ number_format($totalRequired, 4) }} {{ $item->quantity_uom ?? $item->componentProduct?->uom ?? '—' }}
@else

No material requirements found. Please populate from BOM before printing.

@endif {{-- Confirmation block --}}
Requested by
{{ $order->submittedBy?->name ?? '—' }}
Picked by (Store)
Name & Date
Received by (Production)
Name & Date
@endsection