Search in sources :

Example 61 with MeetingBO

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

the class FinancialBusinessServiceIntegrationTest method getLoanAccount.

private LoanBO getLoanAccount() {
    Date startDate = new Date(System.currentTimeMillis());
    MeetingBO meeting = TestObjectFactory.createMeeting(TestObjectFactory.getTypicalMeeting());
    center = TestObjectFactory.createWeeklyFeeCenter(this.getClass().getSimpleName() + " Center", meeting);
    group = TestObjectFactory.createWeeklyFeeGroupUnderCenter(this.getClass().getSimpleName() + " Group", CustomerStatus.GROUP_ACTIVE, center);
    LoanOfferingBO loanOffering = TestObjectFactory.createLoanOffering(this.getClass().getSimpleName() + "", "FL", startDate, meeting);
    return TestObjectFactory.createLoanAccount("42423142341", group, AccountState.LOAN_ACTIVE_IN_GOOD_STANDING, startDate, loanOffering);
}
Also used : MeetingBO(org.mifos.application.meeting.business.MeetingBO) LoanOfferingBO(org.mifos.accounts.productdefinition.business.LoanOfferingBO) Date(java.sql.Date)

Example 62 with MeetingBO

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

the class AccountBOIntegrationTest method testGetInstalmentDates.

@Test
public void testGetInstalmentDates() throws Exception {
    AccountBO account = new AccountBO();
    MeetingBO meeting = new MeetingBO(RecurrenceType.DAILY, (short) 1, getDate("18/08/2005"), MeetingType.CUSTOMER_MEETING);
    /*
         * make sure we can handle case where the number of installments is zero
         */
    account.getInstallmentDates(meeting, (short) 0, (short) 0);
}
Also used : MeetingBO(org.mifos.application.meeting.business.MeetingBO) Test(org.junit.Test)

Example 63 with MeetingBO

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

the class FeeBOIntegrationTest method testCreatePeriodicRateFee.

@Test
public void testCreatePeriodicRateFee() throws Exception {
    MeetingBO feefrequency = new MeetingBO(RecurrenceType.WEEKLY, Short.valueOf("2"), new Date(), MeetingType.PERIODIC_FEE);
    fee = createPeriodicRateFee("Customer_Periodic_RateFee", FeeCategory.CENTER, 100.0, FeeFormula.AMOUNT, false, feefrequency);
    fee.save();
    StaticHibernateUtil.flushSession();
    fee = (FeeBO) TestObjectFactory.getObject(FeeBO.class, fee.getFeeId());
    Assert.assertEquals("Customer_Periodic_RateFee", fee.getFeeName());
    Assert.assertEquals(FeeCategory.CENTER.getValue(), fee.getCategoryType().getId());
}
Also used : MeetingBO(org.mifos.application.meeting.business.MeetingBO) Date(java.util.Date) Test(org.junit.Test)

Example 64 with MeetingBO

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

the class FeeBOIntegrationTest method testCreatePeriodicDefaultFee.

@Test
public void testCreatePeriodicDefaultFee() throws Exception {
    MeetingBO feefrequency = new MeetingBO(RecurrenceType.WEEKLY, Short.valueOf("2"), new Date(), MeetingType.PERIODIC_FEE);
    fee = createPeriodicRateFee("Customer_Periodic_DefaultFee", FeeCategory.ALLCUSTOMERS, 100.0, FeeFormula.AMOUNT, true, feefrequency);
    fee.save();
    StaticHibernateUtil.flushSession();
    fee = (FeeBO) TestObjectFactory.getObject(FeeBO.class, fee.getFeeId());
    Assert.assertEquals("Customer_Periodic_DefaultFee", fee.getFeeName());
    Assert.assertEquals(FeeCategory.ALLCUSTOMERS.getValue(), fee.getCategoryType().getId());
    Assert.assertEquals(true, fee.isCustomerDefaultFee());
    Assert.assertTrue(vaidateDefaultCustomerFee(fee.getFeeLevels(), fee.getCategoryType().getFeeCategory()));
    StaticHibernateUtil.flushSession();
}
Also used : MeetingBO(org.mifos.application.meeting.business.MeetingBO) Date(java.util.Date) Test(org.junit.Test)

Example 65 with MeetingBO

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

the class FeeBOIntegrationTest method testCreatePeriodicAmountFee.

@Test
public void testCreatePeriodicAmountFee() throws Exception {
    MeetingBO feefrequency = new MeetingBO(RecurrenceType.WEEKLY, Short.valueOf("2"), new Date(), MeetingType.PERIODIC_FEE);
    fee = createPeriodicAmountFee("Customer_Periodic_AmountFee", FeeCategory.CENTER, "100", false, feefrequency);
    fee.save();
    StaticHibernateUtil.flushSession();
    fee = (FeeBO) TestObjectFactory.getObject(FeeBO.class, fee.getFeeId());
    Assert.assertEquals("Customer_Periodic_AmountFee", fee.getFeeName());
    Assert.assertEquals(FeeCategory.CENTER.getValue(), fee.getCategoryType().getId());
    StaticHibernateUtil.flushSession();
}
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