@extends('admin.layouts.app') @section('content')
{{-- ====================================================== PAGE HEADER ======================================================= --}} {{-- ====================================================== DATE FILTER ======================================================= --}}
{{-- From Date --}}
{{-- To Date --}}
{{-- Filter --}}
{{-- Reset --}}
{{-- ====================================================== SUMMARY ======================================================= --}}
Total Loans

{{ $totalLoans }}

Total Disbursed

{{ $currencySymbol }}{{ number_format( $totalDisbursed, $decimalPlaces ) }}

Total Collected

{{ $currencySymbol }}{{ number_format( $totalCollected, $decimalPlaces ) }}

Total Outstanding

{{ $currencySymbol }}{{ number_format( $totalOutstanding, $decimalPlaces ) }}

{{-- ====================================================== COLLECTION REPORT ======================================================= --}}

Collection Report

EMI and other payments received

{{-- Payment Type Filter --}}
{{-- Preserve From Date --}} @if($fromDate) @endif {{-- Preserve To Date --}} @if($toDate) @endif {{-- Preserve Loan Status --}} @if($loanStatus) @endif
{{ $payments->total() }} Payments Export PDF
@forelse($payments as $payment) @empty @endforelse
Date Client Loan Type Method Amount Reference
{{ $payment->paid_at?->format('d-m-Y') ?? '-' }} {{ $payment->user?->name ?? '-' }} {{ $payment->loan?->loan_number ?? '-' }} {{ ucfirst( str_replace( '_', ' ', $payment->payment_type ?? 'general' ) ) }} {{ ucfirst( str_replace( '_', ' ', $payment->payment_method ?? '-' ) ) }} {{ $currencySymbol }}{{ number_format( (float) $payment->amount, $decimalPlaces ) }} {{ $payment->reference_number ?? '-' }}
No payments found for the selected filters.
{{-- Collection Pagination --}}
{{ $payments->links() }}
{{-- ====================================================== LOAN REPORT ======================================================= --}}

Loan Report

Overview of all loans

{{-- Loan Status Filter --}}
{{-- Preserve From Date --}} @if($fromDate) @endif {{-- Preserve To Date --}} @if($toDate) @endif {{-- Preserve Payment Type --}} @if($paymentType) @endif
{{ $loans->total() }} Loans Export PDF
@forelse($loans as $loan) @empty @endforelse
Loan Number Client Loan Amount Disbursed Date Outstanding Status
{{ $loan->loan_number ?? '-' }} {{ $loan->user?->name ?? '-' }} {{ $currencySymbol }}{{ number_format( (float) $loan->loan_amount, $decimalPlaces ) }} {{ $loan->disbursed_at?->format('d-m-Y') ?? '-' }} {{ $currencySymbol }}{{ number_format( (float) $loan->outstanding_amount, $decimalPlaces ) }} @php $displayLoanStatus = strtolower( $loan->status ?? '' ); @endphp @if( $displayLoanStatus === 'completed' || $displayLoanStatus === 'closed' ) Closed @elseif( $displayLoanStatus === 'active' ) Active @else {{ ucfirst( str_replace( '_', ' ', $loan->status ?? '-' ) ) }} @endif
No loans found for the selected filters.
{{-- Loan Pagination --}}
{{ $loans->links() }}
{{-- ========================================================== AJAX REPORT SYSTEM ========================================================== --}} @endsection