@extends('employee_loan.base_template') @section('page_title', 'Pending Loans') @section('page_heading', 'Pending Loan Applications') @section('page_description', 'Review and process pending loan applications') @section('page_icon') @endsection @section('kpi_section')
PENDING

{{ $stats['total'] ?? 0 }}

Total Pending
AMOUNT

{{ number_format($stats['total_amount'] ?? 0, 0) }}

Total TZS
AVERAGE

{{ number_format($stats['average_amount'] ?? 0, 0) }}

Avg Amount TZS
ACTIONS
@endsection @section('search_section')
@if(request('search')) @endif
Amount Range (TZS)
to
Tenure
Bank
Custom Date Range
to
Priority Level
Reset All
@if(request()->hasAny(['search', 'date_range', 'amount_min', 'amount_max', 'tenure', 'bank', 'date_from', 'date_to', 'priority']))
Active Filters: @if(request('search')) Search: {{ request('search') }} × @endif @if(request('date_range')) Period: {{ ucfirst(request('date_range')) }} × @endif @if(request('amount_min') || request('amount_max')) Amount: {{ number_format(request('amount_min', 0)) }} - {{ request('amount_max') ? number_format(request('amount_max')) : '∞' }} × @endif @if(request('priority')) Priority: {{ ucfirst(request('priority')) }} × @endif Clear All
@endif @endsection @section('table_content') @forelse($loanOffers as $offer) @php $loanData = $offer->toArray(); if ($offer->bank) { $loanData['bank'] = [ 'id' => $offer->bank->id, 'name' => $offer->bank->name, 'short_name' => $offer->bank->short_name, 'swift_code' => $offer->bank->swift_code ]; } else { $loanData['bank'] = null; } $daysWaiting = $offer->created_at ? now()->diffInDays($offer->created_at) : 0; $hoursWaiting = $offer->created_at ? now()->diffInHours($offer->created_at) : 0; @endphp
{{ $offer->first_name }} {{ $offer->last_name }}
{{ $offer->check_number }}
{{ number_format($offer->basic_salary ?? 0, 0) }}
Net: {{ number_format($offer->net_salary ?? 0, 0) }}
{{ number_format($offer->desired_deductible_amount ?? 0, 0) }}
{{ number_format($offer->requested_amount ?? 0, 0) }}
{{ number_format($offer->take_home_amount ?? $offer->net_loan_amount ?? 0, 0) }}
@if($offer->bank) {{ $offer->bank->short_name ?: $offer->bank->name }} @elseif($offer->swift_code) {{ $offer->swift_code }} @else No bank info @endif @if($offer->tenure) {{ $offer->tenure }} mo @else - @endif
{{ $offer->created_at ? $offer->created_at->format('d/m/Y H:i') : 'N/A' }} @if($daysWaiting > 7) {{ $daysWaiting }}d waiting @elseif($daysWaiting > 3) {{ $daysWaiting }}d waiting @elseif($daysWaiting >= 1) {{ $daysWaiting }}d waiting @elseif($hoursWaiting < 24) {{ $hoursWaiting }}h ago @endif
Pending New
@empty
No Pending Loan Applications

All loan applications have been processed

@endforelse @endsection @section('pagination_section') @if($loanOffers->hasPages()) @endif @endsection @section('additional_scripts') @endsection