fix the forecast tuition

This commit is contained in:
root
2026-06-07 00:27:27 -04:00
parent 654453222f
commit 384ae8b719
14 changed files with 191 additions and 37 deletions
@@ -51,4 +51,29 @@ class NewTuitionCalculatorServiceTest extends CIUnitTestCase
$this->assertSame('0.00', $result['details'][3]['amount']);
$this->assertSame('0.00', $result['details'][4]['amount']);
}
public function testYouthStudentsUseSeparateUnitPriceWithoutAffectingRegularDiscountOrder(): void
{
$service = new NewTuitionCalculatorService();
$result = $service->calculateFamilyTuition([
['student_id' => 3, 'student_name' => 'Youth', 'grade_level' => 'Youth 1'],
['student_id' => 1, 'student_name' => 'Regular One', 'grade_level' => '2'],
['student_id' => 2, 'student_name' => 'Regular Two', 'grade_level' => '5'],
], [
'grade_fee' => 9,
'new_tuition_full_amount' => '370.00',
'new_tuition_youth_amount' => '200.00',
'new_tuition_second_student_discount' => '150.00',
'new_tuition_third_student_discount' => '150.00',
'new_tuition_fourth_plus_discount' => '150.00',
]);
$this->assertSame('790.00', $result['total']);
$this->assertSame('new_first_student_full_amount', $result['details'][0]['rule']);
$this->assertSame('370.00', $result['details'][0]['amount']);
$this->assertSame('new_second_student_discount', $result['details'][1]['rule']);
$this->assertSame('220.00', $result['details'][1]['amount']);
$this->assertSame('new_youth_unit_price', $result['details'][2]['rule']);
$this->assertSame('200.00', $result['details'][2]['amount']);
}
}