@php $pageItems = $payments->getCollection(); $processedVisibleAmount = (float) $pageItems->sum(fn ($p) => (float) ($p->amount ?? 0)); $fromDate = trim((string) ($from ?? '')); $toDate = trim((string) ($to ?? '')); @endphp @include('loan.payments.partials.flash')
@include('loan.payments.partials.branch-filter')
Clear
@include('loan.payments.partials.processed-intelligence-strip', [ 'payments' => $payments, 'totalAmount' => $totalAmount ?? null, 'processedVisibleAmount' => $processedVisibleAmount, 'from' => $fromDate, 'to' => $toDate, 'principalProcessed' => $principalProcessed ?? 0, 'interestProcessed' => $interestProcessed ?? 0, 'feesProcessed' => $feesProcessed ?? 0, 'penaltyProcessed' => $penaltyProcessed ?? 0, 'overpaymentProcessed' => $overpaymentProcessed ?? 0, ])

Processed pays for {{ \Carbon\Carbon::parse($displayDate)->format('d-m-Y') }}

{{ number_format($payments->total()) }} matching · Ksh {{ number_format((float) ($totalAmount ?? 0), 2) }}

@forelse ($payments as $p) @php $client360 = $client360ByPayment[$p->id] ?? null; $processedRowUrl = $client360 ? (\App\Support\Navigation\WorkspaceEmbed::routeUrl('loan.clients.show', [$client360]) ?? route('loan.clients.show', $client360)) : null; $latestReversiblePaymentId = $client360 ? ($latestReversiblePaymentIdsByClient[(int) $client360->id] ?? null) : null; $canReversePayment = auth()->user()?->hasLoanPermission('payments.reverse.request') && auth()->user()?->hasLoanPermission('payments.reverse.approve') && ! (bool) $p->funded_from_wallet && (int) $latestReversiblePaymentId === (int) $p->id; @endphp @empty @endforelse
Transaction Account no. Amount Payment Details Client Approval Time
{{ $p->receiptNumber() }} @if ($p->payment_kind === \App\Models\LoanBookPayment::KIND_MERGED || ($p->merged_children_count ?? 0) > 0) Legacy Merged Record @endif {{ $p->incomingAccountNumber() ?? '—' }} {{ $p->currency }} {{ number_format((float) $p->amount, 2) }} @php $rowBreakdown = $processedBreakdowns[$p->id] ?? []; $principalAmount = (float) ($rowBreakdown['principal'] ?? 0.0); $interestAmount = (float) ($rowBreakdown['interest'] ?? 0.0); $feesAmount = (float) ($rowBreakdown['fees'] ?? 0.0); $penaltyAmount = (float) ($rowBreakdown['penalty'] ?? 0.0); $overpaymentAmount = (float) ($rowBreakdown['overpayment'] ?? 0.0); $hasAllocationData = (bool) ($rowBreakdown['has_allocation_data'] ?? false); $fallbackMessage = $rowBreakdown['fallback_message'] ?? null; $allocationMismatch = (bool) ($rowBreakdown['allocation_mismatch'] ?? false); @endphp
@if ($allocationMismatch) Allocation mismatch @endif
    @if ($hasAllocationData) @if ($principalAmount > 0)
  • Principal - {{ number_format($principalAmount, 2) }}
  • @endif @if ($interestAmount > 0)
  • Interest - {{ number_format($interestAmount, 2) }}
  • @endif @if ($feesAmount > 0)
  • Fees - {{ number_format($feesAmount, 2) }}
  • @endif @if ($penaltyAmount > 0)
  • Penalty - {{ number_format($penaltyAmount, 2) }}
  • @endif @if ($overpaymentAmount > 0)
  • Overpayment - {{ number_format($overpaymentAmount, 2) }}
  • @endif @elseif ($fallbackMessage)
  • {{ $fallbackMessage }}
  • @endif @if ($p->mpesa_receipt_number)
  • Receipt - {{ $p->mpesa_receipt_number }}
  • @endif
@if ($client360) {{ $client360->full_name }} {{ $client360->id_number ?? '—' }} @else — @endif
{{ ($p->validatedByUser || $p->postedByUser) ? 'Confirmed' : 'System Posted' }}
{{ $p->validatedByUser?->name ?? $p->postedByUser?->name ?? 'System' }}
{{ optional($p->transaction_at)->format('d-m-Y H:i:s') ?? '—' }} @if ($canReversePayment) Reverse @elseif ($p->payment_kind !== \App\Models\LoanBookPayment::KIND_C2B_REVERSAL) Locked @endif @php($journalEntry = $p->resolvedAccountingJournalEntry()) @if ($journalEntry) Journal @elseif ($p->accounting_journal_entry_id) Journal missing @endif
No processed payments yet.