Search in sources :

Example 1 with PenaltyStatusEntity

use of org.mifos.accounts.penalties.business.PenaltyStatusEntity in project head by mifos.

the class WebTierPenaltyServiceFacade method getPenaltyParameters.

@Override
public PenaltyParametersDto getPenaltyParameters() {
    try {
        List<GLCodeEntity> glCodes = generalLedgerDao.retreiveGlCodesBy(FinancialActionConstants.PENALTYPOSTING, FinancialConstants.CREDIT);
        List<PenaltyCategoryEntity> categories = this.penaltyDao.getPenaltiesCategories();
        List<PenaltyPeriodEntity> periods = this.penaltyDao.getPenaltiesPeriods();
        List<PenaltyFormulaEntity> formulas = this.penaltyDao.getPenaltiesFormulas();
        List<PenaltyFrequencyEntity> frequencies = this.penaltyDao.getPenaltiesFrequencies();
        List<PenaltyStatusEntity> statuses = this.penaltyDao.getPenaltiesStatuses();
        return new PenaltyParametersDto(listToMap(categories), listToMap(statuses), listToMap(periods), listToMap(formulas), listToMap(frequencies), glCodesToMap(glCodes));
    } catch (FinancialException e) {
        throw new BusinessRuleException(e.getKey(), e);
    }
}
Also used : PenaltyStatusEntity(org.mifos.accounts.penalties.business.PenaltyStatusEntity) GLCodeEntity(org.mifos.accounts.financial.business.GLCodeEntity) PenaltyPeriodEntity(org.mifos.accounts.penalties.business.PenaltyPeriodEntity) PenaltyCategoryEntity(org.mifos.accounts.penalties.business.PenaltyCategoryEntity) BusinessRuleException(org.mifos.service.BusinessRuleException) PenaltyFrequencyEntity(org.mifos.accounts.penalties.business.PenaltyFrequencyEntity) FinancialException(org.mifos.accounts.financial.exceptions.FinancialException) PenaltyParametersDto(org.mifos.dto.screen.PenaltyParametersDto) PenaltyFormulaEntity(org.mifos.accounts.penalties.business.PenaltyFormulaEntity)

Example 2 with PenaltyStatusEntity

use of org.mifos.accounts.penalties.business.PenaltyStatusEntity in project head by mifos.

the class PenaltyDaoHibernateIntegrationTest method cleanDatabaseTables.

@Before
public void cleanDatabaseTables() throws Exception {
    databaseCleaner.clean();
    periodEntity = new PenaltyPeriodEntity(PenaltyPeriod.INSTALLMENTS);
    statusEntity = new PenaltyStatusEntity(PenaltyStatus.ACTIVE);
    categoryEntity = new PenaltyCategoryEntity(PenaltyCategory.LOAN);
    frequencyEntity = new PenaltyFrequencyEntity(PenaltyFrequency.NONE);
    formulaEntity = new PenaltyFormulaEntity(PenaltyFormula.OUTSTANDING_LOAN_AMOUNT);
    glCodeEntity = new GLCodeEntity((short) 42, "31102");
    amountPenalty = new AmountPenaltyBO(TestUtils.makeUser(), "Amount Penalty Test", new PenaltyCategoryEntity(PenaltyCategory.SAVING), periodEntity, 6, 1.0, 14.0, frequencyEntity, glCodeEntity, TestUtils.createMoney(158.5));
    ratePenalty = new RatePenaltyBO(TestUtils.makeUser(), "Rate Penalty Test", categoryEntity, periodEntity, 6, 1.0, 10.0, frequencyEntity, glCodeEntity, formulaEntity, 10.5);
    IntegrationTestObjectMother.createPenalty(amountPenalty);
    IntegrationTestObjectMother.createPenalty(ratePenalty);
}
Also used : RatePenaltyBO(org.mifos.accounts.penalties.business.RatePenaltyBO) PenaltyCategoryEntity(org.mifos.accounts.penalties.business.PenaltyCategoryEntity) PenaltyFrequencyEntity(org.mifos.accounts.penalties.business.PenaltyFrequencyEntity) PenaltyStatusEntity(org.mifos.accounts.penalties.business.PenaltyStatusEntity) AmountPenaltyBO(org.mifos.accounts.penalties.business.AmountPenaltyBO) GLCodeEntity(org.mifos.accounts.financial.business.GLCodeEntity) PenaltyPeriodEntity(org.mifos.accounts.penalties.business.PenaltyPeriodEntity) PenaltyFormulaEntity(org.mifos.accounts.penalties.business.PenaltyFormulaEntity) Before(org.junit.Before)

Example 3 with PenaltyStatusEntity

use of org.mifos.accounts.penalties.business.PenaltyStatusEntity in project head by mifos.

the class PenaltyDaoHibernateIntegrationTest method shouldFindPenaltyStatusEntityByType.

@Test
public void shouldFindPenaltyStatusEntityByType() throws Exception {
    PenaltyStatusEntity found = penaltyDao.findPenaltyStatusEntityByType(statusEntity.getPenaltyStatus());
    assertThat(found.getId(), is(statusEntity.getId()));
}
Also used : PenaltyStatusEntity(org.mifos.accounts.penalties.business.PenaltyStatusEntity) Test(org.junit.Test)

Aggregations

PenaltyStatusEntity (org.mifos.accounts.penalties.business.PenaltyStatusEntity)3 GLCodeEntity (org.mifos.accounts.financial.business.GLCodeEntity)2 PenaltyCategoryEntity (org.mifos.accounts.penalties.business.PenaltyCategoryEntity)2 PenaltyFormulaEntity (org.mifos.accounts.penalties.business.PenaltyFormulaEntity)2 PenaltyFrequencyEntity (org.mifos.accounts.penalties.business.PenaltyFrequencyEntity)2 PenaltyPeriodEntity (org.mifos.accounts.penalties.business.PenaltyPeriodEntity)2 Before (org.junit.Before)1 Test (org.junit.Test)1 FinancialException (org.mifos.accounts.financial.exceptions.FinancialException)1 AmountPenaltyBO (org.mifos.accounts.penalties.business.AmountPenaltyBO)1 RatePenaltyBO (org.mifos.accounts.penalties.business.RatePenaltyBO)1 PenaltyParametersDto (org.mifos.dto.screen.PenaltyParametersDto)1 BusinessRuleException (org.mifos.service.BusinessRuleException)1