@extends('layout.layout') @section('content')

Purchases List

{{-- Assuming a route for creating new purchases --}} New Purchase Order
{{-- FILTER CARD --}}
{{-- Purchase Number --}}
{{-- Status --}}
{{-- Date Range --}}
{{-- Staff --}}
{{-- Buttons --}}
{{-- DATA TABLE --}}
@forelse ($purchases as $purchase) @empty @endforelse
# Purchase Number Name Requested By Status Total Created Date Actions
{{ $loop->iteration }} @can('it_purchase_show') {{ $purchase->purchase_number }} @else {{ $purchase->purchase_number }} @endcan {{ $purchase->name }}
@foreach ($purchase->requestedStaffs as $staff) {{ $staff->first_name }} {{ $staff->last_name }} @endforeach
{{ ucfirst($purchase->status) }} ${{ number_format($purchase->total, 2) }} {{ $purchase->created_at->format('M d, Y') }} @can('it_purchase_show') @endcan @if(auth()->user()->can('it_purchase_edit') && $purchase->status == 'approved') @endcan @can('it_purchase_destroy' && in_array($purchase->status, ['pending', 'rejected']))
@csrf @method('DELETE')
@endcan
No purchases found matching the current criteria.
{{-- PAGINATION --}}
{{ $purchases->links() }}
@endsection