@extends('layouts.app') @section('content')

Rejection Management

Track and analyze rejected applications

Total Rejections

{{ number_format($analytics['total']) }}

Today

{{ number_format($analytics['today']) }}

This Week

{{ number_format($analytics['week']) }}

This Month

{{ number_format($analytics['month']) }}

Rejections by Reason
@if($analytics['by_reason']->count() > 0) @foreach($analytics['by_reason'] as $index => $reason) @php $percentage = $analytics['total'] > 0 ? round(($reason->count / $analytics['total'] * 100), 1) : 0; $icons = ['bx-error', 'bx-x-circle', 'bx-block', 'bx-shield-x', 'bx-minus-circle']; $icon = $icons[$index % count($icons)]; @endphp
{{ ucwords(str_replace('_', ' ', $reason->rejection_reason)) }}
{{ $reason->count }} {{ $percentage }}%
@endforeach @else

No rejection data available

@endif
Rejections by Type
@if($analytics['by_type']->count() > 0) @foreach($analytics['by_type'] as $type) @php $percentage = $analytics['total'] > 0 ? round(($type->count / $analytics['total'] * 100), 1) : 0; $typeValue = $type->type ?? 'N/A'; $icon = match($typeValue) { 'loan_application' => 'bx-credit-card', 'refund' => 'bx-money', 'share_enquiry' => 'bx-share-alt', 'retirement' => 'bx-user-check', 'withdraw_savings', 'withdraw_deposit' => 'bx-wallet', 'join_membership' => 'bx-user-plus', 'unjoin_membership' => 'bx-user-minus', default => 'bx-file' }; @endphp
{{ ucwords(str_replace('_', ' ', $typeValue)) }}
{{ $type->count }} {{ $percentage }}%
@endforeach @else

No type data available

@endif
Rejections List
@if($rejections->count() > 0)
@foreach($rejections as $index => $rejection) @endforeach
# Applicant Info Type Location Rejection Reason Details Rejected By Date Actions
{{ $rejections->firstItem() + $index }}
{{ $rejection->enquiry->full_name ?? 'N/A' }}
{{ $rejection->enquiry->check_number ?? 'N/A' }}
@php $type = $rejection->enquiry->type ?? 'N/A'; $icon = match($type) { 'loan_application' => 'bx-credit-card', 'refund' => 'bx-money', 'share_enquiry' => 'bx-share-alt', 'retirement' => 'bx-user-check', 'withdraw_savings', 'withdraw_deposit' => 'bx-wallet', default => 'bx-file' }; @endphp {{ ucwords(str_replace('_', ' ', $type)) }}
{{ $rejection->enquiry->region->name ?? 'N/A' }}
{{ $rejection->enquiry->district->name ?? 'N/A' }}
{{ $rejection->enquiry->branch->name ?? 'N/A' }}
{{ ucwords(str_replace('_', ' ', $rejection->rejection_reason)) }} @if($rejection->rejection_detail)
{{ Str::limit($rejection->rejection_detail, 50) }}
@else No details provided @endif
@if($rejection->rejectedBy)
{{ $rejection->rejectedBy->name }}
@if($rejection->rejectedBy->roles->first()) {{ ucwords(str_replace('_', ' ', $rejection->rejectedBy->roles->first()->name)) }} @endif
@else N/A @endif
{{ $rejection->created_at->format('d M Y') }}
{{ $rejection->created_at->format('H:i') }}
View
@if($rejections->hasPages())
Showing {{ $rejections->firstItem() }} to {{ $rejections->lastItem() }} of {{ $rejections->total() }} entries
{{ $rejections->links('pagination::bootstrap-5') }}
@endif @else

No Rejections Found

No rejections match your current filters.

@endif
@push('styles') @endpush @endsection