extend('layout/management_layout') ?> section('content') ?>

Detailed Financial Report

Loading report…
Failed to load report. Please try again. Retry
Download CSV Display Summary Report
Event fees total: $
isset($p['invoice_id']) && (int)$p['invoice_id'] === (int)$inv['id']); $pay = $payMatches ? reset($payMatches) : null; $paid = (float)($pay['paid_amount'] ?? 0); $bd = $breakdowns[(int)$inv['id']] ?? []; $cash = (float)($bd['cash'] ?? 0); $cred = (float)($bd['credit'] ?? 0); $chk = (float)($bd['check'] ?? 0); $refMatches = array_filter($refunds ?? [], fn($r) => isset($r['invoice_id']) && (int)$r['invoice_id'] === (int)$inv['id']); $ref = $refMatches ? reset($refMatches) : null; $refunded = (float)($ref['total_refunded'] ?? 0); $discMatches = array_filter($discounts ?? [], fn($d) => isset($d['invoice_id']) && (int)$d['invoice_id'] === (int)$inv['id']); $disc = $discMatches ? reset($discMatches) : null; $discounted = (float)($disc['discount_amount'] ?? 0); $totalAmount = (float)($inv['total_amount'] ?? 0); // Recompute balance for display: total - discount - paid - refunded $balanceCalc = (float)$totalAmount - (float)$discounted - (float)$paid - (float)$refunded; if ($balanceCalc < 0) $balanceCalc = 0.0; $balance = $balanceCalc; if ($balanceCalc <= 0.00001) { $status = 'Paid'; $statusClass = 'bg-success'; } elseif ($paid > 0.00001) { $status = 'Partially Paid'; $statusClass = 'bg-warning text-dark'; } else { $status = 'Unpaid'; $statusClass = 'bg-danger'; } ?>
Invoice # Parent School Year Total Paid Cash Credit Check Balance Refund Discount Status
$ $ $ $ $ $ $ $

Payments by Method (Filtered)

Cash Credit Check Grand Total (All Payments)
$ $ $ $

Expenses Summary

Category Total Amount
$

Reimbursements Summary

Status Total Amount
$
endSection() ?> section('scripts') ?> endSection() ?>