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

avikg 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 d0cadc6  [FINERACT-1401]-double-posting-on-closing-fixed-deposit 
(#1885)
d0cadc6 is described below

commit d0cadc6ac9e8e1b3e7ce99cc6b7c5c52b2753f92
Author: Manoj <56669674+fynma...@users.noreply.github.com>
AuthorDate: Sat Oct 2 21:38:35 2021 +0530

    [FINERACT-1401]-double-posting-on-closing-fixed-deposit (#1885)
---
 .../portfolio/savings/domain/DepositAccountDomainServiceJpa.java       | 3 +--
 .../java/org/apache/fineract/integrationtests/FixedDepositTest.java    | 2 ++
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git 
a/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/domain/DepositAccountDomainServiceJpa.java
 
b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/domain/DepositAccountDomainServiceJpa.java
index 4a23738..62c9f7a 100644
--- 
a/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/domain/DepositAccountDomainServiceJpa.java
+++ 
b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/domain/DepositAccountDomainServiceJpa.java
@@ -248,6 +248,7 @@ public class DepositAccountDomainServiceJpa implements 
DepositAccountDomainServi
                     isAccountTransfer, isExceptionForBalanceCheck);
             
this.accountTransfersWritePlatformService.transferFunds(accountTransferDTO);
             updateAlreadyPostedTransactions(existingTransactionIds, account);
+            postJournalEntries(account, existingTransactionIds, 
existingReversedTransactionIds, isAccountTransfer);
         } else {
             final SavingsAccountTransaction withdrawal = 
this.handleWithdrawal(account, fmt, closedDate, account.getAccountBalance(),
                     paymentDetail, false, isRegularTransaction);
@@ -257,8 +258,6 @@ public class DepositAccountDomainServiceJpa implements 
DepositAccountDomainServi
         account.close(user, command, tenantsTodayDate, changes);
         this.savingsAccountRepository.save(account);
 
-        postJournalEntries(account, existingTransactionIds, 
existingReversedTransactionIds, isAccountTransfer);
-
         return savingsTransactionId;
     }
 
diff --git 
a/integration-tests/src/test/java/org/apache/fineract/integrationtests/FixedDepositTest.java
 
b/integration-tests/src/test/java/org/apache/fineract/integrationtests/FixedDepositTest.java
index 0ccbc2c..8e3be1b 100644
--- 
a/integration-tests/src/test/java/org/apache/fineract/integrationtests/FixedDepositTest.java
+++ 
b/integration-tests/src/test/java/org/apache/fineract/integrationtests/FixedDepositTest.java
@@ -1487,6 +1487,8 @@ public class FixedDepositTest {
         principal += interestPerMonth;
         LOG.info("principal = {}", principal);
 
+        Integer transactionIdForPostInterest = 
this.fixedDepositAccountHelper.postInterestForFixedDeposit(fixedDepositAccountId);
+
         
this.fixedDepositAccountHelper.calculatePrematureAmountForFixedDeposit(fixedDepositAccountId,
 CLOSED_ON_DATE);
 
         Integer prematureClosureTransactionId = (Integer) 
this.fixedDepositAccountHelper.prematureCloseForFixedDeposit(

Reply via email to