@extends('layouts.master') @section('title', 'Fees Collection Report') @section('styles') @endsection @section('content')
{{-- ── Page Header ──────────────────────────────────────── --}}

Fees Collection Report

Fee collection, total invoices & outstanding balances — all in one place

{{-- ── Tab Navigation ───────────────────────────────────── --}}
{{-- ════════════════════════════════════════════════════════ TAB 1 — FEES COLLECTED ════════════════════════════════════════════════════════ --}}
{{-- Metrics --}}
Total Collected
${{ number_format($fcMetrics['totalCollected'] ?? 0, 2) }}
Total Receipts
{{ $fcMetrics['totalReceipts'] ?? 0 }}
Processed
{{ $fcMetrics['processedReceipts'] ?? 0 }}
Draft Receipts
{{ $fcMetrics['draftReceipts'] ?? 0 }}
{{-- Filters --}}
{{-- Action Row --}}
{{ isset($fcReceipts) ? $fcReceipts->count() : 0 }} receipt(s) shown
{{-- Table --}}
@forelse($fcReceipts ?? [] as $receipt) @empty @endforelse
Receipt # Client Receipt Date Payment Method Total Amount Status
{{ $receipt->receipt_number }} {{ $receipt->client->full_name ?? 'N/A' }} {{ optional($receipt->receipt_date)->format('d M Y') }} {{ $receipt->payment_methods_label ?: ($receipt->payment_method ?? 'N/A') }} ${{ number_format($receipt->total_amount, 2) }} @php $rcStatus = strtolower($receipt->status ?? ''); @endphp {{ ucfirst(str_replace('_', ' ', $rcStatus)) }}

No fee receipt records found for the selected period.

{{-- /pane-fee-collection --}} {{-- ════════════════════════════════════════════════════════ TAB 2 — TOTAL FEES ════════════════════════════════════════════════════════ --}}
{{-- Metrics (JS-driven, update on filter) --}}
Total Fees
$0.00
Paid Fees
$0.00
Outstanding
$0.00
Total Invoices
0
{{-- Filters --}}
{{-- Action Row --}} {{-- Table --}}
Client Name Invoice # Invoice Date Due Date Total Amount Paid Amount Balance Due Status Currency
{{-- /pane-total-fees --}} {{-- ════════════════════════════════════════════════════════ TAB 3 — OUTSTANDING FEES ════════════════════════════════════════════════════════ --}}
{{-- Metrics --}}
Total Outstanding
${{ number_format($ofMetrics['totalOutstanding'] ?? 0, 2) }}
Overdue Amount
${{ number_format($ofMetrics['overdueAmount'] ?? 0, 2) }}
Total Invoices
{{ $ofMetrics['totalInvoices'] ?? 0 }}
Avg Days Overdue
{{ $ofMetrics['avgDaysOverdue'] ?? 0 }}
{{-- Filters --}}
{{-- Action Row --}}
{{ isset($ofInvoices) ? $ofInvoices->count() : 0 }} invoice(s) shown
{{-- Table --}}
@forelse($ofInvoices ?? [] as $invoice) @php $daysOverdue = (int)($invoice->days_overdue ?? 0); $balanceDue = (float)($invoice->balance_due ?? 0); $statusLabel = $invoice->status_label ?? 'unpaid'; @endphp @empty @endforelse
Client Name Invoice # Invoice Date Due Date Total Amount Paid Amount Balance Due Status Days Overdue Currency
{{ $invoice->customer->full_name ?? 'N/A' }} {{ $invoice->invoice_number }} {{ optional($invoice->invoice_date)->format('d M Y') }} {{ optional($invoice->due_date_computed)->format('d M Y') }} ${{ number_format((float)($invoice->total ?? 0), 2) }} ${{ number_format((float)($invoice->paid_amount ?? 0), 2) }} ${{ number_format($balanceDue, 2) }} {{ ucfirst(str_replace('_', ' ', $statusLabel)) }} {{ $daysOverdue > 0 ? $daysOverdue . ' days' : 'Current' }} {{ $invoice->currency->currency_code ?? 'N/A' }}

No outstanding fees found for the selected period.

{{-- /pane-outstanding-fees --}}
{{-- /fr-wrap --}} @endsection @push('scripts') @endpush