@extends('backend.master') @section('title','User Installments') @section('content')
User Installments
Back
@if(session('success'))
{{ session('success') }}
@endif
{{ strtoupper(substr($user->name ?? 'U', 0, 1)) }}
{{ $user->name ?? 'N/A' }}
{{ $user->phone ?? '-' }} @if(!empty($user->email)) · {{ $user->email }} @endif
Total: {{ $installments->total() }}
@forelse($installments as $key => $installment) @php $status = strtolower($installment->status ?? 'upcoming'); if ($status === 'paid') { $statusClass = 'status-paid'; $statusIcon = 'bi-check-circle-fill'; } elseif ($status === 'late') { $statusClass = 'status-late'; $statusIcon = 'bi-clock-fill'; } elseif ($status === 'rejected') { $statusClass = 'status-rejected'; $statusIcon = 'bi-x-circle-fill'; } elseif ($status === 'upcoming') { $statusClass = 'status-upcoming'; $statusIcon = 'bi-calendar-event'; } else { $statusClass = 'status-other'; $statusIcon = 'bi-info-circle-fill'; } @endphp @empty @endforelse
# Loan ID Due Date Amount Principal Interest Paid Info Status Action
SL {{ $installments->firstItem() + $key }} Loan ID #{{ $installment->erin_loan_application_id }} @if($installment->loan)
Loan Status: {{ ucfirst($installment->loan->status ?? '-') }}
@endif
Due Date {{ $installment->due_date ? $installment->due_date->format('d M Y') : '-' }} Amount ৳{{ number_format((float) $installment->amount) }} Principal ৳{{ number_format((float) $installment->principal_part) }} Interest ৳{{ number_format((float) $installment->interest_part) }} Paid Info
Paid: ৳{{ number_format((float) ($installment->paid_amount ?? 0)) }}
@if($installment->payment_method)
Method: {{ $installment->payment_method }}
@endif @if($installment->payment_trx_id)
TRX: {{ $installment->payment_trx_id }}
@endif @if($installment->paid_at)
{{ $installment->paid_at->format('d M Y h:i A') }}
@endif
Status {{ ucfirst($status) }} Action
@if($status !== 'paid')
@csrf
@endif @if($status !== 'rejected')
@csrf
@endif
No installments found.
{{ $installments->links() }}
@endsection