@php $fund = $fund ?? 'pf'; $fundUpper = strtoupper($fund); $settings = $fundSettings ?? null; $loanModel = match ($fund) { 'gf' => \App\Models\GfLoan::class, 'swf' => \App\Models\SwfLoan::class, default => \App\Models\PfLoan::class, }; $indexRoute = route("{$fund}.loans"); $statuses = ['pending', 'approved', 'rejected', 'active', 'closed']; $tab = $tab ?? request('tab', 'register'); $filterQuery = $filterQuery ?? request()->query(); $filters = $filters ?? []; $currentYear = (int) ($filters['year'] ?? date('Y')); $currentMonth = (int) ($filters['month'] ?? 0); $installmentScope = $tab === 'overdue' ? 'overdue' : 'monthly'; $exportRoute = $tab === 'register' ? route("{$fund}.loans.export", $filterQuery) : route("{$fund}.loans.installments.export", array_merge($filterQuery, ['scope' => $installmentScope])); $printRoute = $tab === 'register' ? route("{$fund}.loans.list_print", $filterQuery) : route("{$fund}.loans.installments.print", array_merge($filterQuery, ['scope' => $installmentScope])); $sharedTabQuery = array_filter([ 'warehouse_id' => $filterQuery['warehouse_id'] ?? null, 'department_id' => $filterQuery['department_id'] ?? null, ]); $registerTabUrl = route("{$fund}.loans", array_merge($sharedTabQuery, ['tab' => 'register'])); $installmentsTabUrl = route("{$fund}.loans", array_merge($sharedTabQuery, ['tab' => 'installments'])); $overdueTabUrl = route("{$fund}.loans", array_merge($sharedTabQuery, ['tab' => 'overdue'])); @endphp @include('employee.fund.partials.emp_fund_styles', ['wrap' => 'adm-fund']) @include('admin.fund.partials.loan_reports_styles')
{{ $subtitle }}
@endif| {{ __('Employee') }} | {{ __('Branch') }} | {{ __('Department') }} | {{ __('Status') }} | {{ __('Principal') }} | {{ __('Period') }} | {{ __('Installment') }} | {{ __('Outstanding') }} | {{ __('Progress') }} | {{ __('Guarantors') }} | {{ __('Requested') }} | {{ __('Issued') }} | {{ __('Action') }} |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @include('admin.fund.partials.staff_cell', [ 'name' => $row->account?->staff?->user?->name, 'code' => $row->account?->staff?->user?->id, ]) | {{ $row->account?->staff?->warehouse?->name ?? '—' }} | {{ $row->account?->staff?->department?->name ?? '—' }} | @include('admin.fund.partials.fund_status_badge', ['status' => $row->status]) | {{ number_format((float) $row->principal, 2) }} | {{ $row->loan_period_months ? $row->loan_period_months.' '.__('mo') : '—' }} | {{ $row->monthly_installment ? number_format((float) $row->monthly_installment, 2) : '—' }} | {{ number_format((float) $row->outstanding, 2) }} | @if($totalInst > 0) {{ $paidCount }}/{{ $totalInst }} @else — @endif |
@forelse($row->guarantors ?? [] as $g)
@if($g->user)
{{ $g->user->name }} ({{ $g->user->id }})
@endif
@empty
—
@endforelse
|
{{ $row->requested_at?->format('Y-m-d') ?? '—' }} | {{ $row->issued_at?->format('Y-m-d') ?? '—' }} |
id) }}" class="btn btn-sm btn-outline-secondary" target="_blank" rel="noopener">{{ __('Print') }}
@if($row->status === 'pending')
@if(\App\Support\FundLoanSettings::allowAdminLoanOverride($settings))
@endif
@elseif(in_array($row->status, ['active', 'approved'], true) && (float) $row->outstanding > 0)
@else
{{ __('No actions') }}
@endif
|
| {{ ($hasFilters ?? false) ? __('No loans match your filters.') : __('No loan records yet.') }} | ||||||||||||