@php $prefillLines = []; if ($prefillPo) { $po = $orders->firstWhere('po_no', $prefillPo); if ($po) { $prefillLines = $po->lines->map(fn ($l) => [ 'item' => $l->item, 'expected_qty' => $l->qty, 'received_qty' => $l->qty, 'unit' => $l->unit, 'unit_cost' => $l->unit_price, 'condition' => 'Good', 'notes' => '', ])->all(); } } $seed = old('lines', $prefillLines ?: [['item' => '', 'expected_qty' => 0, 'received_qty' => 1, 'unit' => '', 'unit_cost' => '', 'condition' => 'Good', 'notes' => '']]); @endphp
@csrf @if ($method === 'PUT') @method('PUT') @endif
{{ $grnNo }} Confirmation updates store stock levels.
@if ($prefillPo)

Expected quantities pre-filled from {{ $prefillPo }}.

@endif

Line Items

@foreach ($seed as $i => $line) @include('inventory.partials.grn-line', ['prefix' => $prefix, 'i' => $i, 'line' => $line]) @endforeach
Total Value KSh 0