@extends('layouts.app') @section('content')
ESS Loan Applications
Member employee loan requests from ESS portal
PENDING

{{ $pendingCount ?? 0 }}

+0 this week
APPROVED

{{ $approvedCount ?? 0 }}

+0 this week
REJECTED

{{ $rejectedCount ?? 0 }}

0 this week
CANCELLED

{{ $cancelledCount ?? 0 }}

0 this week
DISBURSED

{{ $disbursedCount ?? 0 }}

+0 this week
Smart Filters

Quick access to filter options

Quick Filters:
@if(request('search')) @endif
@if(request()->hasAny(['search', 'status', 'date_from', 'date_to']))
Active Filters: @if(request('search')) Search: "{{ request('search') }}" @endif @if(request('status')) Status: {{ ucfirst(str_replace('_', ' ', request('status'))) }} @endif @if(request('date_from')) From: {{ request('date_from') }} @endif @if(request('date_to')) To: {{ request('date_to') }} @endif
@endif

Loan Applications

{{ $loanOffers->count() }} of {{ $loanOffers->total() ?? 0 }} @if(request()->has('status_filter') || request()->has('approval_filter') || request()->has('date_from') || request()->has('date_to')) Filtered @else All Records @endif
{{ $loanOffers->whereIn('approval', ['PENDING', null])->count() }} Pending
{{ $loanOffers->where('approval', 'APPROVED')->count() }} Approved
{{ number_format($loanOffers->sum('requested_amount') / 1000000, 1) }}M Total
@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; } @endphp @empty @endforelse
Employee
Salary
Deductible
Requested
Take Home
Employee Bank Tenure Approval Status Actions
{{ $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 @switch($offer->approval) @case('APPROVED') Approved @break @case('REJECTED') Rejected @break @case('CANCELLED') Cancelled @break @case('PENDING') Pending @break @default Pending @endswitch @php $state = $offer->state ?? $offer->status ?? 'Initiated'; @endphp @switch(strtolower($state)) @case('initiated') Initiated @break @case('loan offer at fsp') At FSP @break @case('fsp rejected') FSP Rejected @break @case('loan offer at employee') FSP Approved - At Employee @break @case('employee rejected') Employee Rejected @break @case('pending for approval') Pending Approval @break @case('employee canceled') @case('employee cancelled') Employee Cancelled @break @case('employer rejected') Employer Rejected @break @case('submitted for disbursement') @case('submitted_for_disbursement') Submitted for Disbursement @break @case('fsp canceled') @case('fsp cancelled') FSP Cancelled @break @case('completed') @case('disbursed') Completed @break @case('waiting for liquidation') Waiting Liquidation @break @case('disbursement failure') @case('disbursement_failed') Disbursement Failed @break @case('liquidated') @case('full_settled') Liquidated @break @case('approved') Employer Approved @break @case('cancelled') Cancelled @break @default {{ ucfirst(str_replace('_', ' ', $state)) }} @endswitch
@php $isCancelled = in_array(strtoupper($offer->approval ?? ''), ['CANCELLED', 'CANCELED']) || in_array(strtoupper($offer->status ?? ''), ['CANCELLED', 'CANCELED']) || in_array(strtoupper($offer->state ?? ''), ['CANCELLED', 'CANCELED', 'LOAN_CANCELLATION']); @endphp @if($isCancelled) Cancelled @else @php $isLoanCancelled = in_array(strtoupper($offer->approval ?? ''), ['CANCELLED', 'CANCELED']) || in_array(strtoupper($offer->status ?? ''), ['CANCELLED', 'CANCELED']) || in_array(strtoupper($offer->state ?? ''), ['CANCELLED', 'CANCELED', 'LOAN_CANCELLATION']); @endphp @if($offer->approval !== 'APPROVED' && $offer->approval !== 'REJECTED' && $offer->status !== 'disbursed' && !$isLoanCancelled) @elseif($isLoanCancelled) @endif @endif
No Loan Applications Found

Start by syncing data from ESS or adjusting your filters

@if($loanOffers->hasPages()) @endif
Loading...

Processing your request...

@include('partials.reject-loan-modal') @endsection @push('styles') @endpush @push('scripts') @endpush