From 4dbd0cf7fdcef2f55918f8f56b578b517a53f232 Mon Sep 17 00:00:00 2001 From: goutham-M Date: Fri, 31 May 2013 19:32:30 +0530 Subject: [PATCH] updating withdraw fee in saving product(exception) fixed --- .../mifosplatform/infrastructure/core/api/JsonCommand.java | 6 +++++- .../portfolio/savings/domain/SavingsProduct.java | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/mifosng-provider/src/main/java/org/mifosplatform/infrastructure/core/api/JsonCommand.java b/mifosng-provider/src/main/java/org/mifosplatform/infrastructure/core/api/JsonCommand.java index cd38457fa..60e21761f 100644 --- a/mifosng-provider/src/main/java/org/mifosplatform/infrastructure/core/api/JsonCommand.java +++ b/mifosng-provider/src/main/java/org/mifosplatform/infrastructure/core/api/JsonCommand.java @@ -187,7 +187,11 @@ public final class JsonCommand { boolean differenceExists = false; if (baseValue != null) { - differenceExists = !baseValue.equals(workingCopyValue); + if(workingCopyValue != null) { + differenceExists = !baseValue.equals(workingCopyValue); + } else { + differenceExists = true; + } } else { differenceExists = workingCopyValue != null; } diff --git a/mifosng-provider/src/main/java/org/mifosplatform/portfolio/savings/domain/SavingsProduct.java b/mifosng-provider/src/main/java/org/mifosplatform/portfolio/savings/domain/SavingsProduct.java index 115e11f5b..cf19db5b0 100644 --- a/mifosng-provider/src/main/java/org/mifosplatform/portfolio/savings/domain/SavingsProduct.java +++ b/mifosng-provider/src/main/java/org/mifosplatform/portfolio/savings/domain/SavingsProduct.java @@ -340,7 +340,7 @@ public class SavingsProduct extends AbstractPersistable { if (command.isChangeInIntegerParameterNamed(withdrawalFeeTypeParamName, this.withdrawalFeeType)) { final Integer newValue = command.integerValueOfParameterNamed(withdrawalFeeTypeParamName); actualChanges.put(withdrawalFeeTypeParamName, newValue); - this.withdrawalFeeType = SavingsWithdrawalFeesType.fromInt(newValue).getValue(); + this.withdrawalFeeType = newValue != null? SavingsWithdrawalFeesType.fromInt(newValue).getValue(): newValue; } if (command.isChangeInBigDecimalParameterNamed(annualFeeAmountParamName, this.annualFeeAmount)) {