Search in sources :

Example 1 with FeeParameters

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);
    }
}
Also used : MasterDataEntity(org.mifos.application.master.business.MasterDataEntity) ArrayList(java.util.ArrayList) GLCodeEntity(org.mifos.accounts.financial.business.GLCodeEntity) FeePaymentEntity(org.mifos.accounts.fees.business.FeePaymentEntity) BusinessRuleException(org.mifos.service.BusinessRuleException) FeeFormulaEntity(org.mifos.accounts.fees.business.FeeFormulaEntity) FeeFrequencyTypeEntity(org.mifos.accounts.fees.business.FeeFrequencyTypeEntity) CategoryTypeEntity(org.mifos.accounts.fees.business.CategoryTypeEntity) FinancialException(org.mifos.accounts.financial.exceptions.FinancialException) FeeParameters(org.mifos.dto.screen.FeeParameters)

Example 2 with FeeParameters

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);
}
Also used : FeeDetailsForLoadDto(org.mifos.dto.screen.FeeDetailsForLoadDto) FeeParameters(org.mifos.dto.screen.FeeParameters)

Example 3 with FeeParameters

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);
}
Also used : FeeParameters(org.mifos.dto.screen.FeeParameters) Test(org.junit.Test)

Aggregations

FeeParameters (org.mifos.dto.screen.FeeParameters)3 ArrayList (java.util.ArrayList)1 Test (org.junit.Test)1 CategoryTypeEntity (org.mifos.accounts.fees.business.CategoryTypeEntity)1 FeeFormulaEntity (org.mifos.accounts.fees.business.FeeFormulaEntity)1 FeeFrequencyTypeEntity (org.mifos.accounts.fees.business.FeeFrequencyTypeEntity)1 FeePaymentEntity (org.mifos.accounts.fees.business.FeePaymentEntity)1 GLCodeEntity (org.mifos.accounts.financial.business.GLCodeEntity)1 FinancialException (org.mifos.accounts.financial.exceptions.FinancialException)1 MasterDataEntity (org.mifos.application.master.business.MasterDataEntity)1 FeeDetailsForLoadDto (org.mifos.dto.screen.FeeDetailsForLoadDto)1 BusinessRuleException (org.mifos.service.BusinessRuleException)1