@extends('layouts.app') @section('title', 'Procurement') @php $f = $filters ?? []; $poBadge = function (string $s): string { return match ($s) { 'Draft' => 's', 'Pending Approval' => 'a', 'Approved' => 'b', 'Ordered' => 'v', 'Partially Delivered' => 'a', 'Delivered' => 'g', 'Billed' => 'b', 'Paid' => 'g', 'Cancelled' => 'r', default => 's', }; }; @endphp @section('content')

Procurement

Purchase orders, suppliers and deliveries

@if($errors->any())
{{ $errors->first() }}
@endif @if(session('success'))
{{ session('success') }}
@endif

Active POs

{{ $activePos }}

Pending Delivery

{{ $pendingDelivery }}

This Month Value

{{ \App\Support\Format::mwk($monthValue) }}

Suppliers

{{ $suppliersCount }}

Pending Requests

{{ $pendingRequests }}

Outstanding Bills

{{ \App\Support\Format::mwk($outstandingBills) }}

@include('procurement.partials.subnav', ['procNav' => 'orders'])
Clear

Purchase Orders

@if($orders->isEmpty())

No purchase orders found

Create your first purchase order or adjust filters.

@else @foreach($orders as $o) @php $itemLabel = $o->isLegacyFreeTextOnly() ? $o->items_description : $o->items->pluck('description')->take(2)->implode(', '); @endphp @endforeach
PO # Supplier Project Items PO Date Expected Amount Status Action
{{ $o->po_number }} {{ $o->supplier?->company_name }} {{ $o->project?->name ?? '—' }} {{ $itemLabel ?: '—' }} {{ $o->po_date?->format('M j, Y') }} {{ $o->expected_delivery_date?->format('M j, Y') ?? '—' }} {{ \App\Support\Format::mwk($o->total_amount) }} {{ $o->status }} View
{{ $orders->links() }}
@endif
@endsection @push('scripts') @php $materialsForPo = $materials->map(fn ($m) => [ 'id' => $m->id, 'name' => $m->name, 'uom' => $m->unit_of_measure, 'exp' => (bool) $m->is_expirable, ])->values(); @endphp @endpush