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;
}
Aggregations