Search in sources :

Example 91 with AccountFeesEntity

use of org.mifos.accounts.business.AccountFeesEntity in project head by mifos.

the class CenterScheduleCreationUsingCustomerServiceIntegrationTest method createCenterScheduleWithWeeklyMeetingNoFeesThirdDateInNextMeetingHoliday.

@Ignore
@Test
public void createCenterScheduleWithWeeklyMeetingNoFeesThirdDateInNextMeetingHoliday() throws Exception {
    DateTime startDate = date(2010, 4, 5);
    //Monday
    DateTimeUtils.setCurrentMillisFixed(startDate.getMillis());
    // setup
    saveHoliday(date(2010, 4, 19), date(2010, 4, 23), RepaymentRuleTypes.NEXT_MEETING_OR_REPAYMENT);
    StaticHibernateUtil.flushSession();
    MeetingBO weeklyMeeting = new MeetingBuilder().customerMeeting().weekly().every(1).startingToday().build();
    CenterBO center = new CenterBuilder().with(weeklyMeeting).withName("Center-IntegrationTest").with(sampleBranchOffice()).withLoanOfficer(testUser()).withUserContext().build();
    List<AccountFeesEntity> noAccountFees = new ArrayList<AccountFeesEntity>();
    // exercise test
    customerService.createCenter(center, weeklyMeeting, noAccountFees);
    StaticHibernateUtil.flushSession();
    validateDates(center.getGlobalCustNum(), startDate, startDate.plusWeeks(1), startDate.plusWeeks(3), startDate.plusWeeks(3), startDate.plusWeeks(4), startDate.plusWeeks(5), startDate.plusWeeks(6), startDate.plusWeeks(7), startDate.plusWeeks(8), startDate.plusWeeks(9));
}
Also used : MeetingBO(org.mifos.application.meeting.business.MeetingBO) ArrayList(java.util.ArrayList) CenterBO(org.mifos.customers.center.business.CenterBO) CenterBuilder(org.mifos.domain.builders.CenterBuilder) MeetingBuilder(org.mifos.domain.builders.MeetingBuilder) AccountFeesEntity(org.mifos.accounts.business.AccountFeesEntity) DateTime(org.joda.time.DateTime) Ignore(org.junit.Ignore) Test(org.junit.Test)

Example 92 with AccountFeesEntity

use of org.mifos.accounts.business.AccountFeesEntity in project head by mifos.

the class CenterScheduleCreationUsingCustomerServiceIntegrationTest method createCenterScheduleWithBiWeeklyMeetingNoFeesThirdAndFifthDatesInMoratorium.

@Ignore
@Test
public void createCenterScheduleWithBiWeeklyMeetingNoFeesThirdAndFifthDatesInMoratorium() throws Exception {
    DateTime startDate = date(2010, 4, 5);
    //Monday
    DateTimeUtils.setCurrentMillisFixed(startDate.getMillis());
    // setup
    saveHoliday(startDate.plusWeeks(4), startDate.plusWeeks(4).plusDays(3), RepaymentRuleTypes.REPAYMENT_MORATORIUM);
    saveHoliday(startDate.plusWeeks(8), startDate.plusWeeks(8).plusDays(3), RepaymentRuleTypes.REPAYMENT_MORATORIUM);
    StaticHibernateUtil.flushSession();
    MeetingBO biWeeklyMeeting = new MeetingBuilder().customerMeeting().weekly().every(2).startingToday().build();
    CenterBO center = new CenterBuilder().with(biWeeklyMeeting).withName("Center-IntegrationTest").with(sampleBranchOffice()).withLoanOfficer(testUser()).withUserContext().build();
    // exercise test
    customerService.createCenter(center, biWeeklyMeeting, new ArrayList<AccountFeesEntity>());
    // verification
    validateDates(center.getGlobalCustNum(), startDate, startDate.plusWeeks(2), startDate.plusWeeks(6), startDate.plusWeeks(10), startDate.plusWeeks(12), startDate.plusWeeks(14), startDate.plusWeeks(16), startDate.plusWeeks(18), startDate.plusWeeks(20), startDate.plusWeeks(22));
}
Also used : MeetingBO(org.mifos.application.meeting.business.MeetingBO) CenterBO(org.mifos.customers.center.business.CenterBO) CenterBuilder(org.mifos.domain.builders.CenterBuilder) MeetingBuilder(org.mifos.domain.builders.MeetingBuilder) AccountFeesEntity(org.mifos.accounts.business.AccountFeesEntity) DateTime(org.joda.time.DateTime) Ignore(org.junit.Ignore) Test(org.junit.Test)

