{{-- Shared requisition form (create + edit). Expects: $requisition, $stations, $units, $items, $action (URL), $method (POST|PUT), $submitLabel --}} @php $isStationUser = auth()->user()->role === \App\Models\User::ROLE_STATION && auth()->user()->station_id; $itemsById = $items->keyBy('id'); $catalogData = $items->map(fn($i) => [ 'id' => $i->id, 'name' => $i->name, 'sku' => $i->sku, 'uom' => $i->uom_id, 'cost' => (float) $i->estimated_unit_cost, ])->values(); $initialLines = old('lines', $requisition->exists ? $requisition->items->map(fn($l) => [ 'item_id' => $l->item_id, 'description' => $l->description, 'quantity' => $l->quantity, 'uom_id' => $l->uom_id, 'estimated_unit_cost' => $l->estimated_unit_cost, 'notes' => $l->notes, ])->values()->toArray() : []); @endphp @if($errors->any())
Please fix the following:
@endif @if(session('duplicate_warning'))
Possible duplicate request

A similar requisition from this station was raised in the last {{ \App\Services\DuplicateDetector::WINDOW_DAYS }} days:

@endif
@csrf @if(strtoupper($method) !== 'POST') @method($method) @endif
Requisition Details
{{-- Procurement Method & Cost Centre are set later by PAL / Procurement, not the requester. --}}
Line Items

Start typing in the Item box — matching catalogue products are suggested. Pick one to auto-fill unit & cost, or just type a free-text item.

@foreach($initialLines as $i => $line) @php $displayText = ($line['item_id'] ?? null) && isset($itemsById[$line['item_id']]) ? $itemsById[$line['item_id']]->name : ($line['description'] ?? ''); @endphp @endforeach
Item Qty Unit Unit Cost Line Total
0.00
Estimated Total 0.00
Routing
The JCF formation station this request originates from. @error('formation_id'){{ $message }}@enderror
Cancel
{{-- Quick-add item modal (used when a searched product isn't in the catalogue) --}} @push('form-scripts') @endpush @push('form-scripts') {{-- Searchable Formation-station picker (Choices.js) over ~350 stations --}} @endpush