@extends('backend.master') @section('title','Installment Report') @section('content')
Installment Manage
@if(session('success'))
{{ session('success') }}
@endif
@forelse($users as $user) @php $totalLoans = (int) $user->total_loans; $runningLoans = (int) $user->running_loans; $completed = (int) $user->completed_loans; $totalIns = (int) $user->total_installments; $paidIns = (int) $user->paid_installments; $unpaid = max($totalIns - $paidIns, 0); if ($completed > 0 && $runningLoans === 0) { $badgeClass = 'badge-completed'; $badgeText = 'Completed'; $badgeIcon = 'bi-check-circle-fill'; } elseif ($runningLoans > 0 && $paidIns > 0) { $badgeClass = 'badge-running'; $badgeText = 'Running'; $badgeIcon = 'bi-play-circle-fill'; } elseif ($totalLoans > 0 && $paidIns === 0) { $badgeClass = 'badge-nopay'; $badgeText = 'No Payment'; $badgeIcon = 'bi-exclamation-triangle-fill'; } else { $badgeClass = 'badge-mixed'; $badgeText = 'Mixed'; $badgeIcon = 'bi-shuffle'; } @endphp @empty @endforelse
User Loans Installments Status Action
User
{{ $user->name ?? 'N/A' }}
{{ $user->phone ?? '-' }} @if(!empty($user->email)) ยท {{ $user->email }} @endif
Loans Total: {{ $totalLoans }} Running: {{ $runningLoans }} Completed: {{ $completed }} Installments Total: {{ $totalIns }} Paid: {{ $paidIns }} Unpaid: {{ $unpaid }} Status {{ $badgeText }} Action View
No users found.
{{ $users->links() }}
@endsection