@extends('layouts.app') @section('title', 'Purchase Orders') @section('breadcrumb')Purchase Orders@endsection @section('content')

Purchase Orders

Manage supplier orders and warehouse receiving

New Purchase Order
@if(session('success'))

{{ session('success') }}

@endif
Reset
@if($orders->count())
@foreach($orders as $po) @endforeach
PO Number Supplier Order Date Expected Total Cost Status
{{ $po->po_number }} {{ $po->supplier?->company ?: ($po->supplier?->full_name ?? '—') }} {{ $po->order_date?->format('d M Y') ?? '—' }} {{ $po->expected_date?->format('d M Y') ?? '—' }} ${{ number_format($po->totalCost(), 2) }} {{ ucfirst($po->status) }} @if(!in_array($po->status, ['received','cancelled'])) @endif @if(auth()->user()->role?->name === 'office_admin' && !in_array($po->status, ['received']))
@csrf @method('DELETE')
@endif
@if($orders->hasPages())
{{-- Previous Page Link --}} @if ($orders->onFirstPage()) « Previous @else « Previous @endif {{-- Pagination Elements --}}
@foreach ($orders->getUrlRange(1, $orders->lastPage()) as $page => $url) {{ $page }} @endforeach
{{-- Next Page Link --}} @if ($orders->hasMorePages()) Next » @else Next » @endif
@endif @else

No purchase orders found.

Create your first PO
@endif
@endsection