fix the enrollement-carryover balance
Deploy to Shared Hosting / Shared hosting deploy (push) Failing after 49s
Tests / PHPUnit (push) Successful in 1m21s

This commit is contained in:
root
2026-09-09 21:40:01 -04:00
parent 2d5b151234
commit 36e8ffe56d
12 changed files with 1365 additions and 39 deletions
@@ -81,6 +81,26 @@ class InvoiceLedgerServiceHarness extends InvoiceLedgerService
class InvoiceLedgerServiceTest extends CIUnitTestCase
{
public function testLegacyNegativeAdditionalChargeKeepsItsMinusSignWithoutAType(): void
{
$this->assertSame(-110.0, InvoiceLedgerService::signedAdditionalChargeAmount([
'charge_type' => '',
'amount' => '-110.00',
]));
}
public function testTypedDeductionAndPositiveChargeAreNormalizedCorrectly(): void
{
$this->assertSame(-25.0, InvoiceLedgerService::signedAdditionalChargeAmount([
'charge_type' => 'deduct',
'amount' => '25.00',
]));
$this->assertSame(22.0, InvoiceLedgerService::signedAdditionalChargeAmount([
'charge_type' => '',
'amount' => '22.00',
]));
}
public function testInvoiceWithNoPaymentHasFullBalanceDue(): void
{
$service = new InvoiceLedgerServiceHarness([