Example 93 with AccountFeesEntity

use of org.mifos.accounts.business.AccountFeesEntity in project head by mifos.

the class CenterScheduleCreationUsingCustomerServiceIntegrationTest method createCenterScheduleWithWeeklyMeetingNoFeesThirdAndFourthDatesInMoratorium.

@Ignore
@Test
public void createCenterScheduleWithWeeklyMeetingNoFeesThirdAndFourthDatesInMoratorium() throws Exception {
    DateTime startDate = date(2010, 4, 5);
    //Monday
    DateTimeUtils.setCurrentMillisFixed(startDate.getMillis());
    // setup
    saveHoliday(startDate.plusWeeks(2), startDate.plusWeeks(3).plusDays(4), RepaymentRuleTypes.REPAYMENT_MORATORIUM);
    StaticHibernateUtil.flushSession();
    MeetingBO weeklyMeeting = new MeetingBuilder().customerMeeting().weekly().every(1).startingToday().build();
    CenterBO center = new CenterBuilder().with(weeklyMeeting).withName("Center-IntegrationTest").with(sampleBranchOffice()).withLoanOfficer(testUser()).withUserContext().build();
    List<AccountFeesEntity> noAccountFees = new ArrayList<AccountFeesEntity>();
    // exercise test
    customerService.createCenter(center, weeklyMeeting, noAccountFees);
    validateDates(center.getGlobalCustNum(), startDate, startDate.plusWeeks(1), startDate.plusWeeks(4), startDate.plusWeeks(5), startDate.plusWeeks(6), startDate.plusWeeks(7), startDate.plusWeeks(8), startDate.plusWeeks(9), startDate.plusWeeks(10), startDate.plusWeeks(11));
}
Also used : MeetingBO(org.mifos.application.meeting.business.MeetingBO) ArrayList(java.util.ArrayList) CenterBO(org.mifos.customers.center.business.CenterBO) CenterBuilder(org.mifos.domain.builders.CenterBuilder) MeetingBuilder(org.mifos.domain.builders.MeetingBuilder) AccountFeesEntity(org.mifos.accounts.business.AccountFeesEntity) DateTime(org.joda.time.DateTime) Ignore(org.junit.Ignore) Test(org.junit.Test)

Example 94 with AccountFeesEntity

use of org.mifos.accounts.business.AccountFeesEntity in project head by mifos.

the class CenterScheduleCreationUsingCustomerServiceIntegrationTest method createCenterScheduleWithBiWeeklyMeetingNoFeesNoHoliday.

/***********************************************
     * Biweekly meeting, no fees
     ***********************************************/
@Ignore
@Test
public void createCenterScheduleWithBiWeeklyMeetingNoFeesNoHoliday() throws Exception {
    DateTime startDate = date(2010, 4, 5);
    //Monday
    DateTimeUtils.setCurrentMillisFixed(startDate.getMillis());
    // setup
    MeetingBO biWeeklyMeeting = new MeetingBuilder().customerMeeting().weekly().every(2).startingToday().build();
    CenterBO center = new CenterBuilder().with(biWeeklyMeeting).withName("Center-IntegrationTest").with(sampleBranchOffice()).withLoanOfficer(testUser()).withUserContext().build();
    // exercise test
    customerService.createCenter(center, biWeeklyMeeting, new ArrayList<AccountFeesEntity>());
    // verification
    validateDates(center.getGlobalCustNum(), startDate.plusWeeks(1), startDate.plusWeeks(3), startDate.plusWeeks(5), startDate.plusWeeks(7), startDate.plusWeeks(9), startDate.plusWeeks(11), startDate.plusWeeks(13), startDate.plusWeeks(15), startDate.plusWeeks(17), startDate.plusWeeks(19));
}
Also used : MeetingBO(org.mifos.application.meeting.business.MeetingBO) CenterBO(org.mifos.customers.center.business.CenterBO) CenterBuilder(org.mifos.domain.builders.CenterBuilder) MeetingBuilder(org.mifos.domain.builders.MeetingBuilder) AccountFeesEntity(org.mifos.accounts.business.AccountFeesEntity) DateTime(org.joda.time.DateTime) Ignore(org.junit.Ignore) Test(org.junit.Test)

