@if($errors->any())
@foreach($errors->all() as $error)
- {{ $error }}
@endforeach
@endif
@if(count($allStatements) > 0)
@foreach($allStatements as $idx => $statement)
@php
$supplier = $statement['supplier'];
$metrics = $statement['metrics'];
$register = $statement['invoiceRegister'];
$payments = $statement['paymentHistory'];
$aged = $statement['agedBalances'];
@endphp
Current Balance
${{ number_format($metrics['currentBalance'], 2) }}
Total Invoices
${{ number_format($metrics['totalInvoicesAmount'], 2) }}
Total Payments
${{ number_format($metrics['totalPayments'], 2) }}
Status Counts
{{ $metrics['countPending'] }}/{{ $metrics['countApproved'] }}/{{ $metrics['countPaid'] }}/{{ $metrics['countRejected'] }}
Invoice Register
| Invoice # |
Date |
Description |
Status |
Total |
Paid |
Balance |
Days |
@forelse($register as $row)
| {{ $row['invoice_number'] }} |
{{ $row['invoice_date'] }} |
{{ $row['description'] ?: 'N/A' }} |
{{ $row['status'] }} |
{{ number_format($row['total'], 2) }} |
{{ number_format($row['paid'], 2) }} |
{{ number_format($row['balance'], 2) }} |
{{ $row['days_outstanding'] }} |
@empty
| No invoices found for this supplier and date range. |
@endforelse
Aged 0-30 Days
${{ number_format($aged['0_30'], 2) }}
Aged 31-60 Days
${{ number_format($aged['31_60'], 2) }}
Aged 61+ Days
${{ number_format($aged['61_plus'], 2) }}
Payment History
| Date |
Reference |
Description |
Applied To Invoice(s) |
Amount |
Unapplied |
@forelse($payments as $payment)
| {{ $payment['date'] }} |
{{ $payment['reference'] }} |
{{ $payment['description'] }} |
{{ count($payment['applied_to']) > 0 ? implode(', ', $payment['applied_to']) : 'Unallocated' }} |
{{ number_format($payment['amount'], 2) }} |
{{ number_format($payment['unapplied'], 2) }} |
@empty
| No payments found in this period. |
@endforelse
@endforeach
@else
Generate the report to view supplier invoice register, statuses, aged balances, current balance, and payment history.
@endif