@section('page-title', 'Loans Report')

{{ __('Loans Report') }}

{{ __('Filter and export loan records') }}

← {{ __('Back to Reports') }}
{{ __('Clear') }}

{{ __('Total Loaned') }}

{{ number_format($totalLoaned, 2) }}

{{ __('Total Repaid') }}

{{ number_format($totalRepaid, 2) }}

{{ __('Total Balance') }}

{{ number_format($totalBalance, 2) }}

{{ __('Active Loans') }}

{{ $activeLoans }}

{{ $loans->count() }} {{ __('loan records found') }}

@forelse($loans as $loan) @empty @endforelse
{{ __('Loan ID') }} {{ __('Employee') }} {{ __('Amount') }} {{ __('Repaid') }} {{ __('Balance') }} {{ __('Monthly') }} {{ __('Start Date') }} {{ __('End Date') }} {{ __('Status') }} {{ __('Actions') }}
#{{ $loan->id }}
{{ $loan->employee->first_name ?? 'N/A' }} {{ $loan->employee->last_name ?? '' }}
{{ $loan->employee->employee_id ?? '' }}
{{ number_format($loan->amount, 2) }} {{ number_format($loan->amount_paid ?? $loan->repayments->sum('amount'), 2) }} {{ number_format($loan->balance, 2) }} {{ number_format($loan->monthly_payment ?? $loan->monthly_deduction ?? 0, 2) }} {{ $loan->start_date ? $loan->start_date->format('M d, Y') : 'N/A' }} {{ $loan->end_date ? $loan->end_date->format('M d, Y') : 'N/A' }} {{ ucfirst($loan->status) }} {{ __('View') }} {{ __('Edit') }}
{{ __('No loan records found.') }}