@section('page-title', 'Loan Details')

Loan Details

View and manage loan information

Back to Loans
@if(session('success'))

{{ session('success') }}

@endif @if(session('error'))

{{ session('error') }}

@endif

Loan Information

@if($loan->status === 'pending') Pending Approval @elseif($loan->status === 'approved') Approved @elseif($loan->status === 'active') Active @elseif($loan->status === 'completed') Completed @elseif($loan->status === 'rejected') Rejected @endif

Employee

{{ $loan->employee->first_name }} {{ $loan->employee->last_name }}

Employee ID

{{ $loan->employee->employee_id ?? 'N/A' }}

Loan Amount

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

Interest Rate

{{ $loan->interest_rate }}% per annum

Term

{{ $loan->term_months }} months

Monthly Payment

${{ number_format($loan->monthly_payment, 2) }}

Total Paid

${{ number_format($loan->total_paid, 2) }}

Balance Remaining

${{ number_format($loan->balance, 2) }}

@if($loan->start_date)

Start Date

{{ $loan->start_date->format('M d, Y') }}

@endif @if($loan->end_date)

End Date

{{ $loan->end_date->format('M d, Y') }}

@endif
@if($loan->purpose)

Purpose

{{ $loan->purpose }}

@endif @if($loan->notes)

Notes

{{ $loan->notes }}

@endif @if($loan->approver)

Approved By

{{ $loan->approver->name }} on {{ $loan->approved_at->format('M d, Y') }}

@endif

Repayment History

@if($loan->repayments->count() > 0)
@foreach($loan->repayments as $repayment) @endforeach
Date Amount Method Balance After
{{ $repayment->payment_date->format('M d, Y') }} ${{ number_format($repayment->amount, 2) }} {{ ucfirst(str_replace('_', ' ', $repayment->payment_method)) }} ${{ number_format($repayment->balance_after, 2) }}
@else

No repayments recorded yet

@endif

Repayment Progress

@php $percentPaid = $loan->amount > 0 ? (($loan->amount - $loan->balance) / $loan->amount) * 100 : 0; @endphp
{{ number_format($percentPaid, 1) }}% paid ${{ number_format($loan->total_paid, 0) }} / ${{ number_format($loan->amount, 0) }}
@if($loan->status === 'pending')

Actions

@csrf
@csrf
@endif @if($loan->status === 'approved')

Actions

@csrf
@endif @if(in_array($loan->status, ['active', 'approved']))

Record Repayment

@csrf

Max: ${{ number_format($loan->balance, 2) }}

@endif