Details
-
Bug
-
Status: Open
-
Major
-
Resolution: Unresolved
-
1.10.0
-
None
-
None
-
Patch, Important
Description
When applying the final income accruals on a loan that has been fully repaid in advance, if there are more than a single fee charge on an instalment, an error is thrown.
"Meltdown in advanced accounting...sum of all charges is not equal to the fee charge for a transaction",
This is quite a serious bug as it prevents a loan from being closed. It occurs when the final amount payable is repaid
The cause of this is an incorrect calculation of the amount already accrued for charges in LoanAccountDomainServiceJpa.applyFinalIncomeAccrualTransaction.
When calculating the amount accrued for a charge, the amount of the LoanTransaction associated with the charge is summed, rather than the amount of the LoanChargePaidBy. This produces in an incorrect calculation which results in the "Meltdown in advanced accounting" exception being shown.
The correct calculation is to sum the amount of the LoanChargePaidBy rather than summing the amount of the LoanTransaction associated with the LoanChargePaidBy.
Very simple fix - patch attached
Steps to reproduce
Create a loan
Add multiple instalment charges
Accrue the loan for a few months
Prepay the loan for the full amount remaining.