@php $prepaidRows = $totals['prepaid_rows'] ?? []; $prepaidAmount = (float) ($totals['prepaid'] ?? 0); $collectedTodayAmount = (float) ($totals['collected_today'] ?? 0); $collectedCount = (int) ($totals['collected_count'] ?? 0); $fullyPaidCount = (int) ($totals['fully_paid_count'] ?? 0); $partiallyPaidCount = (int) ($totals['partially_paid_count'] ?? 0); @endphp
KES {{ number_format($totals['expected'] ?? 0, 0) }} ({{ number_format($totals['client_count'] ?? 0, 0) }} {{ ($totals['client_count'] ?? 0) === 1 ? 'client' : 'clients' }})
KES {{ number_format($totals['collected'] ?? 0, 0) }} @if ($collectedCount > 0) ({{ number_format($collectedCount, 0) }} paid) @endif
Today KES {{ number_format($collectedTodayAmount, 0) }} · Prepaid KES {{ number_format($prepaidAmount, 0) }} @if ($prepaidAmount > 0.01 && count($prepaidRows) > 0) @endif
@if ($fullyPaidCount > 0 || $partiallyPaidCount > 0){{ number_format($fullyPaidCount, 0) }} fully paid · {{ number_format($partiallyPaidCount, 0) }} partially paid
@endifKES {{ number_format($totals['outstanding'] ?? 0, 0) }} @if (($totals['outstanding_count'] ?? 0) > 0) ({{ number_format($totals['outstanding_count'] ?? 0, 0) }} {{ ($totals['outstanding_count'] ?? 0) === 1 ? 'client' : 'clients' }}) @endif
{{ number_format($totals['collection_pct'] ?? 0, 1) }}%
Prepaid toward today's installments ({{ count($prepaidRows) }} {{ count($prepaidRows) === 1 ? 'receipt' : 'receipts' }})
| Client | Amount | Date paid | Status |
|---|---|---|---|
| {{ $prepaidRow['name'] }} | {{ number_format((float) $prepaidRow['amount'], 0) }} | {{ $prepaidRow['paid_on'] }} | {{ $prepaidRow['status'] }} |