This commit is contained in:
@@ -8,6 +8,11 @@ use App\Models\ClassSectionModel;
|
||||
|
||||
class FeeCalculationService
|
||||
{
|
||||
public function calculateEnrollmentTuition(array $students): float
|
||||
{
|
||||
return round($this->calculateTotalTuitionFee($students), 2);
|
||||
}
|
||||
|
||||
public function calculateRefund(array $students, int $parentId): float
|
||||
{
|
||||
$configModel = new ConfigurationModel();
|
||||
@@ -145,7 +150,7 @@ class FeeCalculationService
|
||||
|
||||
// ✅ Pre-fetch and assign grade/class section names before sorting
|
||||
foreach ($students as &$student) {
|
||||
$gradeName = $classSectionModel->getClassSectionNameBySectionId($student['class_section_id']);
|
||||
$gradeName = $classSectionModel->getClassSectionNameBySectionId((int) ($student['class_section_id'] ?? 0));
|
||||
$student['grade'] = strtoupper(trim($gradeName));
|
||||
}
|
||||
unset($student); // break reference
|
||||
|
||||
Reference in New Issue
Block a user