From e1313fd254d0aa6d6295fefbff4f8569910cebc8 Mon Sep 17 00:00:00 2001 From: andrew-dzak Date: Sun, 16 Nov 2014 20:54:55 +0100 Subject: [PATCH] fixed MIFOSX-1655 issue with updating a loan with a charge --- .../portfolio/common/domain/DayOfWeekType.java | 5 +++++ .../portfolio/common/domain/DaysInMonthType.java | 6 +++++- .../mifosplatform/portfolio/common/domain/NthDayType.java | 5 +++++ ...anApplicationWritePlatformServiceJpaRepositoryImpl.java | 7 +++++-- 4 files changed, 20 insertions(+), 3 deletions(-) mode change 100644 => 100755 mifosng-provider/src/main/java/org/mifosplatform/portfolio/common/domain/DayOfWeekType.java mode change 100644 => 100755 mifosng-provider/src/main/java/org/mifosplatform/portfolio/common/domain/NthDayType.java mode change 100644 => 100755 mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanaccount/service/LoanApplicationWritePlatformServiceJpaRepositoryImpl.java diff --git a/mifosng-provider/src/main/java/org/mifosplatform/portfolio/common/domain/DayOfWeekType.java b/mifosng-provider/src/main/java/org/mifosplatform/portfolio/common/domain/DayOfWeekType.java old mode 100644 new mode 100755 index 30dc9d807..86548f07a --- a/mifosng-provider/src/main/java/org/mifosplatform/portfolio/common/domain/DayOfWeekType.java +++ b/mifosng-provider/src/main/java/org/mifosplatform/portfolio/common/domain/DayOfWeekType.java @@ -1,3 +1,8 @@ +/** + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this file, + * You can obtain one at http://mozilla.org/MPL/2.0/. + */ package org.mifosplatform.portfolio.common.domain; import org.joda.time.DateTimeConstants; diff --git a/mifosng-provider/src/main/java/org/mifosplatform/portfolio/common/domain/DaysInMonthType.java b/mifosng-provider/src/main/java/org/mifosplatform/portfolio/common/domain/DaysInMonthType.java index 3e5ddd0e8..a84890fc4 100755 --- a/mifosng-provider/src/main/java/org/mifosplatform/portfolio/common/domain/DaysInMonthType.java +++ b/mifosng-provider/src/main/java/org/mifosplatform/portfolio/common/domain/DaysInMonthType.java @@ -4,7 +4,11 @@ * You can obtain one at http://mozilla.org/MPL/2.0/. */ package org.mifosplatform.portfolio.common.domain; - +/** + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this file, + * You can obtain one at http://mozilla.org/MPL/2.0/. + */ import java.util.ArrayList; import java.util.List; diff --git a/mifosng-provider/src/main/java/org/mifosplatform/portfolio/common/domain/NthDayType.java b/mifosng-provider/src/main/java/org/mifosplatform/portfolio/common/domain/NthDayType.java old mode 100644 new mode 100755 index 657130278..861d3e300 --- a/mifosng-provider/src/main/java/org/mifosplatform/portfolio/common/domain/NthDayType.java +++ b/mifosng-provider/src/main/java/org/mifosplatform/portfolio/common/domain/NthDayType.java @@ -1,3 +1,8 @@ +/** + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this file, + * You can obtain one at http://mozilla.org/MPL/2.0/. + */ package org.mifosplatform.portfolio.common.domain; public enum NthDayType { diff --git a/mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanaccount/service/LoanApplicationWritePlatformServiceJpaRepositoryImpl.java b/mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanaccount/service/LoanApplicationWritePlatformServiceJpaRepositoryImpl.java old mode 100644 new mode 100755 index bd04b0fd2..e181a4fe2 --- a/mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanaccount/service/LoanApplicationWritePlatformServiceJpaRepositoryImpl.java +++ b/mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanaccount/service/LoanApplicationWritePlatformServiceJpaRepositoryImpl.java @@ -389,10 +389,13 @@ public class LoanApplicationWritePlatformServiceJpaRepositoryImpl implements Loa * If there are any charges already present, which are now not * passed in as a part of the request, deem the charges as modified **/ - if (!possiblyModifedLoanCharges.containsAll(existingCharges)) { - isChargeModified = true; + if(!possiblyModifedLoanCharges.isEmpty()){ + if (!possiblyModifedLoanCharges.containsAll(existingCharges)) { + isChargeModified = true; + } } + /** * If any new charges are added or values of existing charges are * modified