{{-- Header --}}

{{ $settings['business_name'] ?? config('app.name') }}

Account Statement • {{ $from->format('d M Y') }} – {{ $to->format('d M Y') }}

Dear {{ $client->full_name }},
@if($customMsg)
{{ $customMsg }}
@else

Please find attached your account statement for the period {{ $from->format('d M Y') }} to {{ $to->format('d M Y') }}. A PDF copy is attached to this email for your records.

@endif {{-- Summary Cards --}}
Transactions
{{ $summary['total_sales'] }}
Gross Total
KSh {{ number_format($summary['gross_total'], 2) }}
Paid
KSh {{ number_format($summary['total_paid'], 2) }}
Balance
KSh {{ number_format($summary['balance_due'], 2) }}
{{-- Balance Due CTA --}} @if($summary['balance_due'] > 0)
KSh {{ number_format($summary['balance_due'], 2) }} outstanding

Please settle your outstanding balance at your earliest convenience.

@if(!empty($settings['phone']))

Contact us: {{ $settings['phone'] }}

@endif
@endif {{-- Transaction Table --}} @forelse($sales as $sale) @php $bal = $sale->remaining_balance; $statusClass = match($sale->status) { 'completed' => 'badge-green', 'partial' => 'badge-yellow', default => 'badge-red', }; @endphp @empty @endforelse
Date Reference Total Paid Balance Status
{{ $sale->sale_date->format('d M Y') }} {{ $sale->reference_no }} {{ number_format($sale->total, 2) }} {{ number_format($sale->total_paid, 2) }} {{ number_format($bal, 2) }} {{ ucfirst($sale->status) }}
No transactions in this period.

The full detailed statement with all line items is attached as a PDF.