From 7da550fe7cb5c594d37af396a112ce2ed9eb2967 Mon Sep 17 00:00:00 2001 From: Pramod Nuthakki Date: Wed, 17 Sep 2014 13:23:13 +0530 Subject: [PATCH] MIFOSX-1535 : added condition to set the default value --- .../domain/LoanProductInterestRecalculationDetails.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanproduct/domain/LoanProductInterestRecalculationDetails.java b/mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanproduct/domain/LoanProductInterestRecalculationDetails.java index 97de3bd5c..dd8817c46 100644 --- a/mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanproduct/domain/LoanProductInterestRecalculationDetails.java +++ b/mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanproduct/domain/LoanProductInterestRecalculationDetails.java @@ -78,12 +78,13 @@ public class LoanProductInterestRecalculationDetails extends AbstractPersistable RecalculationFrequencyType frequencyType = RecalculationFrequencyType.fromInt(recurrenceFrequency); Date recurrenceOnDate = null; if (recurrenceOnLocalDate != null) { - if (frequencyType.isSameAsRepayment()) { - recurrenceInterval = 0; - } else { + if (!frequencyType.isSameAsRepayment()) { recurrenceOnDate = recurrenceOnLocalDate.toDate(); } } + if (frequencyType.isSameAsRepayment()) { + recurrenceInterval = 0; + } return new LoanProductInterestRecalculationDetails(interestRecalculationCompoundingMethod, loanRescheduleStrategyMethod, recurrenceFrequency, recurrenceInterval, recurrenceOnDate);