@php $scheduleRows = $schedulePresentation['rows'] ?? []; $scheduleSummary = $schedulePresentation['summary'] ?? []; $usesBookedSchedule = (bool) ($schedulePresentation['uses_booked_schedule'] ?? false); $compact = (bool) ($compact ?? false); $loanFeesPenalties = (float) ($scheduleSummary['loan_fees_penalties_outstanding'] ?? 0); $totalAmountDue = (float) ($scheduleSummary['total_amount_due'] ?? ($scheduleSummary['total_remaining'] ?? 0)); @endphp @if (! $usesBookedSchedule)
No booked installment schedule on file. @if ($loan->disbursed_at ?? false) Schedule rows are created when the loan is disbursed or imported at booking. @else Disburse this loan to generate the booked schedule. @endif @if ($loanFeesPenalties > 0.01)

Fees & penalties outstanding: KES {{ number_format($loanFeesPenalties, 2) }}

@endif
@else

Booked repayment schedule from loan booking. Use + to view how processed payments were allocated to each installment. The same payment may appear under multiple installments when its amount was split across dues.

@unless ($compact)
$loanFeesPenalties > 0.01, 'md:grid-cols-5' => $loanFeesPenalties <= 0.01, ])>

Installments

{{ $scheduleSummary['count'] ?? 0 }}

Total due

KES {{ number_format((float) ($scheduleSummary['total_due'] ?? 0), 2) }}

Paid

KES {{ number_format((float) ($scheduleSummary['total_paid'] ?? 0), 2) }}

Schedule remaining

KES {{ number_format((float) ($scheduleSummary['total_remaining'] ?? 0), 2) }}

@if ($loanFeesPenalties > 0.01)

Fees & penalties

KES {{ number_format($loanFeesPenalties, 2) }}

Total amount due

KES {{ number_format($totalAmountDue, 2) }}

@endif

Overdue

{{ $scheduleSummary['overdue_count'] ?? 0 }}

@endunless
@foreach ($scheduleRows as $row) @php $rowKey = 'inst-' . ($row['installment_id'] ?? $row['installment_no']); $statusClass = match ($row['status'] ?? '') { 'overdue' => 'bg-rose-50/50', 'paid' => 'text-slate-500', default => '', }; @endphp @if (! empty($row['has_allocations'])) @endif @endforeach @if ($loanFeesPenalties > 0.01) @endif
# Due date Principal Interest Fees Total Paid Remaining Status DPD
@if (! empty($row['has_allocations'])) @endif {{ $row['installment_no'] }} {{ $row['due_date'] ?? '—' }} {{ number_format((float) ($row['principal_due'] ?? 0), 2) }} {{ number_format((float) ($row['interest_due'] ?? 0), 2) }} {{ number_format((float) (($row['fees_due'] ?? 0) + ($row['penalty_due'] ?? 0)), 2) }} {{ number_format((float) ($row['total_due'] ?? 0), 2) }} {{ number_format((float) ($row['total_paid'] ?? 0), 2) }} {{ number_format((float) ($row['remaining_balance'] ?? 0), 2) }} {{ str_replace('_', ' ', (string) ($row['status'] ?? '')) }} {{ $row['dpd'] ?? 0 }}

Payment allocations — installment #{{ $row['installment_no'] }}

Each row is an allocation slice from a processed payment, not a separate payment.

@foreach ($row['allocation_rows'] as $alloc) @endforeach
Receipt / date Original transaction amount Allocated to this installment Running on this installment Remaining installment balance Left on transaction
{{ $alloc['receipt'] ?? '—' }} @if (! empty($alloc['transaction_at'])) {{ $alloc['transaction_at'] }} @endif {{ number_format((float) ($alloc['transaction_amount'] ?? 0), 2) }} {{ number_format((float) ($alloc['allocated_to_installment'] ?? 0), 2) }} {{ number_format((float) ($alloc['running_installment_allocation'] ?? 0), 2) }} {{ number_format((float) ($alloc['remaining_installment_balance'] ?? 0), 2) }} {{ number_format((float) ($alloc['remaining_transaction_allocation'] ?? 0), 2) }}
Schedule remaining {{ number_format((float) ($scheduleSummary['total_remaining'] ?? 0), 2) }}
Fees & penalties {{ number_format($loanFeesPenalties, 2) }}
Total amount due {{ number_format($totalAmountDue, 2) }}
@endif