@php $maturingCount = (int) ($totals['maturing_count'] ?? 0); $arrearsCount = (int) ($totals['arrears_count'] ?? 0); $scopeLabel = $scopeLabel ?? 'this period'; $tab = $tab ?? 'register'; $tabQuery = $tabQuery ?? fn (array $extra = []) => collect(request()->query()) ->except(['page', 'export']) ->merge($extra) ->reject(fn ($value) => $value === null || $value === '') ->all(); @endphp
Last installments · {{ $scopeLabel }}

{{ number_format($maturingCount, 0) }} {{ $maturingCount === 1 ? 'client' : 'clients' }}

Final installment due — repeat-client opportunity.

@if ($maturingCount > 0) + @endif
Needs attention · {{ $scopeLabel }}

{{ number_format($arrearsCount, 0) }} {{ $arrearsCount === 1 ? 'client' : 'clients' }}

On the payment schedule but already in arrears @if (($totals['arrears_amount'] ?? 0) > 0.01) · KES {{ number_format($totals['arrears_amount'] ?? 0, 0) }} @endif

@if ($arrearsCount > 0) + @endif