@extends('documents.procurement._layout', [ 'documentTitle' => 'Statement of Account', 'reference' => $supplier->name, 'documentDate' => $today->format('d M Y'), ]) @section('header-meta')
|
Supplier: {{ $supplier->name }} @if($supplier->contact_email) {{ $supplier->contact_email }} @endif @if($supplier->contact_phone) {{ $supplier->contact_phone }} @endif @if($supplier->city) {{ $supplier->city }} @endif |
| Date | Reference | Description | Invoiced | Paid | Balance |
|---|---|---|---|---|---|
| {{ \Carbon\Carbon::parse($inv->invoice_date)->format('d M Y') }} | {{ $inv->invoice_reference }} | Invoice — {{ ucwords(str_replace('_', ' ', $inv->invoice_type)) }} | {{ number_format((float) $inv->total_amount, 2) }} | — | {{ number_format($runningBalance, 2) }} |
| {{ \Carbon\Carbon::parse($pmt->payment_date)->format('d M Y') }} | {{ $pmt->payment_reference }} | Payment — {{ ucwords(str_replace('_', ' ', $pmt->payment_method)) }} | — | ({{ number_format((float) $pmt->amount_base, 2) }}) | {{ number_format($runningBalance, 2) }} |
| Total Invoiced | {{ number_format($totalInvoiced, 2) }} |
| Total Paid | ({{ number_format($totalPaid, 2) }}) |
| Outstanding Balance | {{ number_format($totalBalance, 2) }} |
| Current (Not Due) | 1–30 Days | 31–60 Days | 61–90 Days | Over 90 Days | Total |
|---|---|---|---|---|---|
| {{ number_format($ageBuckets['current'], 2) }} | {{ number_format($ageBuckets['1_30'], 2) }} | {{ number_format($ageBuckets['31_60'], 2) }} | {{ number_format($ageBuckets['61_90'], 2) }} | {{ number_format($ageBuckets['over_90'], 2) }} | {{ number_format(array_sum($ageBuckets), 2) }} |