@extends('layouts.inspinia') @section('title', 'Purchase Orders') @section('content_header', 'Purchase Orders') @section('content') @if(session('success'))
{{ session('success') }}
@endif @if(session('error'))
{{ session('error') }}
@endif {{-- Filters --}}
Reset @can('purchase_order.create') New PO @endcan
{{-- Table --}}
Purchase Orders
@forelse($purchaseOrders as $po) @php [$statusBadge, $statusLabel] = match($po->status) { 'draft' => ['badge-secondary', 'Draft'], 'approved' => ['badge-primary', 'Approved'], 'partially_received' => ['badge-warning', 'Partially Received'], 'received' => ['badge-success', 'Received'], 'cancelled' => ['badge-danger', 'Cancelled'], default => ['badge-light', ucfirst($po->status)], }; @endphp @empty @endforelse
PO Number Date Supplier Warehouse PR Ref Total Status Actions
{{ $po->purchase_order_number ?? '—' }} {{ $po->purchase_order_date?->format('d-m-Y') ?? '—' }} {{ $po->supplier?->name ?? '—' }} {{ $po->warehouse?->name ?? '—' }} @if($po->purchaseRequest) {{ $po->purchaseRequest->purchase_request_number }} @else @endif {{ number_format($po->total_amount, 2) }} {{ $statusLabel }}
No purchase orders found.
{{ $purchaseOrders->links() }}
@endsection