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
+18 -15
View File
@@ -1,7 +1,7 @@
<?php
/** @var string $school_year */
/** @var array<string> $schoolYears */
/** @var array<int,array{parent_id:int,parent_name:string,email:string,total_invoice:float,total_balance:float,total_discount:float,total_paid:float,remaining_installments:int,installment_amount:float,type:string,has_installment?:int,next_installment?:string}> $rows */
/** @var array<int,array{parent_id:int,parent_name:string,email:string,total_invoice:float,total_balance:float,total_discount:float,total_paid:float,payment_count:int,remaining_installments:int,installment_amount:float,type:string,has_installment?:int,next_installment?:string}> $rows */
?>
<?= $this->extend('layout/management_layout') ?>
@@ -15,8 +15,6 @@
.table thead th { background: var(--mgmt-thead-bg, #f1f3f5); }
.actions { white-space: nowrap; }
.actions .btn { --bs-btn-padding-y: .25rem; --bs-btn-padding-x: .5rem; }
.email-cell { max-width: 280px; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 576px){ .email-cell { max-width: 180px; } }
/* Disable sticky header for this table to avoid overlap */
table.no-mgmt-sticky thead th { position: static !important; }
</style>
@@ -49,13 +47,15 @@
<button class="btn btn-primary btn-sm" type="submit">Send Reminders (All)</button>
</form>
</div>
<?php $sumEventFees = 0.0; ?>
<div class="table-responsive">
<table id="unpaidTable" class="table table-sm align-middle no-mgmt-sticky" data-no-mgmt-sticky>
<thead>
<tr>
<th>Parent</th>
<th>Email</th>
<th class="text-center">Nbr of Installements</th>
<th>Type</th>
<th class="text-end">Event Fees</th>
<th class="text-end">Invoice Amount</th>
<th class="text-end">Applied Discount</th>
<th class="text-end">Paid Amount</th>
@@ -69,7 +69,7 @@
</thead>
<tbody>
<?php if (empty($rows)): ?>
<tr><td colspan="12" class="text-center text-muted py-4">No parents with outstanding balance.</td></tr>
<tr><td colspan="13" class="text-center text-muted py-4">No parents with outstanding balance.</td></tr>
<?php else: ?>
<?php
$sumInvoice = 0.0;
@@ -86,20 +86,22 @@
</a>
<small class="text-muted">#<?= (int)$r['parent_id'] ?></small>
</td>
<td class="email-cell"><a href="mailto:<?= esc($r['email']) ?>"><?= esc($r['email']) ?></a></td>
<td class="text-center"><?= (int)($r['payment_count'] ?? 0) ?></td>
<td>
<?php if (($r['type'] ?? '') === 'no_payment'): ?>
<span class="badge bg-danger badge-type">no payment</span>
<?php else: ?>
<span class="badge bg-success badge-type">installment</span>
<?php endif; ?>
</td>
<?php $sumInvoice += (float)($r['total_invoice'] ?? 0); ?>
<?php $sumPaid += (float)($r['total_paid'] ?? 0); ?>
<?php if (($r['type'] ?? '') === 'no_payment'): ?>
<span class="badge bg-danger badge-type">no payment</span>
<?php else: ?>
<span class="badge bg-success badge-type">installment</span>
<?php endif; ?>
</td>
<?php $sumInvoice += (float)($r['total_invoice'] ?? 0); ?>
<?php $sumEventFees += (float)($r['event_fees'] ?? 0); ?>
<?php $sumPaid += (float)($r['total_paid'] ?? 0); ?>
<?php $sumDisc += (float)($r['total_discount'] ?? 0); ?>
<?php $sumInstAmt += (float)($r['installment_amount'] ?? 0); ?>
<?php $sumBal += (float)($r['total_balance'] ?? 0); ?>
<td class="text-end">$<?= number_format((float)($r['total_invoice'] ?? 0), 2) ?></td>
<td class="text-end">$<?= number_format((float)($r['event_fees'] ?? 0), 2) ?></td>
<td class="text-end">$<?= number_format((float)($r['total_invoice'] ?? 0), 2) ?></td>
<td class="text-end text-success">-$<?= number_format((float)($r['total_discount'] ?? 0), 2) ?></td>
<td class="text-end">$<?= number_format((float)($r['total_paid'] ?? 0), 2) ?></td>
<td class="text-center"><?= (int)($r['remaining_installments'] ?? 0) ?></td>
@@ -131,6 +133,7 @@
<tfoot>
<tr>
<th colspan="3" class="text-end">Totals:</th>
<th class="text-end">$<?= number_format($sumEventFees, 2) ?></th>
<th class="text-end">$<?= number_format($sumInvoice, 2) ?></th>
<th class="text-end text-success">-$<?= number_format($sumDisc, 2) ?></th>
<th class="text-end">$<?= number_format($sumPaid, 2) ?></th>