@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 = $status === 'rejected' ? 0 : (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
{{ money($total) }}
{{ number_format((float) $loan->interest_rate, 2) }}% interest.
Loan Amount {{ money((float)$loan->loan_amount) }}
Monthly EMI {{ money((float)$loan->emi_amount) }}
Outstanding {{ money($outstanding) }}
Loan Summary Financial details
Interest Rate {{ number_format((float) $loan->interest_rate, 2) }}%
Interest Amount {{ money((float)$loan->interest_amount) }}
Processing Fee {{ money((float)$loan->processing_fee) }} @if((float)$loan->processing_fee > 0) @if($loan->processing_fee_paid_at) ✓ PAID {{ $loan->processing_fee_paid_at->format('d M Y, h:i A') }} @else ● PAYMENT PENDING @endif @else ✓ NO FEE @endif
Tenure {{ $loan->tenure_months }} Months
Paid Amount {{ money($paid) }}
Outstanding {{ money($outstanding) }}
Repayment Progress {{ number_format($percent,0) }}%
@if($loan->loanDetail)
Loan Type & Product Details {{ $loan->loanDetail->loanType->name ?? '—' }}
Loan Type {{ $loan->loanDetail->loanType->name ?? '—' }}
@if( is_array($loan->loanDetail->details) && count($loan->loanDetail->details) )
@foreach($loan->loanDetail->details as $key => $value) @if(!is_null($value) && $value !== '')
{{ ucwords( str_replace( '_', ' ', $key ) ) }} @if(is_array($value)) {{ implode(', ', $value) }} @else {{ $value }} @endif
@endif @endforeach
@else
No additional product details available.
@endif
@endif
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') : '—' }} {{ money((float)$installment->emi_amount) }} {{ money((float)$installment->paid_amount) }} {{ money((float)$installment->outstanding_amount) }} {{ 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 {{ money((float)$installment->emi_amount) }}
Paid {{ money((float)$installment->paid_amount) }}
Outstanding {{ money((float)$installment->outstanding_amount) }}
@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.' : ( $loan->processing_fee_paid_at ? 'Your processing fee has been received. Your loan is ready for disbursement.' : 'Your loan is approved. Processing fee payment is pending.' ) }}
@endif
← My Loans @if($loan->emiCard) View EMI Card @endif
@include('client.partials.bottom-nav')