use of org.mifos.application.meeting.util.helpers.MeetingType in project head by mifos.
the class TestObjectFactory method createLoanMeeting.
public static MeetingBO createLoanMeeting(final MeetingBO customerMeeting) {
MeetingBO meetingToReturn = null;
try {
RecurrenceType recurrenceType = RecurrenceType.fromInt(customerMeeting.getMeetingDetails().getRecurrenceType().getRecurrenceId());
MeetingType meetingType = MeetingType.fromInt(customerMeeting.getMeetingType().getMeetingTypeId());
Short recurAfter = customerMeeting.getMeetingDetails().getRecurAfter();
if (recurrenceType.equals(RecurrenceType.MONTHLY)) {
if (customerMeeting.isMonthlyOnDate()) {
meetingToReturn = new MeetingBO(customerMeeting.getMeetingDetails().getMeetingRecurrence().getDayNumber(), recurAfter, customerMeeting.getMeetingStartDate(), meetingType, "meetingPlace");
} else {
meetingToReturn = new MeetingBO(customerMeeting.getMeetingDetails().getWeekDay(), customerMeeting.getMeetingDetails().getWeekRank(), recurAfter, customerMeeting.getMeetingStartDate(), meetingType, "meetingPlace");
}
} else if (recurrenceType.equals(RecurrenceType.WEEKLY)) {
meetingToReturn = new MeetingBO(WeekDay.getWeekDay(customerMeeting.getMeetingDetails().getMeetingRecurrence().getWeekDayValue().getValue()), recurAfter, customerMeeting.getMeetingStartDate(), meetingType, "meetingPlace");
} else {
meetingToReturn = new MeetingBO(recurrenceType, recurAfter, customerMeeting.getMeetingStartDate(), meetingType);
}
meetingToReturn.setMeetingPlace(customerMeeting.getMeetingPlace());
} catch (MeetingException e) {
throw new RuntimeException(e);
}
return meetingToReturn;
}
use of org.mifos.application.meeting.util.helpers.MeetingType in project head by mifos.
the class LoanBO method buildLoanMeeting.
private MeetingBO buildLoanMeeting(final MeetingBO customerMeeting, final MeetingBO loanOfferingMeeting, final Date disbursementDate) throws AccountException {
// this is called from 'proper constructor' only if LSIM is disabled
if (customerMeeting != null && loanOfferingMeeting != null && customerMeeting.hasSameRecurrenceAs(loanOfferingMeeting) && customerMeeting.recursOnMultipleOf(loanOfferingMeeting)) {
RecurrenceType meetingFrequency = customerMeeting.getMeetingDetails().getRecurrenceTypeEnum();
MeetingType meetingType = MeetingType.fromInt(customerMeeting.getMeetingType().getMeetingTypeId());
Short recurAfter = loanOfferingMeeting.getMeetingDetails().getRecurAfter();
try {
MeetingBO meetingToReturn;
if (meetingFrequency.equals(RecurrenceType.MONTHLY)) {
if (customerMeeting.isMonthlyOnDate()) {
meetingToReturn = new MeetingBO(customerMeeting.getMeetingDetails().getDayNumber(), recurAfter, disbursementDate, meetingType, customerMeeting.getMeetingPlace());
} else {
meetingToReturn = new MeetingBO(customerMeeting.getMeetingDetails().getWeekDay(), customerMeeting.getMeetingDetails().getWeekRank(), recurAfter, disbursementDate, meetingType, customerMeeting.getMeetingPlace());
}
} else if (meetingFrequency.equals(RecurrenceType.WEEKLY)) {
meetingToReturn = new MeetingBO(customerMeeting.getMeetingDetails().getMeetingRecurrence().getWeekDayValue(), recurAfter, disbursementDate, meetingType, customerMeeting.getMeetingPlace());
} else {
meetingToReturn = new MeetingBO(meetingFrequency, recurAfter, disbursementDate, meetingType);
}
return meetingToReturn;
} catch (MeetingException me) {
throw new AccountException(me);
}
}
throw new AccountException(AccountExceptionConstants.CHANGEINLOANMEETING);
}
Aggregations