FINERACT-1840: Minor fix to avoid business logic collision

This commit is contained in:
Adam Saghy
2023-02-07 14:41:21 +01:00
parent 395b7057cf
commit e456aa6c65
@@ -3509,7 +3509,11 @@ public class Loan extends AbstractAuditableWithUTCDateTimeCustom {
public void applyIncomeAccrualTransaction(LocalDate closedDate) {
ExternalId externalId = ExternalId.empty();
boolean isExternalIdAutoGenerationEnabled = TemporaryConfigurationServiceContainer.isExternalIdAutoGenerationEnabled();
if (isPeriodicAccrualAccountingEnabledOnLoanProduct()) {
if (isPeriodicAccrualAccountingEnabledOnLoanProduct()
// to avoid collision with processIncomeAccrualTransactionOnLoanClosure()
// TODO: review after interest calculation implemented
&& !(this.loanInterestRecalculationDetails != null
&& this.loanInterestRecalculationDetails.isCompoundingToBePostedAsTransaction())) {
List<LoanTransaction> updatedAccrualTransactions = retrieveListOfAccrualTransactions();
LocalDate lastAccruedDate = this.getDisbursementDate();
if (!updatedAccrualTransactions.isEmpty()) {