fix all issues before deploy
Deploy to Shared Hosting / Shared hosting deploy (push) Failing after 47s
Tests / PHPUnit (push) Failing after 1m18s

This commit is contained in:
root
2026-08-25 03:10:44 -04:00
parent 5f5afe97ad
commit 9899af7b37
11 changed files with 515 additions and 37 deletions
+31 -6
View File
@@ -730,12 +730,19 @@ class InvoiceController extends ResourceController
$grade = 'N/A';
if ($studentClass && isset($studentClass['class_section_id'])) {
$classSection = $this->db->table('classSection')
->where('class_section_id', $studentClass['class_section_id'])
->get()
->getRowArray();
if ($classSection && isset($classSection['class_section_name'])) {
$grade = $classSection['class_section_name'];
$classSectionBuilder = $this->db->table('classSection')
->select('classSection.class_section_id, classSection.class_section_name, classSection.class_id, classes.class_name')
->join('classes', 'classes.id = classSection.class_id', 'left')
->where('classSection.class_section_id', $studentClass['class_section_id']);
if ($this->db->fieldExists('school_year', 'classSection')) {
$classSectionBuilder->orderBy('classSection.school_year = ' . $this->db->escape($schoolYear), 'DESC', false);
}
$classSectionBuilder->orderBy('classSection.id', 'DESC');
$classSection = $classSectionBuilder->get()->getRowArray();
if ($classSection) {
$grade = $this->invoiceManagementGradeLabel($classSection, $student);
} elseif ($this->isKindergarten((string) ($student['registration_grade'] ?? ''))) {
$grade = 'KG';
}
}
@@ -771,6 +778,24 @@ class InvoiceController extends ResourceController
];
}
private function invoiceManagementGradeLabel(array $classSection, array $student): string
{
$registrationGrade = trim((string) ($student['registration_grade'] ?? ''));
$classId = (int) ($classSection['class_id'] ?? 0);
$className = trim((string) ($classSection['class_name'] ?? ''));
$sectionName = trim((string) ($classSection['class_section_name'] ?? ''));
if ($classId === 13 || $this->isKindergarten($className) || $this->isKindergarten($registrationGrade)) {
return 'KG';
}
if ($sectionName === '13') {
return 'KG';
}
return $sectionName !== '' ? $sectionName : ($className !== '' ? $className : 'N/A');
}
/**
* @return list<array<string, mixed>>
*/