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
@@ -65,6 +65,7 @@ class FakeForecastService extends TuitionForecastService
'include_event_only' => $options['include_event_only'] ?? '0',
'include_paid_invoices' => $options['include_paid_invoices'] ?? '0',
'unit_price' => $options['unit_price'] ?? '370.00',
'youth_unit_price' => $options['youth_unit_price'] ?? '200.00',
],
'summary' => [
'family_count' => 1,
@@ -75,6 +76,7 @@ class FakeForecastService extends TuitionForecastService
'old_projected_income' => '550.00',
'new_projected_income' => '650.00',
'unit_price' => '370.00',
'youth_unit_price' => '200.00',
'difference' => '100.00',
],
'families' => [[
@@ -160,6 +162,7 @@ class TuitionForecastControllerTest extends CIUnitTestCase
'include_event_only' => '1',
'include_paid_invoices' => '1',
'unit_price' => '395.00',
'youth_unit_price' => '200.00',
]);
$result = $this->controller->setRequestObject($request)->index();
@@ -170,6 +173,7 @@ class TuitionForecastControllerTest extends CIUnitTestCase
$this->assertSame('new', $result['data']['filters']['calculator_mode']);
$this->assertSame('1', $result['data']['filters']['include_payment_pending']);
$this->assertSame('395.00', $result['data']['filters']['unit_price']);
$this->assertSame('200.00', $result['data']['filters']['youth_unit_price']);
$this->assertSame('always', $this->service->calls[0]['options']['include_withdrawn_mode']);
}
@@ -184,6 +188,7 @@ class TuitionForecastControllerTest extends CIUnitTestCase
'include_event_only' => '0',
'include_paid_invoices' => '1',
'unit_price' => '390.00',
'youth_unit_price' => '210.00',
]);
$response = $this->controller->setRequestObject($request)->calculate();
@@ -193,6 +198,7 @@ class TuitionForecastControllerTest extends CIUnitTestCase
$this->assertSame('Fall', $payload['semester']);
$this->assertSame('compare', $payload['calculator_mode']);
$this->assertSame('390.00', $payload['options']['unit_price']);
$this->assertSame('210.00', $payload['options']['youth_unit_price']);
}
public function testExportCsvBuildsDownloadWithSummaryAndFamilyRows(): void
@@ -210,6 +216,7 @@ class TuitionForecastControllerTest extends CIUnitTestCase
$this->assertStringContainsString('Summary', $body);
$this->assertStringContainsString('All Year', $body);
$this->assertStringContainsString('Old Projected Income', $body);
$this->assertStringContainsString('Youth Unit Price', $body);
$this->assertStringContainsString('Layla Yusuf', $body);
$this->assertStringContainsString('Student One', $body);
}