@extends('layouts.app') @section('title', 'Invoices') @section('content') @php $money = fn ($v) => \App\Support\Fmt::money($v); $plain = fn ($v) => rtrim(rtrim(number_format((float) $v, 2), '0'), '.'); $statusClasses = fn (string $s) => match ($s) { 'Pending' => 'bg-amber-500/15 text-amber-700', 'Approved' => 'bg-emerald-500/15 text-emerald-700', 'Paid' => 'bg-teal-500/15 text-teal-700', default => 'bg-rose-500/15 text-rose-700', }; $tabs = ['All', 'Pending', 'Approved', 'Paid', 'Rejected']; @endphp

Invoices

Record, approve and pay supplier invoices

@include('partials.flashes')
@foreach ([ ['label' => 'Total Invoices', 'value' => $total], ['label' => 'Pending', 'value' => $pending], ['label' => 'Approved', 'value' => $approved], ['label' => 'Paid', 'value' => $paid], ] as $stat)
{{ $stat['value'] }} {{ $stat['label'] }}
@endforeach
@foreach ($tabs as $tab) {{ $tab }} @endforeach
@forelse ($rows as $invoice) @empty @endforelse
Invoice No. Supplier Ref Supplier PO Date Subtotal VAT Total Status Actions
{{ $invoice->invoice_no }} {{ $invoice->supplier_ref ?: '—' }} {{ $invoice->supplier?->company_name ?? '—' }} @if ($invoice->po_id) {{ $invoice->po_id }} @else — @endif {{ \App\Support\Fmt::day($invoice->received_date) }} {{ $money($invoice->subtotal()) }} {{ $money($invoice->taxTotal()) }} {{ $money($invoice->grandTotal()) }} {{ $invoice->status }}
@if ($invoice->status === 'Pending') @include('inventory.partials.status-form', [ 'action' => route('inventory.invoices.status', $invoice), 'status' => 'Approved', 'label' => 'Approve', ]) @include('inventory.partials.status-form', [ 'action' => route('inventory.invoices.status', $invoice), 'status' => 'Rejected', 'label' => 'Reject', 'outline' => true, ]) @elseif ($invoice->status === 'Approved') @endif
No invoices match your filters.
{{ $rows->count() }} of {{ $total }} invoices
Record new invoice — {{ $nextInvoiceNo }}
@include('inventory.partials.invoice-form', [ 'action' => route('inventory.invoices.store'), 'method' => 'POST', 'prefix' => 'inv-new', 'row' => null, 'suppliers' => $suppliers, 'orders' => $orders, 'today' => $today, ])
@include('inventory.partials.line-scripts') @endsection