Fix for client activation withing a group and JLG loan 500 error

This commit is contained in:
Nayan
2014-11-13 09:50:13 +05:30
parent b27e0a9581
commit 8758d6f669
2 changed files with 2 additions and 4 deletions
@@ -581,7 +581,7 @@ public class ClientWritePlatformServiceJpaRepositoryImpl implements ClientWriteP
private void validateParentGroupRulesBeforeClientActivation(Client client) { private void validateParentGroupRulesBeforeClientActivation(Client client) {
Integer minNumberOfClients = configurationDomainService.retrieveMinAllowedClientsInGroup(); Integer minNumberOfClients = configurationDomainService.retrieveMinAllowedClientsInGroup();
Integer maxNumberOfClients = configurationDomainService.retrieveMaxAllowedClientsInGroup(); Integer maxNumberOfClients = configurationDomainService.retrieveMaxAllowedClientsInGroup();
if (client.getGroups() != null) { if (client.getGroups() != null && maxNumberOfClients != null) {
for (Group group : client.getGroups()) { for (Group group : client.getGroups()) {
/** /**
* Since this Client has not yet been associated with the group, * Since this Client has not yet been associated with the group,
@@ -181,14 +181,12 @@ public class LoanScheduleAssembler {
* be either same frequency or loan freq is multiple of center/group * be either same frequency or loan freq is multiple of center/group
* meeting freq multiples * meeting freq multiples
*/ */
if (loanType.isJLGAccount()) { if (loanType.isJLGAccount() && calendarId != null ) {
if ((synchDisbursement != null && synchDisbursement.booleanValue())) {
calendar = this.calendarRepository.findOne(calendarId); calendar = this.calendarRepository.findOne(calendarId);
if (calendar == null) { throw new CalendarNotFoundException(calendarId); } if (calendar == null) { throw new CalendarNotFoundException(calendarId); }
final PeriodFrequencyType meetingPeriodFrequency = CalendarUtils.getMeetingPeriodFrequencyType(calendar.getRecurrence()); final PeriodFrequencyType meetingPeriodFrequency = CalendarUtils.getMeetingPeriodFrequencyType(calendar.getRecurrence());
validateRepaymentFrequencyIsSameAsMeetingFrequency(meetingPeriodFrequency.getValue(), repaymentFrequencyType, validateRepaymentFrequencyIsSameAsMeetingFrequency(meetingPeriodFrequency.getValue(), repaymentFrequencyType,
CalendarUtils.getInterval(calendar.getRecurrence()), repaymentEvery); CalendarUtils.getInterval(calendar.getRecurrence()), repaymentEvery);
}
} }
/* /*