@php $logoDataUri = $company->logoDataUri(); $bankingLines = $company->bankingDetailsLines('the relevant invoice number'); $legalIdentityLines = $company->legalIdentityLines(); $statusClass = fn (string $status) => match ($status) { 'paid' => '#166534', 'sent' => '#2563eb', 'overdue' => '#dc2626', default => '#475569', }; @endphp Statement {{ $client->name }}
@if ($logoDataUri) @else

{{ strtoupper($company->business_name) }}

@endif

{{ $company->email }}{{ $company->phone ? ' - '.$company->phone : '' }}

@foreach ($legalIdentityLines as $line)

{{ $line['label'] }}: {{ $line['value'] }}

@endforeach
Statement period
{{ $period['start']->format('d M Y') }} to {{ $period['end']->format('d M Y') }}

{{ $client->name }}
@foreach ($client->documentDetails() as $detail) {{ $detail['label'] }}: {{ $detail['value'] }}
@endforeach

Client statement

Statement of account for invoices, payments, credits, and outstanding balances in the selected period.

Total invoiced
R {{ number_format($totals['total_invoiced'], 2) }}
Total paid
R {{ number_format($totals['total_paid'], 2) }}
Total credited
R {{ number_format($totals['total_credited'] ?? 0, 2) }}
Outstanding
R {{ number_format($totals['outstanding_balance'], 2) }}
Unpaid invoices
{{ $totals['unpaid_count'] }}

Unpaid invoices

@if ($unpaidInvoices->isEmpty())
No unpaid invoices for this period.
@else @foreach ($unpaidInvoices as $invoice) @endforeach
InvoiceDueTotalPaidBalanceStatus
{{ $invoice->invoice_number }} {{ $invoice->due_date->format('d M Y') }} R {{ number_format($invoice->grand_total, 2) }} R {{ number_format($invoice->totalPaid(), 2) }} R {{ number_format($invoice->remainingBalance(), 2) }} {{ ucfirst($invoice->status) }}
@endif

Invoices

@if ($invoices->isEmpty())
No invoices found for this period.
@else @foreach ($invoices as $invoice) @endforeach
InvoiceIssueDueTotalPaidBalanceStatus
{{ $invoice->invoice_number }} {{ $invoice->issue_date->format('d M Y') }} {{ $invoice->due_date->format('d M Y') }} R {{ number_format($invoice->grand_total, 2) }} R {{ number_format($invoice->totalPaid(), 2) }} R {{ number_format($invoice->remainingBalance(), 2) }} {{ ucfirst($invoice->status) }}
@endif

Credit notes

@if ($creditNotes->isEmpty())
No credit notes found for this period.
@else @foreach ($creditNotes as $creditNote) @endforeach
DateCredit noteInvoiceTypeStatusAmount
{{ $creditNote->issue_date->format('d M Y') }} {{ $creditNote->credit_note_number }} {{ $creditNote->invoice?->invoice_number ?? 'No invoice' }} {{ $creditNote->typeLabel() }} {{ $creditNote->statusLabel() }} R {{ number_format($creditNote->amount, 2) }}
@endif

Payment history

@if ($payments->isEmpty())
No payments found for this period.
@else @foreach ($payments as $payment) @endforeach
DateInvoiceMethodReferenceAmount
{{ $payment->payment_date->format('d M Y') }} {{ $payment->invoice->invoice_number }} {{ $payment->methodLabel() }} {{ $payment->payment_reference ?: 'No reference' }} R {{ number_format($payment->amount_paid, 2) }}
@endif @if ($bankingLines !== [])

Banking details

@foreach ($bankingLines as $line)
{{ $line['label'] ?: 'Detail' }}
{{ $line['value'] }}
@endforeach
@endif