use of org.mifos.accounts.fees.business.FeeFrequencyTypeEntity in project head by mifos.
the class LoanProductDaoHibernate method retrieveFeeFrequencyType.
@Override
public FeeFrequencyTypeEntity retrieveFeeFrequencyType(FeeFrequencyType enumType) {
FeeFrequencyTypeEntity selected = null;
List<FeeFrequencyTypeEntity> masterTypes = doFetchListOfMasterDataFor(FeeFrequencyTypeEntity.class);
for (FeeFrequencyTypeEntity entity : masterTypes) {
if (entity.getId().equals(enumType.getValue())) {
selected = entity;
}
}
return selected;
}
use of org.mifos.accounts.fees.business.FeeFrequencyTypeEntity in project head by mifos.
the class LoanOfferingBOIntegrationTest method testUpdateWithFundsAndOneTimeFee.
@Test
public void testUpdateWithFundsAndOneTimeFee() 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);
product = createLoanOfferingBO("Loan Product", "LOAP");
product.update((short) 1, "Loan Product", "LOAN", productCategory, prdApplicableMaster, startDate, endDate, "Loan Product updated", PrdStatus.LOAN_ACTIVE, gracePeriodType, interestTypes, (short) 0, new Money(getCurrency(), "3000"), new Money(getCurrency(), "1000"), new Money(getCurrency(), "1000"), 12.0, 2.0, 12.0, (short) 12, (short) 1, (short) 2, false, true, false, funds, fees, null, (short) 2, RecurrenceType.WEEKLY, waiverInterest);
Assert.assertEquals(2, product.getLoanOfferingFees().size());
Assert.assertEquals(1, product.getLoanOfferingFunds().size());
}
use of org.mifos.accounts.fees.business.FeeFrequencyTypeEntity 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());
}
Aggregations