@extends('layout.main') @section('content')

REPAYMENT SCHEDULE DETAILS

@if(Auth::user()->can('loans-edit')) Edit Schedule @endif @if(Auth::user()->can('loans-delete')) @php $totalSchedules = $loan->repaymentSchedules()->count(); @endphp @if($totalSchedules > 1) @else @endif @endif Back to Schedule View Loan Details
Loan Code

{{ $loan->loan_code }}

Client

@if($loan->individualClient) {{ $loan->individualClient->client->fullname }} @else Group Loan @endif

Loan Amount

{{ formatCurrencyDecimals($loan->loan_amount) }}

Status
{{ ucfirst($schedule->status) }}
Installment Information
Due Date: {{ $schedule->date ? $schedule->date->format('l, d M Y') : 'Not Set' }}
Installment Amount: {{ formatCurrencyDecimals($schedule->amount) }}
Payment Status: {{ ucfirst($schedule->status) }}
Last Updated: {{ $schedule->updated_at ? $schedule->updated_at->format('d M Y, H:i') : 'Never' }}
Principal Paid: {{ formatCurrencyDecimals($schedule->principal_paid ?: 0) }}
Interest Paid: {{ formatCurrencyDecimals($schedule->interest_paid ?: 0) }}
Total Paid: {{ formatCurrencyDecimals(($schedule->principal_paid ?: 0) + ($schedule->interest_paid ?: 0)) }}
Remaining Balance: {{ formatCurrencyDecimals($schedule->balance ?: 0) }}
Payment Breakdown
Principal Payment

{{ formatCurrencyDecimals($schedule->principal_paid ?: 0) }}

@php $principalPercentage = $schedule->amount > 0 ? (($schedule->principal_paid ?: 0) / $schedule->amount) * 100 : 0; @endphp

{{ number_format($principalPercentage, 1) }}%

Interest Payment

{{ formatCurrencyDecimals($schedule->interest_paid ?: 0) }}

@php $interestPercentage = $schedule->amount > 0 ? (($schedule->interest_paid ?: 0) / $schedule->amount) * 100 : 0; @endphp

{{ number_format($interestPercentage, 1) }}%

Outstanding Balance

{{ formatCurrencyDecimals($schedule->balance ?: 0) }}

@php $balancePercentage = $schedule->amount > 0 ? (($schedule->balance ?: 0) / $schedule->amount) * 100 : 0; @endphp

{{ number_format($balancePercentage, 1) }}%

Schedule Status Information

@if($schedule->status === 'paid')

✅ This installment has been fully paid. No further payment is required for this period.

@elseif($schedule->status === 'partial')

⚠️ This installment has been partially paid. Outstanding balance: {{ formatCurrencyDecimals($schedule->balance) }}

@else

❌ This installment is pending payment. Full amount due: {{ formatCurrencyDecimals($schedule->amount) }}

@endif
@endsection