Search in sources :

Example 1 with CustomerFeeScheduleEntity

use of org.mifos.customers.business.CustomerFeeScheduleEntity in project head by mifos.

the class AccountServiceIntegrationTest method getCustomerAccountWithAllTypesOfFees.

private CustomerAccountBO getCustomerAccountWithAllTypesOfFees() {
    MeetingBO meeting = TestObjectFactory.createMeeting(TestObjectFactory.getNewMeetingForToday(WEEKLY, EVERY_WEEK, CUSTOMER_MEETING));
    center = TestObjectFactory.createWeeklyFeeCenter("Center", meeting);
    CustomerAccountBO customerAccountBO = center.getCustomerAccount();
    CustomerScheduleEntity customerScheduleEntity = (CustomerScheduleEntity) customerAccountBO.getAccountActionDate(Short.valueOf("1"));
    FeeBO upfrontFee = TestObjectFactory.createOneTimeRateFee("Upfront Fee", FeeCategory.CENTER, Double.valueOf("20"), FeeFormula.AMOUNT, FeePayment.UPFRONT, null);
    AccountFeesEntity accountUpfrontFee = new AccountFeesEntity(customerAccountBO, upfrontFee, new Double("20.0"), FeeStatus.ACTIVE.getValue(), null, customerScheduleEntity.getActionDate());
    AccountTestUtils.addAccountFees(accountUpfrontFee, customerAccountBO);
    AccountFeesActionDetailEntity accountUpfrontFeesaction = new CustomerFeeScheduleEntity(customerScheduleEntity, upfrontFee, accountUpfrontFee, new Money(getCurrency(), "20.0"));
    customerScheduleEntity.addAccountFeesAction(accountUpfrontFeesaction);
    TestObjectFactory.updateObject(center);
    customerAccountBO = center.getCustomerAccount();
    FeeBO periodicFee = TestObjectFactory.createPeriodicAmountFee("Periodic Fee", FeeCategory.ALLCUSTOMERS, "200", RecurrenceType.WEEKLY, Short.valueOf("1"));
    AccountFeesEntity accountPeriodicFee = new AccountFeesEntity(customerAccountBO, periodicFee, new Double("200.0"), FeeStatus.INACTIVE.getValue(), null, null);
    AccountTestUtils.addAccountFees(accountPeriodicFee, customerAccountBO);
    TestObjectFactory.updateObject(center);
    return customerAccountBO;
}
Also used : CustomerAccountBO(org.mifos.customers.business.CustomerAccountBO) Money(org.mifos.framework.util.helpers.Money) CustomerScheduleEntity(org.mifos.customers.business.CustomerScheduleEntity) AccountFeesActionDetailEntity(org.mifos.accounts.business.AccountFeesActionDetailEntity) MeetingBO(org.mifos.application.meeting.business.MeetingBO) FeeBO(org.mifos.accounts.fees.business.FeeBO) AccountFeesEntity(org.mifos.accounts.business.AccountFeesEntity) CustomerFeeScheduleEntity(org.mifos.customers.business.CustomerFeeScheduleEntity)

Aggregations

AccountFeesActionDetailEntity (org.mifos.accounts.business.AccountFeesActionDetailEntity)1 AccountFeesEntity (org.mifos.accounts.business.AccountFeesEntity)1 FeeBO (org.mifos.accounts.fees.business.FeeBO)1 MeetingBO (org.mifos.application.meeting.business.MeetingBO)1 CustomerAccountBO (org.mifos.customers.business.CustomerAccountBO)1 CustomerFeeScheduleEntity (org.mifos.customers.business.CustomerFeeScheduleEntity)1 CustomerScheduleEntity (org.mifos.customers.business.CustomerScheduleEntity)1 Money (org.mifos.framework.util.helpers.Money)1