@php $customer = Auth::guard('customer')->user(); // Fix the profile picture URL generation $hasProfilePicture = $customer->docpath && Storage::disk('public')->exists($customer->docpath); $profilePictureUrl = $hasProfilePicture ? asset('storage/' . $customer->docpath) : 'https://images.unsplash.com/photo-1535713875002-d1d0cf377fde?auto=format&fit=crop&w=500&q=60'; @endphp

My Loans

Manage and track your active loans

My Loans

Manage and track your active loans

Active Loans

{{ $loanStats['active_loans_count'] }}

Total Loan Amount

ZMW {{ number_format($loanStats['total_active_loan_amount'], 2) }}

Collection Progress

{{ $loanStats['average_collection_progress'] }}%

Outstanding Balance

ZMW {{ number_format($loanStats['total_outstanding_balance'], 2) }}

Active Loans

Your currently active loan accounts

Total Repaid: ZMW {{ number_format($loanStats['total_actual_repayment'], 2) }}
@if($loanStats['overdue_loans_count'] > 0)
{{ $loanStats['overdue_loans_count'] }} loan(s) overdue
@endif
@if($activeLoans->count() > 0)
@foreach($activeLoans as $loan) @php $totalRepayment = $loan->getTotalRepaymentAttribute(); $collectionProgress = $loan->getCollectionProgressAttribute(); $outstandingBalance = $loan->getOutstandingBalanceAttribute(); @endphp

{{ $loan->product ?? $loan->loanProduct->product ?? 'Loan' }}

Loan #{{ $loan->loannumber ?? $loan->loanid }}

@if($loan->is_overdue)
Overdue by {{ $loan->days_overdue }} days
@endif

ZMW {{ number_format($loan->amount, 2) }}

{{ ucfirst($loan->status) }}

Interest Rate

{{ $loan->rate }}%

Duration

{{ $loan->duration }} months

Outstanding Balance

ZMW {{ number_format($outstandingBalance, 2) }}

Total Repaid

ZMW {{ number_format($loan->total_repaid, 2) }}

Disbursed Date

@if($loan->disburseddate) {{ \Carbon\Carbon::parse($loan->disburseddate)->format('M d, Y') }} @else N/A @endif

Maturity Date

@if($loan->maturitydate) {{ \Carbon\Carbon::parse($loan->maturitydate)->format('M d, Y') }} @else N/A @endif

Collection Progress {{ $collectionProgress }}% (ZMW {{ number_format($loan->total_repaid, 2) }} of ZMW {{ number_format($totalRepayment, 2) }})
Principal: ZMW {{ number_format($loan->principal_repaid, 2) }} Interest: ZMW {{ number_format($loan->interest_repaid, 2) }}
View Details @if($loan->is_overdue) Overdue @endif
@endforeach
@if($activeLoans->hasPages())
{{ $activeLoans->links() }}
@endif @else

No Active Loans

You don't have any active loans at the moment.

@endif
@if($activeLoans->count() > 0)

Loan Portfolio Summary

Total Loans {{ $loanStats['active_loans_count'] }}
Total Amount Disbursed ZMW {{ number_format($loanStats['total_active_loan_amount'], 2) }}
Total Amount Repaid ZMW {{ number_format($loanStats['total_actual_repayment'], 2) }}
Outstanding Balance ZMW {{ number_format($loanStats['total_outstanding_balance'], 2) }}
Average Collection Progress {{ $loanStats['average_collection_progress'] }}%
@endif