apply the school year concept
Tests / PHPUnit (push) Failing after 1m19s

This commit is contained in:
root
2026-07-14 00:59:00 -04:00
parent 504c3bc9f9
commit feb1b29a32
73 changed files with 4288 additions and 620 deletions
+12 -3
View File
@@ -63,7 +63,7 @@ class PaymentController extends ResourceController
$this->enrollmentModel = new EnrollmentModel();
$this->studentModel = new StudentModel();
$this->studentClassModel = new StudentClassModel();
$this->schoolYear = $this->configModel->getConfig('school_year');
$this->schoolYear = $this->currentSchoolYearName();
$this->semester = $this->configModel->getConfig('semester'); //installment_date
$this->installmentDate = $this->configModel->getConfig('installment_date');
$this->discountUsageModel = new DiscountUsageModel();
@@ -137,11 +137,20 @@ class PaymentController extends ResourceController
private function getSelectedPaymentHistoryYear(): ?string
{
$selectedYear = $this->request->getGet('school_year') ?? $this->schoolYear;
$selectedYear = $this->request->getGet('school_year') ?? $this->currentSchoolYearName();
return $selectedYear !== '' ? $selectedYear : null;
}
private function currentSchoolYearName(): string
{
try {
return service('schoolYearContext')->resolve($this->request)->yearName();
} catch (\Throwable $e) {
return (string) ($this->configModel->getConfig('school_year') ?? '');
}
}
// View: Create a new payment plan
public function create()
{
@@ -204,7 +213,7 @@ class PaymentController extends ResourceController
public function eventChargesShow()
{
$parents = $this->userModel->getParents();
$school_Year = $this->request->getGet('school_year') ?? $this->schoolYear;
$school_Year = $this->request->getGet('school_year') ?? $this->currentSchoolYearName();
$seme_ster = $this->request->getGet('semester') ?? $this->semester;
// Join with users and students for full info