FINERACT-2228: Fix incorrect current balance calculation and unintentional transaction reversals

This commit is contained in:
Adam Saghy
2025-04-01 08:50:14 +02:00
parent b7845166c4
commit 833f4a0d33
9 changed files with 202 additions and 49 deletions
@@ -302,7 +302,7 @@ public class LoanChargeWritePlatformServiceImpl implements LoanChargeWritePlatfo
} else {
reprocessLoanTransactionsService.reprocessTransactions(loan);
}
loan.doPostLoanTransactionChecks(transactionDate, loan.getLoanLifecycleStateMachine());
loan = loanAccountService.saveAndFlushLoanWithDataIntegrityViolationChecks(loan);
}
@@ -184,8 +184,8 @@ public class LoanAdjustmentServiceImpl implements LoanAdjustmentService {
if (!transactionIds.isEmpty()) {
this.accountTransfersWritePlatformService.reverseTransfersWithFromAccountTransactions(transactionIds,
PortfolioAccountType.LOAN);
loan.updateLoanSummaryAndStatus();
}
loan.updateLoanSummaryAndStatus();
loanAccrualsProcessingService.processAccrualsOnInterestRecalculation(loan, loan.isInterestBearingAndInterestRecalculationEnabled(),
false);
@@ -267,8 +267,6 @@ public class LoanAdjustmentServiceImpl implements LoanAdjustmentService {
writeOffTransaction.reverse();
}
loan.updateLoanSummaryAndStatus();
if (newTransactionDetail.isRepaymentLikeType() || newTransactionDetail.isInterestWaiver()) {
loanDownPaymentHandlerService.handleRepaymentOrRecoveryOrWaiverTransaction(loan, newTransactionDetail,
loanLifecycleStateMachine, transactionForAdjustment, scheduleGeneratorDTO);