@php $isMatured = ($registerScope ?? '') === \App\Support\LoanBook\ArrearsRegisterScope::POST_MATURITY; $arrearsHasBulkActions = $rows->count() > 0 && ($arrearsBulkActions ?? []) !== []; $baseColspan = 13 + ($isMatured ? 2 : 0) + ($arrearsHasBulkActions ? 1 : 0); @endphp

{{ $registerLabel ?? 'Loan Arrears Register' }}

@include('loan.book.loans.partials.arrears-register-intelligence')

{{ number_format($rows->total()) }} loan(s)

@if ($rows->total() > 0)

KES {{ number_format((float) ($registerTotalArrears ?? 0), 2) }} arrears · KES {{ number_format((float) ($registerTotalBalance ?? 0), 2) }} balance

@endif
@if ($arrearsHasBulkActions) @endif @if ($isMatured) @endif @php $arrearsTotal = 0.0; $balanceTotal = 0.0; @endphp @forelse ($rows as $row) @php $arrearsTotal += (float) $row->total_arrears; $balanceTotal += (float) $row->total_balance; $rowUrl = $row->client ? route('loan.clients.show', $row->client) : null; $officerName = (string) ($row->officer?->full_name ?? $row->client?->assignedEmployee?->full_name ?? '—'); $branchName = trim((string) ($row->loan?->loanBranch?->name ?? $row->loan?->branch ?? $row->branch?->name ?? '—')); if ($branchName === '') { $branchName = '—'; } $maturityDate = $row->loan?->maturity_date; $daysPastMaturity = ($maturityDate && $maturityDate->isPast()) ? (int) $maturityDate->startOfDay()->diffInDays(now()->startOfDay()) : 0; @endphp @if ($arrearsHasBulkActions) @endif @if ($isMatured) @endif @empty @endforelse @if ($rows->count() > 0) @if ($arrearsHasBulkActions) @endif @endif
# Client Branch Loan officer Loan DisbursementMaturity Past maturityCycle Arrears Installment Due date Days Total balance Collection case
{{ (($rows->currentPage() - 1) * $rows->perPage()) + $loop->iteration }}

{{ $row->client?->full_name ?? '—' }}

{{ $branchName }} {{ $officerName }} {{ number_format((float) $row->loan_amount, 2) }} {{ optional($row->disbursed_on)->format('d-m-Y') ?? '—' }}{{ optional($maturityDate)->format('d-m-Y') ?? '—' }} {{ $daysPastMaturity > 0 ? $daysPastMaturity : '—' }}{{ $row->cycle_no }} {{ number_format((float) $row->total_arrears, 2) }} {{ $row->installment_no ?? '—' }}/{{ $row->installment_count ?? '—' }} {{ optional($row->due_date)->format('d-m-Y') ?? '—' }} {{ $row->dpd }} {{ number_format((float) $row->total_balance, 2) }} @if ($row->loan?->isGroupOriginated()) Group loan @elseif ($row->collectionCase) Open case · {{ $row->case_no }} @elseif ($row->case_no) Open case · {{ $row->case_no }} @elseif (auth()->user()?->hasLoanPermission('collections.update'))
@csrf
@else No case @endif

@if ($isMatured) No matured loans in arrears as of today. @else No in-term loans in arrears. Every active facility still within term is current as of today. @endif

This register only lists overdue installments after DPD certification — an outstanding balance is not arrears. Officers often see the same clients on @if (Route::has('loan.book.collections.past_due')) Past Due or @endif Workplan (live schedule). @if (! $isMatured && Route::has('loan.book.matured_loans')) Facilities past contractual maturity are on the Matured Loan register. @elseif ($isMatured && Route::has('loan.book.loan_arrears')) In-term overdue facilities are on Loan Arrears. @endif If due dates have passed but client 360 still shows 0 DPD, recalculate DPD from Super Admin → System Maintenance.

Totals (this page) {{ number_format($arrearsTotal, 2) }} {{ number_format($balanceTotal, 2) }}
@if ($rows->hasPages())
@endif