From 6683e0e9ca74795ff9ee6139faa27e1cf0df9b16 Mon Sep 17 00:00:00 2001 From: goutham-M Date: Fri, 31 May 2013 17:22:58 +0530 Subject: [PATCH] updating annual fee amount in savings product(exception) fixed --- .../mifosplatform/infrastructure/core/api/JsonCommand.java | 6 +++++- .../portfolio/savings/domain/SavingsProduct.java | 4 ++-- 2 files changed, 7 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..42062031c 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 @@ -191,7 +191,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..115e11f5b 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 @@ -353,7 +353,7 @@ public class SavingsProduct extends AbstractPersistable { if (command.isChangeInIntegerParameterNamed(annualFeeOnMonthDayParamName, this.annualFeeOnDay)) { final MonthDay monthDay = command.extractMonthDayNamed(annualFeeOnMonthDayParamName); final String actualValueEntered = command.stringValueOfParameterNamed(annualFeeOnMonthDayParamName); - final Integer newValue = monthDay.getDayOfMonth(); + final Integer newValue = monthDay != null? monthDay.getDayOfMonth(): null; actualChanges.put(annualFeeOnMonthDayParamName, actualValueEntered); actualChanges.put(localeParamName, localeAsInput); this.annualFeeOnDay = newValue; @@ -362,7 +362,7 @@ public class SavingsProduct extends AbstractPersistable { if (command.isChangeInIntegerParameterNamed(annualFeeOnMonthDayParamName, this.annualFeeOnMonth)) { final MonthDay monthDay = command.extractMonthDayNamed(annualFeeOnMonthDayParamName); final String actualValueEntered = command.stringValueOfParameterNamed(annualFeeOnMonthDayParamName); - final Integer newValue = monthDay.getMonthOfYear(); + final Integer newValue = monthDay != null? monthDay.getMonthOfYear(): null; actualChanges.put(annualFeeOnMonthDayParamName, actualValueEntered); actualChanges.put(localeParamName, localeAsInput); this.annualFeeOnMonth = newValue;