@php $status = strtolower((string) $loan->status); $statusClass = match($status) { 'pending' => 'pending', 'approved' => 'approved', 'active', 'disbursed' => 'active', 'completed' => 'completed', 'closed' => 'closed', 'overdue' => 'overdue', 'rejected' => 'rejected', 'cancelled' => 'cancelled', default => 'approved' }; $total = (float) $loan->total_payable; $outstanding = (float) $loan->outstanding_amount; $paid = max( 0, $total - $outstanding ); $percent = $total > 0 ? min( 100, max( 0, ($paid / $total) * 100 ) ) : 0; $installments = $loan->installments ->sortBy('installment_number'); @endphp
Loan Details {{ $loan->loan_number }}
{{ ucfirst(str_replace('_',' ', $loan->status)) }}
@if(session('success'))
✓ {{ session('success') }}
@endif @if(session('error'))
⚠ {{ session('error') }}
@endif
Loan Account
{{ $loan->loan_number }}
Total Payable
₹{{ number_format($total,2) }}
0% interest · Processing fee included
Loan Amount ₹{{ number_format((float)$loan->loan_amount,2) }}
Monthly EMI ₹{{ number_format((float)$loan->emi_amount,2) }}
Outstanding ₹{{ number_format($outstanding,2) }}
Loan Summary Financial details
Interest Rate 0%
Interest Amount ₹{{ number_format((float)$loan->interest_amount,2) }}
Processing Fee ₹{{ number_format((float)$loan->processing_fee,2) }}
Tenure {{ $loan->tenure_months }} Months
Paid Amount ₹{{ number_format($paid,2) }}
Outstanding ₹{{ number_format($outstanding,2) }}
Repayment Progress {{ number_format($percent,0) }}%
Loan Information Timeline
EMI Card {{ $loan->emiCard?->card_number ?? '—' }}
Applied On {{ $loan->applied_at?->format('d M Y') ?? '—' }}
Approved On {{ $loan->approved_at?->format('d M Y') ?? '—' }}
Disbursed On {{ $loan->disbursed_at?->format('d M Y') ?? '—' }}
First EMI {{ $loan->first_emi_date?->format('d M Y') ?? '—' }}
@if($loan->completed_at)
Completed On {{ $loan->completed_at->format('d M Y') }}
@endif @if($loan->status === 'closed')
Closed On {{ $loan->closed_at?->format('d M Y') ?? '—' }}
Closed By {{ $loan->closer?->name ?? 'Admin' }}
@endif
@if($loan->status === 'closed')
Loan Closed
This loan has been closed by administration. @if($loan->closed_at) Closed on {{ $loan->closed_at->format('d M Y h:i A') }}.
@endif @if($loan->close_reason) Reason: {{ $loan->close_reason }} @endif
@endif @if( $loan->status === 'rejected' && $loan->rejection_reason )
Application Rejected
{{ $loan->rejection_reason }}
@endif @if($loan->admin_notes)
Admin Note
{{ $loan->admin_notes }}
@endif
EMI Schedule {{ $installments->count() }} installments
@if($installments->count())
@foreach($installments as $installment) @php $es = strtolower( (string) $installment->status ); $ec = match($es) { 'paid' => 'paid', 'overdue' => 'emi-overdue', 'partial' => 'partial', 'cancelled' => 'emi-cancelled', default => 'emi-pending' }; @endphp @endforeach
# Due Date EMI Paid Outstanding Status Action
{{ $installment->installment_number }} {{ $installment->due_date ? \Illuminate\Support\Carbon::parse( $installment->due_date )->format('d M Y') : '—' }} ₹{{ number_format( (float)$installment->emi_amount, 2 ) }} ₹{{ number_format( (float)$installment->paid_amount, 2 ) }} ₹{{ number_format( (float)$installment->outstanding_amount, 2 ) }} {{ ucfirst( str_replace( '_', ' ', $installment->status ) ) }} @if( in_array( $installment->status, ['paid','completed'], true ) ) ✓ PAID @else
@csrf
@endif
@foreach($installments as $installment) @php $es = strtolower( (string) $installment->status ); $ec = match($es) { 'paid' => 'paid', 'overdue' => 'emi-overdue', 'partial' => 'partial', 'cancelled' => 'emi-cancelled', default => 'emi-pending' }; @endphp
EMI # {{ $installment->installment_number }}
Due: {{ $installment->due_date ? \Illuminate\Support\Carbon::parse( $installment->due_date )->format('d M Y') : '—' }}
{{ ucfirst( str_replace( '_', ' ', $installment->status ) ) }}
EMI ₹{{ number_format( (float)$installment->emi_amount, 2 ) }}
Paid ₹{{ number_format( (float)$installment->paid_amount, 2 ) }}
Outstanding ₹{{ number_format( (float)$installment->outstanding_amount, 2 ) }}
@if( in_array( $installment->status, ['paid','completed'], true ) )
✓ Payment Completed
@else
@csrf
@endif
@endforeach
@else
EMI schedule not generated yet. It will appear after the loan is disbursed.
@endif
@if( in_array( $loan->status, ['pending','approved'] ) )
{{ $loan->status === 'pending' ? 'Application Under Review' : 'Loan Approved' }}
{{ $loan->status === 'pending' ? 'Your application is waiting for admin review.' : 'Your loan is approved and waiting for disbursement.' }}
@endif
← My Loans @if($loan->emiCard) View EMI Card @endif
@include('client.partials.bottom-nav')