@extends('layouts.app') @section('title', 'Reschedule Loan - ' . $loan->loan_number) @section('content')
Current Loan Terms
${{ number_format($loan->amount, 2) }}
{{ $loan->interest_rate }}%
{{ $loan->duration_months }} months
${{ number_format($loan->monthly_payment, 2) }}
${{ number_format($loan->outstanding_balance, 2) }}
@php // Calculate remaining payments directly in the view as fallback $totalPaid = $loan->repayments->sum('amount'); $remainingPaymentsView = $loan->duration_months; if ($totalPaid > 0) { $paidMonths = floor($totalPaid / $loan->monthly_payment); $remainingPaymentsView = max(0, $loan->duration_months - $paidMonths); } echo $remainingPaymentsView; @endphp
@if($errors->any()) @endif
@csrf
New Loan Terms
@error('reschedule_type') {{ $message }} @enderror
@error('reason') {{ $message }} @enderror
Cancel
@endsection