Search in sources :

Example 11 with WeekDay

use of org.mifos.application.meeting.util.helpers.WeekDay in project head by mifos.

the class ViewOrganizationSettingsServiceFacadeWebTier method getWorkingDays.

private String getWorkingDays() {
    List<WeekDay> workDaysList = new FiscalCalendarRules().getWorkingDays();
    List<String> workDayNames = new ArrayList<String>();
    for (WeekDay workDay : workDaysList) {
        String weekdayName = ApplicationContextProvider.getBean(MessageLookup.class).lookup(workDay.getPropertiesKey());
        workDay.setWeekdayName(weekdayName);
        workDayNames.add(workDay.getName());
    }
    return StringUtils.join(workDayNames, DELIMITER);
}
Also used : WeekDay(org.mifos.application.meeting.util.helpers.WeekDay) MessageLookup(org.mifos.application.master.MessageLookup) ArrayList(java.util.ArrayList) FiscalCalendarRules(org.mifos.config.FiscalCalendarRules)

Example 12 with WeekDay

use of org.mifos.application.meeting.util.helpers.WeekDay in project head by mifos.

the class ViewOrganizationSettingsServiceFacadeWebTier method getOffDays.

private String getOffDays() {
    List<Short> offDaysList = new FiscalCalendarRules().getWeekDayOffList();
    List<String> offDayNames = new ArrayList<String>();
    for (Short offDayNum : offDaysList) {
        WeekDay weekDay = WeekDay.getWeekDay(offDayNum);
        String weekdayName = ApplicationContextProvider.getBean(MessageLookup.class).lookup(weekDay.getPropertiesKey());
        weekDay.setWeekdayName(weekdayName);
        offDayNames.add(weekDay.getName());
    }
    return StringUtils.join(offDayNames, DELIMITER);
}
Also used : WeekDay(org.mifos.application.meeting.util.helpers.WeekDay) MessageLookup(org.mifos.application.master.MessageLookup) ArrayList(java.util.ArrayList) FiscalCalendarRules(org.mifos.config.FiscalCalendarRules)

Example 13 with WeekDay

use of org.mifos.application.meeting.util.helpers.WeekDay in project head by mifos.

the class CustomerServiceImpl method updateMeeting.

private boolean updateMeeting(final MeetingBO oldMeeting, final MeetingBO updatedDetails) throws CustomerException {
    boolean isRegenerationOfSchedulesRequired = false;
    try {
        if (oldMeeting.isWeekly()) {
            oldMeeting.setMeetingStartDate(updatedDetails.getMeetingStartDate());
            WeekDay dayOfWeek = updatedDetails.getMeetingDetails().getWeekDay();
            isRegenerationOfSchedulesRequired = oldMeeting.isDayOfWeekDifferent(dayOfWeek);
            oldMeeting.update(dayOfWeek.getValue(), updatedDetails.getMeetingPlace());
            oldMeeting.update(dayOfWeek, updatedDetails.getMeetingPlace());
        } else if (oldMeeting.isDaily()) {
            isRegenerationOfSchedulesRequired = false;
            oldMeeting.update(updatedDetails.getMeetingPlace());
        } else if (oldMeeting.isMonthlyOnDate()) {
            isRegenerationOfSchedulesRequired = oldMeeting.isDayOfMonthDifferent(updatedDetails.getMeetingDetails().getDayNumber());
            oldMeeting.update(updatedDetails.getMeetingDetails().getDayNumber(), updatedDetails.getMeetingPlace());
        } else if (oldMeeting.isMonthly()) {
            RankOfDay rankOfday = updatedDetails.getMeetingDetails().getWeekRank();
            //                WeekDay weekOfMonth = WeekDay.getWeekDay(updatedDetails.getMonthWeek());
            WeekDay weekOfMonth = updatedDetails.getMeetingDetails().getWeekDay();
            isRegenerationOfSchedulesRequired = oldMeeting.isWeekOfMonthDifferent(rankOfday, weekOfMonth);
            oldMeeting.update(weekOfMonth, rankOfday, updatedDetails.getMeetingPlace());
        }
    } catch (MeetingException me) {
        throw new CustomerException(me);
    }
    return isRegenerationOfSchedulesRequired;
}
Also used : WeekDay(org.mifos.application.meeting.util.helpers.WeekDay) CustomerException(org.mifos.customers.exceptions.CustomerException) RankOfDay(org.mifos.application.meeting.util.helpers.RankOfDay) MeetingException(org.mifos.application.meeting.exceptions.MeetingException)

Example 14 with WeekDay

use of org.mifos.application.meeting.util.helpers.WeekDay in project head by mifos.

the class SavingsScheduleIntegrationTest method weekDaysToPropertyString.

private String weekDaysToPropertyString(List<WeekDay> weekDays) {
    String propertyString = "";
    Boolean first = true;
    for (WeekDay day : weekDays) {
        if (!first) {
            propertyString = propertyString + ",";
        } else {
            first = false;
        }
        propertyString = propertyString + day.toString();
    }
    return propertyString;
}
Also used : WeekDay(org.mifos.application.meeting.util.helpers.WeekDay)

Example 15 with WeekDay

use of org.mifos.application.meeting.util.helpers.WeekDay in project head by mifos.

the class CenterScheduleCreationUsingCustomerServiceIntegrationTest method weekDaysToPropertyString.

private String weekDaysToPropertyString(List<WeekDay> weekDays) {
    String propertyString = "";
    Boolean first = true;
    for (WeekDay day : weekDays) {
        if (!first) {
            propertyString = propertyString + ",";
        } else {
            first = false;
        }
        propertyString = propertyString + day.toString();
    }
    return propertyString;
}
Also used : WeekDay(org.mifos.application.meeting.util.helpers.WeekDay)

Aggregations

WeekDay (org.mifos.application.meeting.util.helpers.WeekDay)17 ArrayList (java.util.ArrayList)6 MeetingBO (org.mifos.application.meeting.business.MeetingBO)6 MessageLookup (org.mifos.application.master.MessageLookup)5 MeetingException (org.mifos.application.meeting.exceptions.MeetingException)5 RankOfDay (org.mifos.application.meeting.util.helpers.RankOfDay)5 FiscalCalendarRules (org.mifos.config.FiscalCalendarRules)5 LocalDate (org.joda.time.LocalDate)4 BusinessRuleException (org.mifos.service.BusinessRuleException)4 CustomerBO (org.mifos.customers.business.CustomerBO)3 BigDecimal (java.math.BigDecimal)2 Date (java.util.Date)2 AmountFeeBO (org.mifos.accounts.fees.business.AmountFeeBO)2 FeeBO (org.mifos.accounts.fees.business.FeeBO)2 LoanOfferingBO (org.mifos.accounts.productdefinition.business.LoanOfferingBO)2 ConfigurationBusinessService (org.mifos.config.business.service.ConfigurationBusinessService)2 MifosRuntimeException (org.mifos.core.MifosRuntimeException)2 CreateAccountFeeDto (org.mifos.dto.domain.CreateAccountFeeDto)2 CreateAccountPenaltyDto (org.mifos.dto.domain.CreateAccountPenaltyDto)2 FeeDto (org.mifos.dto.domain.FeeDto)2