Customer Aging Report
Outstanding invoices grouped by age buckets (As Of: {{ $asOf }})
@if($info && $info->business_name)
{{ $info->business_name }}
@endif
{{-- Filters --}}
{{-- KPI --}}
0 - 30 Days
{{ number_format($kpi->b0_30, 2) }}
31 - 60 Days
{{ number_format($kpi->b31_60, 2) }}
61 - 90 Days
{{ number_format($kpi->b61_90, 2) }}
90+ Days
{{ number_format($kpi->b90_plus, 2) }}
Total Outstanding
{{ number_format($kpi->total, 2) }}
Based on invoice balances.
{{-- Currency Totals (useful when all currency) --}}
@if(request('currency_id','all') === 'all')
| Currency |
0-30 |
31-60 |
61-90 |
90+ |
Total |
@foreach($totalsByCurrency as $t)
@if($t['total'] > 0)
| {{ $t['currency'] }} |
{{ number_format($t['b0_30'],2) }} |
{{ number_format($t['b31_60'],2) }} |
{{ number_format($t['b61_90'],2) }} |
{{ number_format($t['b90_plus'],2) }} |
{{ number_format($t['total'],2) }} |
@endif
@endforeach
@if(collect($totalsByCurrency)->sum('total') <= 0)
| No totals |
@endif
@endif
{{-- Summary Table --}}
| # |
Customer |
CUR |
0-30 |
31-60 |
61-90 |
90+ |
Total |
Action |
@forelse($rows as $i => $r)
@php
$custName = $customerNames[$r->customer_id] ?? 'Unknown';
$curName = $currencyNames[$r->currency_id] ?? '-';
@endphp
| {{ method_exists($rows,'firstItem') ? $rows->firstItem() + $i : ($i+1) }} |
{{ $custName }} |
{{ $curName }} |
{{ number_format((float)$r->b0_30, 2) }} |
{{ number_format((float)$r->b31_60, 2) }} |
{{ number_format((float)$r->b61_90, 2) }} |
{{ number_format((float)$r->b90_plus, 2) }} |
{{ number_format((float)$r->total_outstanding, 2) }} |
Details
|
@empty
| No data found |
@endforelse
{{-- Footer Totals --}}
| Grand Total |
{{ number_format($kpi->b0_30,2) }} |
{{ number_format($kpi->b31_60,2) }} |
{{ number_format($kpi->b61_90,2) }} |
{{ number_format($kpi->b90_plus,2) }} |
{{ number_format($kpi->total,2) }} |
|
{{-- Pagination --}}
@if(! $isPrint && method_exists($rows, 'links'))
{{ $rows->links('pagination::bootstrap-4') }}
@endif
{{-- Details Invoices (only when a single customer selected) --}}
@if($customerId)
Invoice Details (Selected Customer)
Showing invoices with invoice_date <= {{ $asOf }}
| # |
Date |
Invoice # |
Title |
CUR |
Final |
Received |
Balance |
Age |
@php
$asOfCarbon = \Carbon\Carbon::parse($asOf);
@endphp
@forelse($details as $k => $b)
@php
$age = $asOfCarbon->diffInDays(\Carbon\Carbon::parse($b->invoice_date));
@endphp
| {{ $k+1 }} |
{{ $b->invoice_date }} |
{{ $b->invoice_number }} |
{{ $b->title }} |
{{ optional($b->currency)->title_en }} |
{{ number_format((float)$b->final_amount,2) }} |
{{ number_format((float)$b->received,2) }} |
{{ number_format((float)$b->balance,2) }} |
{{ $age }}d
|
@empty
| No invoices |
@endforelse
@endif