Search in sources :

Example 81 with MeetingBO

use of org.mifos.application.meeting.business.MeetingBO in project head by mifos.

the class SavingsOfferingBOIntegrationTest method testBuildSavingsOfferingWithNoRecommendedAmountForMandatoryOffering.

@Test
public void testBuildSavingsOfferingWithNoRecommendedAmountForMandatoryOffering() throws SystemException {
    PrdApplicableMasterEntity prdApplicableMaster = new PrdApplicableMasterEntity(ApplicableTo.CLIENTS);
    SavingsTypeEntity savingsType = new SavingsTypeEntity(SavingsType.MANDATORY);
    InterestCalcTypeEntity intCalType = new InterestCalcTypeEntity(InterestCalcType.AVERAGE_BALANCE);
    MeetingBO intCalcMeeting = getMeeting();
    MeetingBO intPostMeeting = getMeeting();
    GLCodeEntity depglCodeEntity = (GLCodeEntity) StaticHibernateUtil.getSessionTL().get(GLCodeEntity.class, (short) 7);
    GLCodeEntity intglCodeEntity = (GLCodeEntity) StaticHibernateUtil.getSessionTL().get(GLCodeEntity.class, (short) 7);
    ProductCategoryBO productCategory = (ProductCategoryBO) TestObjectFactory.getObject(ProductCategoryBO.class, (short) 2);
    Date startDate = offSetCurrentDate(-2);
    try {
        new SavingsOfferingBO(TestUtils.makeUser(), "Savings Product1", "SAVP", productCategory, prdApplicableMaster, startDate, savingsType, intCalType, intCalcMeeting, intPostMeeting, null, 10.0, depglCodeEntity, intglCodeEntity);
        Assert.fail();
    } catch (ProductDefinitionException e) {
        Assert.assertTrue(true);
    }
}
Also used : MeetingBO(org.mifos.application.meeting.business.MeetingBO) ProductDefinitionException(org.mifos.accounts.productdefinition.exceptions.ProductDefinitionException) GLCodeEntity(org.mifos.accounts.financial.business.GLCodeEntity) Date(java.sql.Date) Test(org.junit.Test)

Example 82 with MeetingBO

use of org.mifos.application.meeting.business.MeetingBO in project head by mifos.

the class LoanPrdBusinessServiceIntegrationTest method createLoanOfferingBO.

private LoanOfferingBO createLoanOfferingBO(String prdOfferingName, String shortName) {
    Date startDate = new Date(System.currentTimeMillis());
    MeetingBO frequency = TestObjectFactory.createMeeting(TestObjectFactory.getTypicalMeeting());
    return TestObjectFactory.createLoanOffering(prdOfferingName, shortName, ApplicableTo.GROUPS, startDate, PrdStatus.LOAN_ACTIVE, 300.0, 1.2, 3, InterestType.FLAT, frequency);
}
Also used : MeetingBO(org.mifos.application.meeting.business.MeetingBO) Date(java.sql.Date)

Example 83 with MeetingBO

use of org.mifos.application.meeting.business.MeetingBO in project head by mifos.

the class AccountBO method getFeeDates.

