@php $org = auth()->user()->organization ?? \App\Models\System\Organization::find(auth()->user()->organization_id); @endphp @extends('documents.procurement._layout', [ 'documentTitle' => 'Aged Creditors Report', 'reference' => null, 'documentDate' => $reportDate, 'noAutoPrint' => true, ]) @section('header-meta')
|
Current {{ number_format($totalCurrent, 0) }} |
1–30 Days {{ number_format($total1_30, 0) }} |
31–60 Days {{ number_format($total31_60, 0) }} |
61–90 Days {{ number_format($total61_90, 0) }} |
Over 90 Days {{ number_format($totalOver90, 0) }} |
Total Outstanding {{ number_format($grandTotal, 0) }} |
No outstanding balances as of {{ $asOf->format('d M Y') }}.
@else {{-- By Supplier --}} @foreach($bySupplier as $supplierId => $supplierInvoices) @php $supplierName = $supplierInvoices->first()->supplier?->name ?? '—'; $supplierTotal = $supplierInvoices->sum(fn($i) => (float)$i->total_amount - (float)$i->amount_paid_base); @endphp| Invoice Ref | Invoice Date | Due Date | Total ({{ $currency }}) | Paid | Balance | Age |
|---|---|---|---|---|---|---|
| {{ $inv->invoice_reference }} | {{ \Carbon\Carbon::parse($inv->invoice_date)->format('d M Y') }} | {{ $inv->due_date ? $inv->due_date->format('d M Y') : '—' }} | {{ number_format((float)$inv->total_amount, 2) }} | {{ number_format((float)$inv->amount_paid_base, 2) }} | {{ number_format($balance, 2) }} | {{ $ageLabel }} |