fix enrollment, invoice, payment and financila aid
Deploy to Shared Hosting / Shared hosting deploy (push) Failing after 47s
Tests / PHPUnit (push) Failing after 1m19s

This commit is contained in:
root
2026-08-24 21:20:58 -04:00
parent 576da3bd78
commit 608aca79b8
30 changed files with 3327 additions and 774 deletions
+5 -6
View File
@@ -525,16 +525,15 @@ class PaymentController extends ResourceController
return 0;
}
// 2) Payment check: recompute current balance from payments (authoritative)
$total = (float) ($invoice['total_amount'] ?? 0);
$currentBal = $this->getCurrentInvoiceBalance($invoiceId); // <-- uses the safe helper
if (!($total > 0 && $currentBal < $total)) {
log_message('info', 'No payment yet (or still full balance). Skipping enrollment update. Invoice #{id}', ['id' => $invoiceId]);
// 2) Payment check: enrollment transitions only after the invoice is fully paid
$currentBal = $this->getCurrentInvoiceBalance($invoiceId);
if ($currentBal > 0.00001) {
log_message('info', 'Invoice not fully paid. Skipping enrollment update. Invoice #{id}', ['id' => $invoiceId]);
return 0;
}
$parentId = (int) ($invoice['parent_id'] ?? 0);
$schoolYear = (string) $this->schoolYear;
$schoolYear = (string) ($invoice['school_year'] ?? $this->schoolYear);
$semester = isset($this->semester) && $this->semester !== '' ? (string)$this->semester : null;
if ($parentId <= 0 || $schoolYear === '') {