You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@fineract.apache.org by ad...@apache.org on 2023/02/07 13:41:28 UTC

[fineract] branch develop updated: FINERACT-1840: Minor fix to avoid business logic collision

This is an automated email from the ASF dual-hosted git repository.

adamsaghy pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/fineract.git


The following commit(s) were added to refs/heads/develop by this push:
     new e456aa6c6 FINERACT-1840: Minor fix to avoid business logic collision
e456aa6c6 is described below

commit e456aa6c659c85280ab5fb66d86ccaf762d7d982
Author: Adam Saghy <ad...@gmail.com>
AuthorDate: Tue Feb 7 10:43:24 2023 +0100

    FINERACT-1840: Minor fix to avoid business logic collision
---
 .../java/org/apache/fineract/portfolio/loanaccount/domain/Loan.java | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/Loan.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/Loan.java
index a1307afc2..3e443586c 100644
--- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/Loan.java
+++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/Loan.java
@@ -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()) {