From 5d1a32e6f8804b5237a65c390adc735f43e574b8 Mon Sep 17 00:00:00 2001 From: satish-conflux Date: Thu, 16 Feb 2017 16:01:39 +0530 Subject: [PATCH] FINERACT-377 : Reinvesting Recurring Deposit is taking present date in stead of maturity date --- .../savings/domain/RecurringDepositAccount.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/domain/RecurringDepositAccount.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/domain/RecurringDepositAccount.java index d5dbc5bd5..76668a4e4 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/domain/RecurringDepositAccount.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/domain/RecurringDepositAccount.java @@ -600,6 +600,7 @@ public class RecurringDepositAccount extends SavingsAccount { if (interestPostingUpToDate == null) { interestPostingUpToDate = closeDate; } + this.setClosedOnDate(closeDate); final MathContext mc = MathContext.DECIMAL64; boolean isInterestTransfer = false; LocalDate postInterestOnDate = null; @@ -642,7 +643,6 @@ public class RecurringDepositAccount extends SavingsAccount { // correct. recalculateDailyBalances(Money.zero(this.currency), interestPostingUpToDate); } - this.summary.updateSummary(this.currency, this.savingsAccountTransactionSummaryWrapper, this.transactions); } @@ -1083,8 +1083,7 @@ public class RecurringDepositAccount extends SavingsAccount { final Integer lockinPeriodFrequency = this.lockinPeriodFrequency; final boolean withdrawalFeeApplicableForTransfer = false; - LocalDate now = DateUtils.getLocalDateOfTenant(); - + LocalDate now = getClosedOnDate(); newAccountTermAndPreClosure.updateExpectedFirstDepositDate(now); RecurringDepositAccount rdAccount = RecurringDepositAccount.createNewActivatedAccount(client, group, product, savingsOfficer, @@ -1120,6 +1119,10 @@ public class RecurringDepositAccount extends SavingsAccount { this.activatedOnDate = now.toDate(); } + + public void setClosedOnDate(final LocalDate closedOnDate) { + this.closedOnDate = closedOnDate.toDate(); + } @Override protected boolean isTransferInterestToOtherAccount() {