@extends('layouts.app') @section('title', 'Loan Details') @section('page-title', 'Loan Details') @section('content')
Loan Information
@if($loan->status === 'active' && $loan->due_date < now() && ($loan->loanScheme?->late_fee_type || $loan->scheme?->late_fee_type))
@csrf
@endif Back

Loan Number: {{ $loan->loan_number }}

Customer: {{ $loan->customer->name }}

Scheme: {{ $loan->loanScheme?->name ?? $loan->scheme?->name ?? 'N/A' }}

Principal Amount: ₹{{ number_format($loan->principal_amount, 2) }}

Interest Rate: {{ $loan->interest_rate }}{{ ($loan->loanScheme?->interest_type ?? $loan->scheme?->interest_type) === 'flat' ? ' (Flat)' : '%' }}

Interest Amount: ₹{{ number_format($loan->interest_amount, 2) }}

Duration: {{ $loan->duration_value }} {{ ucfirst($loan->duration_type) }}

Processing Fee: ₹{{ number_format($loan->processing_fee, 2) }}

Insurance Fee: ₹{{ number_format($loan->insurance_fee, 2) }}

Other Fee: ₹{{ number_format($loan->other_fee, 2) }}

Total Amount: ₹{{ number_format($loan->total_amount, 2) }}

Paid Amount: ₹{{ number_format($loan->paid_amount, 2) }}

Remaining Amount: ₹{{ number_format($loan->remaining_amount, 2) }}

Installment Amount: ₹{{ number_format($loan->monthly_installment, 2) }}

Disbursement Date: {{ $loan->disbursement_date->format('d M Y') }}

Maturity Date: {{ $loan->maturity_date->format('d M Y') }}

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

Repayments
@forelse($loan->repayments as $repayment) @empty @endforelse
Date Amount Principal Interest Penalty Status Action
{{ $repayment->payment_date->format('d M Y') }} ₹{{ number_format($repayment->amount, 2) }} ₹{{ number_format($repayment->principal_amount, 2) }} ₹{{ number_format($repayment->interest_amount, 2) }} ₹{{ number_format($repayment->penalty_amount, 2) }} {{ ucfirst(str_replace('_', ' ', $repayment->status)) }}
No repayments found.
Late Fees / Penalties
@php $scheme = $loan->loanScheme ?? $loan->scheme; @endphp @if($scheme?->late_fee_type)
Late Fee: {{ $scheme->late_fee_value }} {{ $scheme->late_fee_type === 'percentage' ? '%' : '₹' }} {{ $scheme->late_fee_type === 'percentage' ? 'of installment' : 'per day' }}
@endif
@forelse($loan->penalties as $penalty) @empty @endforelse
Date Amount Status
{{ $penalty->penalty_date->format('d M Y') }} ₹{{ number_format($penalty->amount, 2) }} {{ ucfirst($penalty->status) }}
No penalties
@if($loan->penalties->where('status', 'pending')->count() > 0)
Total Pending: ₹{{ number_format($loan->penalties->where('status', 'pending')->sum('amount'), 2) }}
@endif
@endsection