merge prod to main

This commit is contained in:
root
2026-05-16 13:44:12 -04:00
parent 663c0cdbda
commit b32fb853f6
901 changed files with 11241 additions and 1340 deletions
+24 -4
View File
@@ -54,6 +54,11 @@
<button class="btn btn-primary" onclick="window.print()">Print Report</button>
<a id="summaryReportLink" href="<?= base_url('financial-report/financialReportSummary') ?>" class="btn btn-info">Display Summary Report</a>
</div>
<?php if (isset($eventFeesTotal)): ?>
<div class="alert alert-info mb-3">
<strong>Event fees total:</strong> $<?= number_format((float)$eventFeesTotal, 2) ?>
</div>
<?php endif; ?>
<div class="table-responsive">
<table id="invoicesTable" class="table table-bordered table-striped align-middle w-100">
<thead>
@@ -95,8 +100,16 @@
$balanceCalc = (float)$totalAmount - (float)$discounted - (float)$paid - (float)$refunded;
if ($balanceCalc < 0) $balanceCalc = 0.0;
$balance = $balanceCalc;
$status = ($balanceCalc === 0.0) ? 'Paid' : 'Unpaid';
$statusClass = ($status === 'Paid') ? 'bg-success' : 'bg-danger';
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';
}
?>
<tr>
<td><?= esc($inv['invoice_number']) ?></td>
@@ -371,8 +384,15 @@
const total = Number(inv.total_amount || 0);
let balance = total - paid - discounted - refunded;
if (!Number.isFinite(balance) || balance < 0) balance = 0;
const status = balance === 0 ? 'Paid' : 'Unpaid';
const statusClass = balance === 0 ? 'bg-success' : 'bg-danger';
let status = 'Unpaid';
let statusClass = 'bg-danger';
if (balance <= 0.00001) {
status = 'Paid';
statusClass = 'bg-success';
} else if (paid > 0.00001) {
status = 'Partially Paid';
statusClass = 'bg-warning text-dark';
}
const tr = document.createElement('tr');
const parentHtml = (inv.parent_id && Number(inv.parent_id) > 0) ?
`<a href="<?= site_url('family') ?>?guardian_id=${encodeURIComponent(inv.parent_id)}" class="text-decoration-none" data-family-guardian-id="${inv.parent_id}">${inv.parent_name||''}</a>` :