From 4b53161ac40cea9c43051b8a932012e5c0087245 Mon Sep 17 00:00:00 2001 From: ashok-conflux Date: Mon, 1 Apr 2013 17:06:09 +0530 Subject: [PATCH] Fixed MIFOSX-278 and MIFOSX-280 --- .../mifosplatform/portfolio/loanaccount/domain/Loan.java | 9 ++++++--- .../CalculateLoanScheduleQueryFromApiJsonHelper.java | 2 +- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanaccount/domain/Loan.java b/mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanaccount/domain/Loan.java index dfc2fc2cb..8fb3dacc5 100644 --- a/mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanaccount/domain/Loan.java +++ b/mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanaccount/domain/Loan.java @@ -810,9 +810,12 @@ public class Loan extends AbstractPersistable { } final String clientIdParamName = "clientId"; - if (command.isChangeInLongParameterNamed(clientIdParamName, this.client.getId())) { - final Long newValue = command.longValueOfParameterNamed(clientIdParamName); - actualChanges.put(clientIdParamName, newValue); + //FIXME AA : Client is null for group loans. Group loan modifications require group validation. + if (this.client != null) { + if (command.isChangeInLongParameterNamed(clientIdParamName, this.client.getId())) { + final Long newValue = command.longValueOfParameterNamed(clientIdParamName); + actualChanges.put(clientIdParamName, newValue); + } } final String productIdParamName = "productId"; diff --git a/mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanaccount/serialization/CalculateLoanScheduleQueryFromApiJsonHelper.java b/mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanaccount/serialization/CalculateLoanScheduleQueryFromApiJsonHelper.java index d3bddd2fb..960662b63 100644 --- a/mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanaccount/serialization/CalculateLoanScheduleQueryFromApiJsonHelper.java +++ b/mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanaccount/serialization/CalculateLoanScheduleQueryFromApiJsonHelper.java @@ -36,7 +36,7 @@ public final class CalculateLoanScheduleQueryFromApiJsonHelper { /** * The parameters supported for this command. */ - final Set supportedParameters = new HashSet(Arrays.asList("id", "clientId", "groupId", "productId", "accountNo", + final Set supportedParameters = new HashSet(Arrays.asList("id", "clientId", "groupId", "calendarId", "productId", "accountNo", "externalId", "fundId", "loanOfficerId", "loanPurposeId", "transactionProcessingStrategyId", "principal", "inArrearsTolerance", "interestRatePerPeriod", "repaymentEvery", "numberOfRepayments", "loanTermFrequency", "loanTermFrequencyType", "repaymentFrequencyType", "interestRateFrequencyType", "amortizationType", "interestType", "interestCalculationPeriodType",