From bc41c5894746e1dd6782609394eb6dec8bd85aa0 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 --- .../infrastructure/core/api/JsonCommand.java | 12 ++++++++++-- .../portfolio/savings/domain/SavingsProduct.java | 2 +- 2 files changed, 11 insertions(+), 3 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 b174ced3e..ee1248975 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 @@ -179,7 +179,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; } @@ -191,7 +195,11 @@ public final class JsonCommand { boolean differenceExists = false; if (baseValue != null) { - differenceExists = baseValue.compareTo(workingCopyValue) != 0; + if(workingCopyValue != null) { + differenceExists = baseValue.compareTo(workingCopyValue) != 0; + }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 a6e8297fd..352c2c462 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)) {