@extends('layouts.app') @section('title', 'Purchase Requisition') @section('content') @php $money = fn ($v) => \App\Support\Fmt::money($v); $num = fn ($v) => \App\Support\Fmt::plain($v, 2); $day = fn ($v) => \App\Support\Fmt::day($v instanceof \DateTimeInterface ? $v->format('Y-m-d') : $v); $sel = 'h-9 w-full rounded-lg border border-input bg-transparent px-3 text-sm outline-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50'; @endphp

Vote-funded requests raised from stores, feeding into Inventory purchase orders

Purchase Requisition

CSV
@include('partials.flashes')
@foreach ([ ['label' => 'Requisitions', 'value' => (string) $rows->count()], ['label' => 'Awaiting approval', 'value' => (string) $rows->where('status', 'Submitted')->count()], ['label' => 'Approved, not ordered', 'value' => (string) $rows->where('status', 'Approved')->count()], ['label' => 'Estimate value', 'value' => $money($rows->sum('estimate'))], ] as $card)
{{ $card['value'] }} {{ $card['label'] }}
@endforeach
Reset
@forelse ($rows as $pr) @empty @endforelse
PR Date Vote Department Raised by Lines Estimate Status Actions
{{ $pr->pr_no }} {{ $day($pr->raised_on) }} {{ $pr->vote?->name ?? '—' }} {{ $pr->department }} {{ $pr->raised_by }} {{ $pr->lineCount() }} {{ $money($pr->estimate) }} @include('kitchen.partials.badge', ['status' => $pr->status]) @if ($pr->reject_reason) {{ $pr->reject_reason }} @endif
@if ($pr->status === 'Draft')
@csrf
@elseif ($pr->status === 'Submitted')
@csrf
@elseif ($pr->status === 'Approved')
@csrf
@endif @if (in_array($pr->status, ['Draft', 'Submitted'], true))
@csrf
@endif @if ($pr->status === 'Draft')
@csrf @method('DELETE')
@endif
Line items for {{ $pr->pr_no }} @foreach ($pr->lines as $line) @endforeach
Description Store item Qty Unit Est. unit cost Line total
{{ $line->description }} {{ $line->item?->name ?? '—' }} {{ $num($line->qty) }} {{ $line->unit }} {{ $money($line->est_unit_cost) }} {{ $money($line->lineTotal()) }}
@if ($pr->status === 'Draft')
Edit draft {{ $pr->pr_no }} @include('kitchen.partials.pr-form', ['pr' => $pr, 'votes' => $votes, 'items' => $items, 'sel' => $sel, 'today' => $today])
@endif @if (in_array($pr->status, ['Submitted', 'Approved', 'Ordered', 'Rejected'], true))
Reject {{ $pr->pr_no }}
@csrf
@endif
No requisitions match these filters.

New purchase requisition

@include('kitchen.partials.pr-form', ['pr' => null, 'votes' => $votes, 'items' => $items, 'sel' => $sel, 'today' => $today])
@endsection