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

arnold 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 f574ea765 FINERACT-1724: Fix loan status change bug at the event of 
transaction replay
f574ea765 is described below

commit f574ea765949e6ca30480e4462174c49c650aae6
Author: Adam Saghy <[email protected]>
AuthorDate: Tue Jan 17 17:10:51 2023 +0100

    FINERACT-1724: Fix loan status change bug at the event of transaction replay
---
 .../java/org/apache/fineract/portfolio/loanaccount/domain/Loan.java   | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

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 2902c0222..6d883595a 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
@@ -3202,8 +3202,6 @@ public class Loan extends 
AbstractAuditableWithUTCDateTimeCustom {
 
         if (loanTransaction.isRecoveryRepayment()) {
             
loanLifecycleStateMachine.transition(LoanEvent.LOAN_RECOVERY_PAYMENT, this);
-        } else {
-            
loanLifecycleStateMachine.transition(LoanEvent.LOAN_REPAYMENT_OR_WAIVER, this);
         }
 
         if (loanTransaction.isRecoveryRepayment()
@@ -3433,6 +3431,8 @@ public class Loan extends 
AbstractAuditableWithUTCDateTimeCustom {
         } else if (this.summary.isRepaidInFull(loanCurrency())) {
             handleLoanRepaymentInFull(transactionDate, 
loanLifecycleStateMachine);
             statusChanged = true;
+        } else {
+            
loanLifecycleStateMachine.transition(LoanEvent.LOAN_REPAYMENT_OR_WAIVER, this);
         }
         if (this.totalOverpaid == null || 
BigDecimal.ZERO.compareTo(this.totalOverpaid) == 0) {
             this.overpaidOnDate = null;

Reply via email to