public final List<Date> getFeeDates(final MeetingBO feeMeetingFrequency, final List<InstallmentDate> installmentDates, final boolean adjustForHolidays) {
    MeetingBO customerMeeting = getCustomer().getCustomerMeetingValue();
    List<Days> workingDays = new FiscalCalendarRules().getWorkingDaysAsJodaTimeDays();
    HolidayDao holidayDao = ApplicationContextProvider.getBean(HolidayDao.class);
    List<Holiday> holidays;
    if (adjustForHolidays) {
        holidays = holidayDao.findAllHolidaysThisYearAndNext(getOffice().getOfficeId());
    } else {
        holidays = new ArrayList<Holiday>();
    }
    DateTime startFromMeetingDate = new DateTime(installmentDates.get(0).getInstallmentDueDate());
    DateTime repaymentEndDatetime = new DateTime(installmentDates.get(installmentDates.size() - 1).getInstallmentDueDate());
    ScheduledEvent scheduledEvent = ScheduledEventFactory.createScheduledEventFrom(customerMeeting, feeMeetingFrequency);
    ScheduledDateGeneration dateGeneration = new HolidayAndWorkingDaysAndMoratoriaScheduledDateGeneration(workingDays, holidays);
    List<DateTime> feeScheduleDates = dateGeneration.generateScheduledDatesThrough(startFromMeetingDate, repaymentEndDatetime, scheduledEvent, true);
    List<Date> feeSchedulesAsJavaDates = new ArrayList<Date>();
    for (DateTime feeSchedule : feeScheduleDates) {
        feeSchedulesAsJavaDates.add(feeSchedule.toDate());
    }
    return feeSchedulesAsJavaDates;
}
Also used : ScheduledEvent(org.mifos.schedule.ScheduledEvent) MeetingBO(org.mifos.application.meeting.business.MeetingBO) ArrayList(java.util.ArrayList) HolidayDao(org.mifos.application.holiday.persistence.HolidayDao) DateTime(org.joda.time.DateTime) Date(java.util.Date) InstallmentDate(org.mifos.accounts.util.helpers.InstallmentDate) LocalDate(org.joda.time.LocalDate) HolidayAndWorkingDaysAndMoratoriaScheduledDateGeneration(org.mifos.schedule.internal.HolidayAndWorkingDaysAndMoratoriaScheduledDateGeneration) ScheduledDateGeneration(org.mifos.schedule.ScheduledDateGeneration) Holiday(org.mifos.application.holiday.business.Holiday) Days(org.joda.time.Days) FiscalCalendarRules(org.mifos.config.FiscalCalendarRules) HolidayAndWorkingDaysAndMoratoriaScheduledDateGeneration(org.mifos.schedule.internal.HolidayAndWorkingDaysAndMoratoriaScheduledDateGeneration)

Example 84 with MeetingBO

use of org.mifos.application.meeting.business.MeetingBO in project head by mifos.

the class MeetingActionStrutsTest method testSuccessfulCancelCreate.

@Test
public void testSuccessfulCancelCreate() throws Exception {
    loadMeetingPage();
    setRequestPathInfo("/meetingAction.do");
    addRequestParameter("method", "cancelCreate");
    actionPerform();
    verifyForward(ActionForwards.loadCreateCenter.toString());
    MeetingBO meeting = (MeetingBO) SessionUtils.getAttribute(CustomerConstants.CUSTOMER_MEETING, request);
    Assert.assertNull(meeting);
}
Also used : MeetingBO(org.mifos.application.meeting.business.MeetingBO) Test(org.junit.Test)

Example 85 with MeetingBO

use of org.mifos.application.meeting.business.MeetingBO in project head by mifos.

the class MeetingHelperIntegrationTest method testGetWeekMessage.

@Test
public void testGetWeekMessage() throws Exception {
    String expected = "Recur every 5 Week(s) on Monday";
    MeetingBO meeting = new MeetingBO(WeekDay.MONDAY, (short) 5, new Date(), MeetingType.CUSTOMER_MEETING, "Delhi");
    IntegrationTestObjectMother.saveMeeting(meeting);
    meeting = IntegrationTestObjectMother.getMeeting(meeting.getMeetingId());
    Assert.assertEquals(expected, helper.getMessage(meeting, TestUtils.makeUser()));
}
Also used : MeetingBO(org.mifos.application.meeting.business.MeetingBO) Date(java.util.Date) Test(org.junit.Test)

Aggregations

MeetingBO (org.mifos.application.meeting.business.MeetingBO)355 Test (org.junit.Test)176 Date (java.util.Date)91 ArrayList (java.util.ArrayList)84 MeetingBuilder (org.mifos.domain.builders.MeetingBuilder)74 DateTime (org.joda.time.DateTime)68 LocalDate (org.joda.time.LocalDate)56 Money (org.mifos.framework.util.helpers.Money)56 CenterBuilder (org.mifos.domain.builders.CenterBuilder)54 CenterBO (org.mifos.customers.center.business.CenterBO)46 LoanOfferingBO (org.mifos.accounts.productdefinition.business.LoanOfferingBO)44 AccountFeesEntity (org.mifos.accounts.business.AccountFeesEntity)42 Date (java.sql.Date)40 UserContext (org.mifos.security.util.UserContext)34 AccountActionDateEntity (org.mifos.accounts.business.AccountActionDateEntity)33 PersonnelBO (org.mifos.customers.personnel.business.PersonnelBO)30 OfficeBO (org.mifos.customers.office.business.OfficeBO)27 CustomerBO (org.mifos.customers.business.CustomerBO)23 AmountFeeBO (org.mifos.accounts.fees.business.AmountFeeBO)22 MifosUser (org.mifos.security.MifosUser)20