fix gitlab tests

This commit is contained in:
root
2026-06-09 02:32:58 -04:00
parent 20a0b6c4e5
commit 6def9993da
1489 changed files with 10449 additions and 11356 deletions
+8 -15
View File
@@ -37,12 +37,11 @@ class FeeRefundDetailService
$tuitionStudents = $registeredKids;
foreach ($withdrawnKids as $kid) {
$rawDate = $kid['withdrawal_date'] ?? null;
if (empty($rawDate) || ! $deadline) {
if (empty($rawDate) || !$deadline) {
Log::warning('Missing withdrawal date or deadline; billing withdrawn student.', [
'student_id' => $kid['student_id'] ?? null,
]);
$tuitionStudents[] = $kid;
continue;
}
@@ -53,7 +52,6 @@ class FeeRefundDetailService
'student_id' => $kid['student_id'] ?? null,
]);
$tuitionStudents[] = $kid;
continue;
}
@@ -64,13 +62,12 @@ class FeeRefundDetailService
$tuitionStudents = array_values(array_filter($tuitionStudents, function ($student) use ($schoolYear) {
$sid = (int) ($student['student_id'] ?? 0);
return $sid > 0 && StudentClass::hasNonEventAssignment($sid, $schoolYear);
}));
foreach ($tuitionStudents as &$student) {
$name = null;
if (! empty($student['class_section_id'])) {
if (!empty($student['class_section_id'])) {
$name = ClassSection::getClassSectionNameBySectionId($student['class_section_id']);
}
$student['grade_name'] = is_string($name) ? strtoupper(trim($name)) : 'N/A';
@@ -132,7 +129,7 @@ class FeeRefundDetailService
if ($bookPriceRaw === null || $bookPriceRaw === '') {
return ['ok' => false, 'error' => 'Book price is not configured.'];
}
if (! is_numeric($bookPriceRaw)) {
if (!is_numeric($bookPriceRaw)) {
return ['ok' => false, 'error' => 'Book price must be numeric.'];
}
$bookPrice = round((float) $bookPriceRaw, 2);
@@ -149,10 +146,9 @@ class FeeRefundDetailService
$status = (string) ($student['enrollment_status'] ?? '');
if (in_array($status, ['enrolled', 'payment pending'], true)) {
$registered[] = $student;
continue;
}
if (! in_array($status, ['withdrawn', 'refund pending', 'withdraw under review'], true)) {
if (!in_array($status, ['withdrawn', 'refund pending', 'withdraw under review'], true)) {
continue;
}
$hasWithdrawn = true;
@@ -173,7 +169,7 @@ class FeeRefundDetailService
}
}
if (! $hasWithdrawn) {
if (!$hasWithdrawn) {
return ['ok' => false, 'error' => 'No withdrawn students found for refund evaluation.'];
}
@@ -207,7 +203,7 @@ class FeeRefundDetailService
}
}
$eligible = ! empty($withdrawnEligible);
$eligible = !empty($withdrawnEligible);
$refundAmount = 0.0;
$debitAmount = 0.0;
@@ -234,9 +230,9 @@ class FeeRefundDetailService
$refundableCash = min($totalPaid, $refundableTuition);
$raw = round($refundableCash - $bookPrice, 2);
if ($raw > 0 && ! $fullDiscount) {
if ($raw > 0 && !$fullDiscount) {
$refundAmount = $raw;
} elseif ($raw < 0 && ! $fullDiscount) {
} elseif ($raw < 0 && !$fullDiscount) {
$debitAmount = abs($raw);
}
}
@@ -263,7 +259,6 @@ class FeeRefundDetailService
public function calculateRefund(array $students, int $parentId): float
{
$result = $this->calculateRefundDetails($students, $parentId);
return (float) ($result['refund_amount'] ?? 0.0);
}
@@ -271,7 +266,6 @@ class FeeRefundDetailService
{
$resolvedGradeFee = $gradeFee ?? (int) (Configuration::getConfig('grade_fee') ?? 9);
$grades = new InvoiceGradeService($resolvedGradeFee);
return $grades->getGradeLevel($grade);
}
@@ -279,7 +273,6 @@ class FeeRefundDetailService
{
$resolvedGradeFee = $gradeFee ?? (int) (Configuration::getConfig('grade_fee') ?? 9);
$grades = new InvoiceGradeService($resolvedGradeFee);
return $grades->compareGrades((string) $gradeA, (string) $gradeB);
}