From 8758d6f669b1587086054c5cd06da9fcd32285c1 Mon Sep 17 00:00:00 2001 From: Nayan Date: Thu, 13 Nov 2014 09:50:13 +0530 Subject: [PATCH] Fix for client activation withing a group and JLG loan 500 error --- .../service/ClientWritePlatformServiceJpaRepositoryImpl.java | 2 +- .../loanschedule/service/LoanScheduleAssembler.java | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/mifosng-provider/src/main/java/org/mifosplatform/portfolio/client/service/ClientWritePlatformServiceJpaRepositoryImpl.java b/mifosng-provider/src/main/java/org/mifosplatform/portfolio/client/service/ClientWritePlatformServiceJpaRepositoryImpl.java index 8eb501644..cfe532718 100644 --- a/mifosng-provider/src/main/java/org/mifosplatform/portfolio/client/service/ClientWritePlatformServiceJpaRepositoryImpl.java +++ b/mifosng-provider/src/main/java/org/mifosplatform/portfolio/client/service/ClientWritePlatformServiceJpaRepositoryImpl.java @@ -581,7 +581,7 @@ public class ClientWritePlatformServiceJpaRepositoryImpl implements ClientWriteP private void validateParentGroupRulesBeforeClientActivation(Client client) { Integer minNumberOfClients = configurationDomainService.retrieveMinAllowedClientsInGroup(); Integer maxNumberOfClients = configurationDomainService.retrieveMaxAllowedClientsInGroup(); - if (client.getGroups() != null) { + if (client.getGroups() != null && maxNumberOfClients != null) { for (Group group : client.getGroups()) { /** * Since this Client has not yet been associated with the group, diff --git a/mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanaccount/loanschedule/service/LoanScheduleAssembler.java b/mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanaccount/loanschedule/service/LoanScheduleAssembler.java index 4c2b75edf..2da7e93a2 100644 --- a/mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanaccount/loanschedule/service/LoanScheduleAssembler.java +++ b/mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanaccount/loanschedule/service/LoanScheduleAssembler.java @@ -181,14 +181,12 @@ public class LoanScheduleAssembler { * be either same frequency or loan freq is multiple of center/group * meeting freq multiples */ - if (loanType.isJLGAccount()) { - if ((synchDisbursement != null && synchDisbursement.booleanValue())) { + if (loanType.isJLGAccount() && calendarId != null ) { calendar = this.calendarRepository.findOne(calendarId); if (calendar == null) { throw new CalendarNotFoundException(calendarId); } final PeriodFrequencyType meetingPeriodFrequency = CalendarUtils.getMeetingPeriodFrequencyType(calendar.getRecurrence()); validateRepaymentFrequencyIsSameAsMeetingFrequency(meetingPeriodFrequency.getValue(), repaymentFrequencyType, CalendarUtils.getInterval(calendar.getRecurrence()), repaymentEvery); - } } /*