@php use App\Services\FundLoanFilterService; use App\Services\FundLoanInstallmentReportService; use Carbon\Carbon; $installmentRows = $installmentRows ?? collect(); $scope = $scope ?? 'monthly'; $totalPrincipal = 0.0; $totalCharge = 0.0; $totalAmount = 0.0; $rowCollection = method_exists($installmentRows, 'getCollection') ? $installmentRows->getCollection() : collect($installmentRows); @endphp
@forelse($installmentRows as $inst) @php $staff = $inst->loan?->account?->staff; $status = FundLoanInstallmentReportService::resolveRowStatus($inst); $dueLabel = Carbon::create((int) $inst->due_year, (int) $inst->due_month, 1)->format('M Y'); $pill = match ($status) { 'paid' => 'loan-status-pill--paid', 'overdue' => 'loan-status-pill--overdue', default => 'loan-status-pill--pending', }; $principal = (float) $inst->amount; $charge = (float) ($inst->service_charge ?? 0); $rowTotal = FundLoanInstallmentReportService::rowTotalAmount($inst); $totalPrincipal += $principal; $totalCharge += $charge; $totalAmount += $rowTotal; @endphp @empty @endforelse @if($rowCollection->isNotEmpty()) @endif
{{ __('Employee') }} {{ __('Branch') }} {{ __('Department') }} {{ __('Loan') }} {{ __('#') }} {{ __('Due period') }} {{ __('Principal') }} {{ __('S/Charge') }} {{ __('Total') }} {{ __('Status') }} {{ __('Paid on') }} {{ __('Outstanding') }}
@include('admin.fund.partials.staff_cell', [ 'name' => $staff?->user?->name, 'code' => $staff?->user?->id, ]) {{ $staff?->warehouse?->name ?? '—' }} {{ $staff?->department?->name ?? '—' }} #{{ $inst->loan?->id }} {{ $inst->installment_no }} {{ $dueLabel }} {{ number_format($principal, 2) }} {{ number_format($charge, 2) }} {{ number_format($rowTotal, 2) }} {{ FundLoanFilterService::installmentStatusLabel($status) }} {{ $inst->paid_at?->format('Y-m-d') ?? '—' }} {{ number_format((float) ($inst->loan?->outstanding ?? 0), 2) }}
{{ ($hasFilters ?? false) ? __('No installments match your filters.') : __('No installment records found.') }}
{{ __('Page totals') }} {{ number_format($totalPrincipal, 2) }} {{ number_format($totalCharge, 2) }} {{ number_format($totalAmount, 2) }}
@if(method_exists($installmentRows, 'hasPages') && $installmentRows->hasPages()) @endif