From 4e53e3b94d2d397a22fde1c1dfcd7168c2950de2 Mon Sep 17 00:00:00 2001 From: Vishwas Babu A J Date: Thu, 5 Jun 2014 14:39:25 -0700 Subject: [PATCH] changing visibility of lockinPeriodFrequencyTypeValue variable in DepositAccountAssembler --- .../domain/DepositAccountAssembler.java | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/mifosng-provider/src/main/java/org/mifosplatform/portfolio/savings/domain/DepositAccountAssembler.java b/mifosng-provider/src/main/java/org/mifosplatform/portfolio/savings/domain/DepositAccountAssembler.java index 6c5050018..d4d7f2c41 100644 --- a/mifosng-provider/src/main/java/org/mifosplatform/portfolio/savings/domain/DepositAccountAssembler.java +++ b/mifosng-provider/src/main/java/org/mifosplatform/portfolio/savings/domain/DepositAccountAssembler.java @@ -239,8 +239,9 @@ public class DepositAccountAssembler { } SavingsPeriodFrequencyType lockinPeriodFrequencyType = null; - Integer lockinPeriodFrequencyTypeValue = null; + if (command.parameterExists(lockinPeriodFrequencyTypeParamName)) { + Integer lockinPeriodFrequencyTypeValue = null; lockinPeriodFrequencyTypeValue = command.integerValueOfParameterNamed(lockinPeriodFrequencyTypeParamName); if (lockinPeriodFrequencyTypeValue != null) { lockinPeriodFrequencyType = SavingsPeriodFrequencyType.fromInt(lockinPeriodFrequencyTypeValue); @@ -297,8 +298,8 @@ public class DepositAccountAssembler { RecurringDepositAccount rdAccount = RecurringDepositAccount.createNewApplicationForSubmittal(client, group, product, fieldOfficer, accountNo, externalId, accountType, submittedOnDate, submittedBy, interestRate, interestCompoundingPeriodType, interestPostingPeriodType, interestCalculationType, interestCalculationDaysInYearType, - minRequiredOpeningBalance, lockinPeriodFrequency, lockinPeriodFrequencyType, - iswithdrawalFeeApplicableForTransfer, charges, accountTermAndPreClosure, accountRecurringDetail, accountChart); + minRequiredOpeningBalance, lockinPeriodFrequency, lockinPeriodFrequencyType, iswithdrawalFeeApplicableForTransfer, + charges, accountTermAndPreClosure, accountRecurringDetail, accountChart); accountTermAndPreClosure.updateAccountReference(rdAccount); accountRecurringDetail.updateAccountReference(rdAccount); @@ -400,8 +401,8 @@ public class DepositAccountAssembler { depositRecurringDetail, null, isCalendarInherited); return depositAccountRecurringDetail; } - - public Collection assembleBulkMandatorySavingsAccountTransactionDTOs(final JsonCommand command){ + + public Collection assembleBulkMandatorySavingsAccountTransactionDTOs(final JsonCommand command) { final String json = command.json(); if (StringUtils.isBlank(json)) { throw new InvalidJsonException(); } final JsonElement element = this.fromApiJsonHelper.parse(json); @@ -412,7 +413,7 @@ public class DepositAccountAssembler { final JsonObject topLevelJsonElement = element.getAsJsonObject(); final Locale locale = this.fromApiJsonHelper.extractLocaleParameter(topLevelJsonElement); final DateTimeFormatter formatter = DateTimeFormat.forPattern(dateFormat).withLocale(locale); - + if (element.isJsonObject()) { if (topLevelJsonElement.has(bulkSavingsDueTransactionsParamName) && topLevelJsonElement.get(bulkSavingsDueTransactionsParamName).isJsonArray()) { @@ -423,12 +424,13 @@ public class DepositAccountAssembler { final Long savingsId = this.fromApiJsonHelper.extractLongNamed(savingsIdParamName, savingsTransactionElement); final BigDecimal dueAmount = this.fromApiJsonHelper.extractBigDecimalNamed(transactionAmountParamName, savingsTransactionElement, locale); - final SavingsAccountTransactionDTO savingsAccountTransactionDTO = new SavingsAccountTransactionDTO(formatter, transactionDate, dueAmount, paymentDetail, new Date(), savingsId); + final SavingsAccountTransactionDTO savingsAccountTransactionDTO = new SavingsAccountTransactionDTO(formatter, + transactionDate, dueAmount, paymentDetail, new Date(), savingsId); savingsAccountTransactions.add(savingsAccountTransactionDTO); } } } - + return savingsAccountTransactions; } } \ No newline at end of file