Example 95 with AccountFeesEntity

use of org.mifos.accounts.business.AccountFeesEntity in project head by mifos.

the class CenterScheduleCreationUsingCustomerServiceIntegrationTest method createCenterScheduleWithWeeklyMeetingNoFeesThirdAndFourthDatesInSameDayHoliday.

@Test
public void createCenterScheduleWithWeeklyMeetingNoFeesThirdAndFourthDatesInSameDayHoliday() throws Exception {
    DateTime startDate = date(2010, 4, 5);
    //Monday
    DateTimeUtils.setCurrentMillisFixed(startDate.getMillis());
    // setup
    saveHoliday(startDate.plusWeeks(2), startDate.plusWeeks(2).plusDays(3), RepaymentRuleTypes.SAME_DAY);
    saveHoliday(startDate.plusWeeks(3), startDate.plusWeeks(3).plusDays(3), RepaymentRuleTypes.SAME_DAY);
    MeetingBO weeklyMeeting = new MeetingBuilder().customerMeeting().weekly().every(1).startingToday().build();
    CenterBO center = new CenterBuilder().with(weeklyMeeting).withName("Center-IntegrationTest").with(sampleBranchOffice()).withLoanOfficer(testUser()).withUserContext().build();
    List<AccountFeesEntity> noAccountFees = new ArrayList<AccountFeesEntity>();
    // exercise test
    customerService.createCenter(center, weeklyMeeting, noAccountFees);
    validateDates(center.getGlobalCustNum(), startDate, startDate.plusWeeks(1), startDate.plusWeeks(2), startDate.plusWeeks(3), startDate.plusWeeks(4), startDate.plusWeeks(5), startDate.plusWeeks(6), startDate.plusWeeks(7), startDate.plusWeeks(8), startDate.plusWeeks(9));
}
Also used : MeetingBO(org.mifos.application.meeting.business.MeetingBO) ArrayList(java.util.ArrayList) CenterBO(org.mifos.customers.center.business.CenterBO) CenterBuilder(org.mifos.domain.builders.CenterBuilder) MeetingBuilder(org.mifos.domain.builders.MeetingBuilder) AccountFeesEntity(org.mifos.accounts.business.AccountFeesEntity) DateTime(org.joda.time.DateTime) Test(org.junit.Test)

Aggregations

AccountFeesEntity (org.mifos.accounts.business.AccountFeesEntity)118 ArrayList (java.util.ArrayList)78 Test (org.junit.Test)65 CenterBuilder (org.mifos.domain.builders.CenterBuilder)46 DateTime (org.joda.time.DateTime)42 MeetingBO (org.mifos.application.meeting.business.MeetingBO)42 CenterBO (org.mifos.customers.center.business.CenterBO)39 MeetingBuilder (org.mifos.domain.builders.MeetingBuilder)38 FeeBO (org.mifos.accounts.fees.business.FeeBO)25 Money (org.mifos.framework.util.helpers.Money)25 AmountFeeBO (org.mifos.accounts.fees.business.AmountFeeBO)24 UserContext (org.mifos.security.util.UserContext)22 LocalDate (org.joda.time.LocalDate)21 AccountActionDateEntity (org.mifos.accounts.business.AccountActionDateEntity)21 CustomerAccountBO (org.mifos.customers.business.CustomerAccountBO)18 FeeInstallment (org.mifos.accounts.util.helpers.FeeInstallment)17 OfficeBO (org.mifos.customers.office.business.OfficeBO)17 PersonnelBO (org.mifos.customers.personnel.business.PersonnelBO)17 MifosUser (org.mifos.security.MifosUser)16 AccountException (org.mifos.accounts.exceptions.AccountException)14