fix the enrollement-carryover balance
This commit is contained in:
@@ -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([
|
||||
|
||||
Reference in New Issue
Block a user