use of org.mifos.dto.screen.FeeParameters in project head by mifos.
the class FeeServiceFacadeWebTier method parameters.
private FeeParameters parameters() {
try {
List<GLCodeEntity> glCodes = generalLedgerDao.retreiveGlCodesBy(FinancialActionConstants.FEEPOSTING, FinancialConstants.CREDIT);
List<CategoryTypeEntity> categories = this.feeDao.doRetrieveFeeCategories();
List<FeeFormulaEntity> formulas = this.feeDao.retrieveFeeFormulae();
List<FeeFrequencyTypeEntity> frequencies = this.feeDao.retrieveFeeFrequencies();
List<FeePaymentEntity> timesOfCharging = this.feeDao.retrieveFeePayments();
List<MasterDataEntity> timesOfChargeingCustomer = new ArrayList<MasterDataEntity>();
for (MasterDataEntity timeOfCharging : timesOfCharging) {
if (timeOfCharging.getId().equals(FeePayment.UPFRONT.getValue())) {
timesOfChargeingCustomer.add(timeOfCharging);
}
}
return new FeeParameters(listToMap(categories), listToMap(timesOfCharging), listToMap(timesOfChargeingCustomer), listToMap(formulas), listToMap(frequencies), glCodesToMap(glCodes));
} catch (FinancialException e) {
throw new BusinessRuleException(e.getKey(), e);
}
}
use of org.mifos.dto.screen.FeeParameters in project head by mifos.
the class FeeServiceFacadeWebTier method retrieveDetailsForFeeLoad.
@Override
public FeeDetailsForLoadDto retrieveDetailsForFeeLoad() {
FeeParameters feeParameters = parameters();
boolean isMultiCurrencyEnabled = AccountingRules.isMultiCurrencyEnabled();
return new FeeDetailsForLoadDto(feeParameters, isMultiCurrencyEnabled);
}
use of org.mifos.dto.screen.FeeParameters in project head by mifos.
the class FeeActionStrutsTest method testLoad.
@Test
public void testLoad() throws Exception {
setRequestPathInfo("/feeaction.do");
addRequestParameter("method", "load");
actionPerform();
verifyNoActionErrors();
verifyNoActionMessages();
verifyForward(ActionForwards.load_success.toString());
FeeParameters feeParameters = (FeeParameters) request.getSession().getAttribute(FeeParameters.class.getSimpleName());
Assert.assertEquals("The size of master data for categories", feeParameters.getCategories().size(), 5);
Assert.assertEquals("The size of master data for loan time of charges for one time fees : ", feeParameters.getTimesOfCharging().size(), 3);
Assert.assertEquals("The size of master data for customer time of charges for one time fees master : ", feeParameters.getTimesOfChargingCustomers().size(), 1);
Assert.assertEquals("The size of master data for loan formula : ", feeParameters.getFormulas().size(), 3);
Assert.assertEquals("The size of master data for GLCodes of fees : ", feeParameters.getGlCodes().size(), 7);
}
Aggregations