@php $canMaintainLoanSnapshots = auth()->user()?->hasLoanPermission('loans.update') ?? false; @endphp Active loans Completed loans Clear
@php $portfolioIndicators = $portfolioIndicators ?? []; @endphp
@if (empty($orgCascade['available'])) @endif
@include('loan.book.loans.partials.portfolio-intelligence-strip', ['portfolioIndicators' => $portfolioIndicators])
@if ($loans->count() > 0 && ($loanRegisterBulkActions ?? []) !== []) @endif

Loan register

Progress uses posted installment repayments only (application fees are excluded).

Show / hide columns

@if ($loans->count() > 0 && ($loanRegisterBulkActions ?? []) !== []) @endif @php $loanPrincipalTotal = 0.0; $loanToPayTotal = 0.0; $loanPaidTotal = 0.0; $loanBalanceTotal = 0.0; @endphp @forelse ($loans as $loan) @php $posted = (float) ($loan->processed_repayments_sum_amount ?? 0); $paid = $posted; $balance = (float) $loan->balance; $remaining = max(0, $balance); $totalRepayable = $paid + $remaining; $progress = $totalRepayable > 0.00001 ? min(100, max(0, ($paid / $totalRepayable) * 100)) : 0; $officerName = trim((string) ($loan->loanClient?->assignedEmployee?->full_name ?? '')); $rowRedirectUrl = $loan->loanClient ? route('loan.clients.show', $loan->loanClient) : null; $loanPrincipalTotal += (float) $loan->principal; $loanToPayTotal += $totalRepayable; $loanPaidTotal += $paid; $loanBalanceTotal += $remaining; $displayStatus = $loan->effectiveStatus(); $statusClasses = match ($displayStatus) { \App\Models\LoanBookLoan::STATUS_ACTIVE => 'bg-emerald-100 text-emerald-700', \App\Models\LoanBookLoan::STATUS_PENDING_DISBURSEMENT => 'bg-amber-100 text-amber-700', \App\Models\LoanBookLoan::STATUS_CLOSED => 'bg-slate-200 text-slate-700', \App\Models\LoanBookLoan::STATUS_WRITTEN_OFF => 'bg-rose-100 text-rose-700', \App\Models\LoanBookLoan::STATUS_RESTRUCTURED => 'bg-indigo-100 text-indigo-700', default => 'bg-slate-100 text-slate-600', }; $canDisburse = $displayStatus === \App\Models\LoanBookLoan::STATUS_PENDING_DISBURSEMENT; $openFinanceRelease = $canDisburse ? ($loan->relationLoaded('financeReleaseRequests') ? $loan->financeReleaseRequests->first() : $loan->openFinanceReleaseRequest()) : null; $canRecordPayment = in_array($displayStatus, [ \App\Models\LoanBookLoan::STATUS_ACTIVE, \App\Models\LoanBookLoan::STATUS_RESTRUCTURED, ], true) && $remaining > 0.01; $canSyncSchedule = $loan->loan_book_application_id && in_array($displayStatus, [ \App\Models\LoanBookLoan::STATUS_PENDING_DISBURSEMENT, \App\Models\LoanBookLoan::STATUS_ACTIVE, \App\Models\LoanBookLoan::STATUS_RESTRUCTURED, ], true); $canEdit = $displayStatus !== \App\Models\LoanBookLoan::STATUS_CLOSED; $canDelete = in_array($displayStatus, [ \App\Models\LoanBookLoan::STATUS_PENDING_DISBURSEMENT, \App\Models\LoanBookLoan::STATUS_CLOSED, ], true); $isOverdueLoan = in_array($displayStatus, [ \App\Models\LoanBookLoan::STATUS_ACTIVE, \App\Models\LoanBookLoan::STATUS_RESTRUCTURED, ], true) && $remaining > 0.01 && $loan->maturity_date && $loan->maturity_date->isPast(); $maturityOverdueDays = ($isOverdueLoan && $loan->maturity_date) ? max((int) $loan->dpd, (int) $loan->maturity_date->startOfDay()->diffInDays(now()->startOfDay())) : 0; @endphp @if ($loans->count() > 0 && ($loanRegisterBulkActions ?? []) !== []) @endif @empty @endforelse @if ($loans->count() > 0) @if ($loans->count() > 0 && ($loanRegisterBulkActions ?? []) !== []) @endif @endif
Loan # Client Loan officer Disbursement Product Loan To-pay Paid Percent Balance DPD Status Maturity Actions
{{ $loan->loan_number }} @include('loan.book.partials.portfolio-origin-badge', ['loan' => $loan])
{{ $loan->loanClient?->full_name ?? 'Client record missing' }} {{ $officerName !== '' ? $officerName : '—' }} {{ $loan->disbursed_at?->format('d-m-Y') ?? '—' }} {{ $loan->product_name }} {{ number_format((float) $loan->principal, 2) }} {{ number_format($totalRepayable, 2) }} {{ number_format($paid, 2) }} {{ number_format($progress, 1) }}% {{ number_format($remaining, 2) }} {{ $loan->dpd }} {{ str_replace('_', ' ', $displayStatus) }}
$isOverdueLoan, 'text-slate-600' => ! $isOverdueLoan, ])> {{ $loan->maturity_date?->format('d-m-Y') ?? '—' }} @if ($isOverdueLoan) Overdue @if ($maturityOverdueDays > 0) {{ $maturityOverdueDays }} day{{ $maturityOverdueDays === 1 ? '' : 's' }} @endif @endif
@include('loan.book.loans.partials.index-row-actions', [ 'loan' => $loan, 'canDisburse' => $canDisburse, 'openFinanceRelease' => $openFinanceRelease, 'canRecordPayment' => $canRecordPayment, 'canMaintainLoanSnapshots' => $canMaintainLoanSnapshots, 'canSyncSchedule' => $canSyncSchedule, 'canEdit' => $canEdit, 'canDelete' => $canDelete, ])
{{ __('No loans match the current filters.') }} {{ __('Clear filters') }}
Totals (this page) {{ number_format($loanPrincipalTotal, 2) }} {{ number_format($loanToPayTotal, 2) }} {{ number_format($loanPaidTotal, 2) }} {{ number_format($loanBalanceTotal, 2) }}
@if ($loans->hasPages())
@endif