Search in sources :

Example 11 with FeePaymentEntity

use of org.mifos.accounts.fees.business.FeePaymentEntity in project head by mifos.

the class LoanOfferingBOIntegrationTest method testWithFundsAndOneTimeFee.

@Test
public void testWithFundsAndOneTimeFee() throws ProductDefinitionException, FeeException {
    createIntitalObjects();
    GracePeriodTypeEntity gracePeriodType = new GracePeriodTypeEntity(GraceType.GRACEONALLREPAYMENTS);
    Date startDate = offSetCurrentDate(0);
    Date endDate = offSetCurrentDate(2);
    FeeBO fee = new AmountFeeBO(TestObjectFactory.getContext(), "Loan Periodic", new CategoryTypeEntity(FeeCategory.LOAN), new FeeFrequencyTypeEntity(FeeFrequencyType.PERIODIC), intglCodeEntity, new Money(getCurrency(), "100"), false, TestObjectFactory.createMeeting(TestObjectFactory.getTypicalMeeting()));
    FeeBO fee1 = new AmountFeeBO(TestObjectFactory.getContext(), "Loan Periodic", new CategoryTypeEntity(FeeCategory.LOAN), new FeeFrequencyTypeEntity(FeeFrequencyType.ONETIME), intglCodeEntity, new Money(getCurrency(), "100"), false, new FeePaymentEntity(FeePayment.UPFRONT));
    List<FeeBO> fees = new ArrayList<FeeBO>();
    fees.add(fee);
    fees.add(fee1);
    List<FundBO> funds = new ArrayList<FundBO>();
    funds.add(null);
    LoanOfferingBO loanOffering = new LoanOfferingBO(TestObjectFactory.getContext(), "Loan Offering", "LOAP", productCategory, prdApplicableMaster, startDate, endDate, null, gracePeriodType, (short) 2, interestTypes, new Money(getCurrency(), "1000"), new Money(getCurrency(), "3000"), new Money(getCurrency(), "2000.0"), 12.0, 2.0, 3.0, (short) 20, (short) 11, (short) 17, false, false, false, funds, fees, null, frequency, principalglCodeEntity, intglCodeEntity, waiverInterest);
    Assert.assertEquals(2, loanOffering.getLoanOfferingFees().size());
    Assert.assertEquals(1, loanOffering.getLoanOfferingFunds().size());
}
Also used : FundBO(org.mifos.accounts.fund.business.FundBO) ArrayList(java.util.ArrayList) FeePaymentEntity(org.mifos.accounts.fees.business.FeePaymentEntity) Date(java.sql.Date) AmountFeeBO(org.mifos.accounts.fees.business.AmountFeeBO) Money(org.mifos.framework.util.helpers.Money) FeeFrequencyTypeEntity(org.mifos.accounts.fees.business.FeeFrequencyTypeEntity) CategoryTypeEntity(org.mifos.accounts.fees.business.CategoryTypeEntity) FeeBO(org.mifos.accounts.fees.business.FeeBO) AmountFeeBO(org.mifos.accounts.fees.business.AmountFeeBO) Test(org.junit.Test)

Aggregations

FeePaymentEntity (org.mifos.accounts.fees.business.FeePaymentEntity)11 AmountFeeBO (org.mifos.accounts.fees.business.AmountFeeBO)8 FeeBO (org.mifos.accounts.fees.business.FeeBO)8 FeeFrequencyTypeEntity (org.mifos.accounts.fees.business.FeeFrequencyTypeEntity)6 CategoryTypeEntity (org.mifos.accounts.fees.business.CategoryTypeEntity)5 RateFeeBO (org.mifos.accounts.fees.business.RateFeeBO)5 ArrayList (java.util.ArrayList)4 Test (org.junit.Test)3 FeeFormulaEntity (org.mifos.accounts.fees.business.FeeFormulaEntity)3 GLCodeEntity (org.mifos.accounts.financial.business.GLCodeEntity)3 FundBO (org.mifos.accounts.fund.business.FundBO)3 MeetingException (org.mifos.application.meeting.exceptions.MeetingException)3 MifosRuntimeException (org.mifos.core.MifosRuntimeException)3 PersistenceException (org.mifos.framework.exceptions.PersistenceException)3 SystemException (org.mifos.framework.exceptions.SystemException)3 Money (org.mifos.framework.util.helpers.Money)3 Date (java.sql.Date)2 ProductDefinitionException (org.mifos.accounts.productdefinition.exceptions.ProductDefinitionException)2 LookUpValueEntity (org.mifos.application.master.business.LookUpValueEntity)2 BusinessRuleException (org.mifos.service.BusinessRuleException)2