Search in sources :

Example 6 with AmountFeeBO

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;
}
Also used : Money(org.mifos.framework.util.helpers.Money) MeetingBO(org.mifos.application.meeting.business.MeetingBO) GLCodeEntity(org.mifos.accounts.financial.business.GLCodeEntity) FeeBO(org.mifos.accounts.fees.business.FeeBO) AmountFeeBO(org.mifos.accounts.fees.business.AmountFeeBO) MeetingBuilder(org.mifos.domain.builders.MeetingBuilder) AmountFeeBO(org.mifos.accounts.fees.business.AmountFeeBO) DateTime(org.joda.time.DateTime)

Example 7 with AmountFeeBO

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;
}
Also used : ArrayList(java.util.ArrayList) FeeDto(org.mifos.accounts.fees.business.FeeDto) AmountFeeBO(org.mifos.accounts.fees.business.AmountFeeBO)

Example 8 with AmountFeeBO

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;
}
Also used : ArrayList(java.util.ArrayList) ApplicableAccountFeeDto(org.mifos.dto.domain.ApplicableAccountFeeDto) FeeDto(org.mifos.accounts.fees.business.FeeDto) AmountFeeBO(org.mifos.accounts.fees.business.AmountFeeBO)

Example 9 with AmountFeeBO

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;
}
Also used : ArrayList(java.util.ArrayList) FeeDto(org.mifos.accounts.fees.business.FeeDto) AmountFeeBO(org.mifos.accounts.fees.business.AmountFeeBO)

Example 10 with AmountFeeBO

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());
}
Also used : FeeBuilder(org.mifos.domain.builders.FeeBuilder) CenterCustActionForm(org.mifos.customers.center.struts.actionforms.CenterCustActionForm) MeetingBO(org.mifos.application.meeting.business.MeetingBO) MeetingBuilder(org.mifos.domain.builders.MeetingBuilder) ApplicableAccountFeeDto(org.mifos.dto.domain.ApplicableAccountFeeDto) AmountFeeBO(org.mifos.accounts.fees.business.AmountFeeBO) Test(org.junit.Test)

Aggregations

AmountFeeBO (org.mifos.accounts.fees.business.AmountFeeBO)41 ArrayList (java.util.ArrayList)24 MeetingBO (org.mifos.application.meeting.business.MeetingBO)18 Test (org.junit.Test)17 FeeBO (org.mifos.accounts.fees.business.FeeBO)17 Money (org.mifos.framework.util.helpers.Money)16 MeetingBuilder (org.mifos.domain.builders.MeetingBuilder)14 DateTime (org.joda.time.DateTime)13 FeeBuilder (org.mifos.domain.builders.FeeBuilder)13 CenterBuilder (org.mifos.domain.builders.CenterBuilder)12 AccountFeesEntity (org.mifos.accounts.business.AccountFeesEntity)11 FeeDto (org.mifos.accounts.fees.business.FeeDto)8 CenterBO (org.mifos.customers.center.business.CenterBO)8 CategoryTypeEntity (org.mifos.accounts.fees.business.CategoryTypeEntity)6 FeeFrequencyTypeEntity (org.mifos.accounts.fees.business.FeeFrequencyTypeEntity)6 RateFeeBO (org.mifos.accounts.fees.business.RateFeeBO)6 BigDecimal (java.math.BigDecimal)5 Date (java.sql.Date)5 LocalDate (org.joda.time.LocalDate)5 CreateAccountFeeDto (org.mifos.dto.domain.CreateAccountFeeDto)5