use of org.mifos.accounts.fees.business.AmountFeeBO in project head by mifos.
the class FeeInstallmentTest method createWeeklyFeeBO.
private FeeBO createWeeklyFeeBO(int every) {
MeetingBO feeMeeting = new MeetingBuilder().every(every).weekly().build();
FeeBO feeBO = new AmountFeeBO(new Money(TestUtils.RUPEE, "10.0"), "Fee", FeeCategory.ALLCUSTOMERS, FeeFrequencyType.PERIODIC, new GLCodeEntity(Short.valueOf("1"), "10000"), feeMeeting, null, new DateTime().minusDays(14).toDate(), TestUtils.makeUserWithLocales().getId());
return feeBO;
}
use of org.mifos.accounts.fees.business.AmountFeeBO in project head by mifos.
the class CenterBOIntegrationTest method getFees.
private List<FeeDto> getFees() {
List<FeeDto> fees = new ArrayList<FeeDto>();
AmountFeeBO fee1 = (AmountFeeBO) TestObjectFactory.createPeriodicAmountFee("PeriodicAmountFee", FeeCategory.CENTER, "200", RecurrenceType.WEEKLY, Short.valueOf("2"));
AmountFeeBO fee2 = (AmountFeeBO) TestObjectFactory.createOneTimeAmountFee("OneTimeAmountFee", FeeCategory.ALLCUSTOMERS, "100", FeePayment.UPFRONT);
fees.add(new FeeDto(TestObjectFactory.getContext(), fee1));
fees.add(new FeeDto(TestObjectFactory.getContext(), fee2));
StaticHibernateUtil.flushSession();
return fees;
}
use of org.mifos.accounts.fees.business.AmountFeeBO in project head by mifos.
the class ClientCustActionStrutsTest method getFees.
private List<FeeDto> getFees(RecurrenceType frequency) {
List<FeeDto> fees = new ArrayList<FeeDto>();
AmountFeeBO fee1 = (AmountFeeBO) TestObjectFactory.createPeriodicAmountFee("PeriodicAmountFee", FeeCategory.CLIENT, "200", frequency, Short.valueOf("2"));
fees.add(new FeeDto(TestObjectFactory.getContext(), fee1));
StaticHibernateUtil.flushAndClearSession();
return fees;
}
use of org.mifos.accounts.fees.business.AmountFeeBO in project head by mifos.
the class ClientIntegrationTest method getFees.
private List<FeeDto> getFees() {
List<FeeDto> fees = new ArrayList<FeeDto>();
AmountFeeBO fee1 = (AmountFeeBO) TestObjectFactory.createPeriodicAmountFee("PeriodicAmountFee", FeeCategory.CENTER, "200", RecurrenceType.WEEKLY, Short.valueOf("2"));
AmountFeeBO fee2 = (AmountFeeBO) TestObjectFactory.createOneTimeAmountFee("OneTimeAmountFee", FeeCategory.ALLCUSTOMERS, "100", FeePayment.UPFRONT);
fees.add(new FeeDto(TestObjectFactory.getContext(), fee1));
fees.add(new FeeDto(TestObjectFactory.getContext(), fee2));
StaticHibernateUtil.flushSession();
return fees;
}
use of org.mifos.accounts.fees.business.AmountFeeBO in project head by mifos.
the class CenterActionStrutsTest method testSuccessfulCreate.
@Test
public void testSuccessfulCreate() throws Exception {
MeetingBO weeklyMeeting = new MeetingBuilder().customerMeeting().weekly().every(1).startingToday().build();
AmountFeeBO monthlyPeriodicFeeForFirstClients = new FeeBuilder().appliesToCenterOnly().withFeeAmount("200.0").withName("PeriodicAmountFee").withSameRecurrenceAs(weeklyMeeting).with(sampleBranchOffice()).build();
IntegrationTestObjectMother.saveFee(monthlyPeriodicFeeForFirstClients);
setRequestPathInfo("/centerCustAction.do");
addRequestParameter("method", "load");
addRequestParameter("officeId", "1");
actionPerform();
SessionUtils.setAttribute(CustomerConstants.CUSTOMER_MEETING, weeklyMeeting, request);
List<ApplicableAccountFeeDto> feeList = retrieveAdditionalFeesFromSession();
ApplicableAccountFeeDto fee = feeList.get(0);
setRequestPathInfo("/centerCustAction.do");
addRequestParameter("method", "preview");
addRequestParameter("displayName", "center");
addRequestParameter("loanOfficerId", "1");
addRequestParameter(Constants.CURRENTFLOWKEY, (String) request.getAttribute(Constants.CURRENTFLOWKEY));
addRequestParameter("selectedFee[0].feeId", fee.getFeeId().toString());
addRequestParameter("selectedFee[0].amount", fee.getAmount());
actionPerform();
verifyForward(ActionForwards.preview_success.toString());
setRequestPathInfo("/centerCustAction.do");
addRequestParameter("method", "create");
addRequestParameter(Constants.CURRENTFLOWKEY, (String) request.getAttribute(Constants.CURRENTFLOWKEY));
actionPerform();
verifyNoActionErrors();
verifyForward(ActionForwards.create_success.toString());
CenterCustActionForm actionForm = (CenterCustActionForm) request.getSession().getAttribute("centerCustActionForm");
center = TestObjectFactory.getCenter(actionForm.getCustomerIdAsInt());
}
Aggregations