use of org.mifos.accounts.financial.business.GLCodeEntity 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);
}
use of org.mifos.accounts.financial.business.GLCodeEntity in project head by mifos.
the class FeeInstallmentTest method createWeeklyFeeBO.
private FeeBO createWeeklyFeeBO(int every) {
MeetingBO feeMeeting = new MeetingBuilder().every(every).weekly().build();
FeeBO feeBO = new AmountFeeBO(new Money(TestUtils.RUPEE, "10.0"), "Fee", FeeCategory.ALLCUSTOMERS, FeeFrequencyType.PERIODIC, new GLCodeEntity(Short.valueOf("1"), "10000"), feeMeeting, null, new DateTime().minusDays(14).toDate(), TestUtils.makeUserWithLocales().getId());
return feeBO;
}
use of org.mifos.accounts.financial.business.GLCodeEntity in project head by mifos.
the class LoanPrdAction method findGLCodeEntity.
@SuppressWarnings("unchecked")
private GLCodeEntity findGLCodeEntity(HttpServletRequest request, String collectionName, String value) throws PageExpiredException {
logger.debug("start findGLCodeEntity method of Loan Product Action ");
List<GLCodeEntity> glCodeList = (List<GLCodeEntity>) SessionUtils.getAttribute(collectionName, request);
for (GLCodeEntity glCode : glCodeList) {
if (glCode.getGlcodeId().equals(getShortValue(value))) {
return glCode;
}
}
return null;
}
use of org.mifos.accounts.financial.business.GLCodeEntity 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.accounts.financial.business.GLCodeEntity in project head by mifos.
the class GeneralLedgerDaoHibernate method retreiveGlCodesBy.
@Override
public List<GLCodeEntity> retreiveGlCodesBy(FinancialActionConstants financialTransactionType, FinancialConstants debitOrCredit) throws FinancialException {
List<GLCodeEntity> glCodeList = new ArrayList<GLCodeEntity>();
Set<COABO> applicableCategory = null;
FinancialActionTypeEntity finActionFees = FinancialActionCache.getFinancialAction(financialTransactionType);
if (debitOrCredit.equals(FinancialConstants.DEBIT)) {
applicableCategory = finActionFees.getApplicableDebitCharts();
} else if (debitOrCredit.equals(FinancialConstants.CREDIT)) {
applicableCategory = finActionFees.getApplicableCreditCharts();
}
for (COABO chartOfAccounts : applicableCategory) {
glCodeList.add(chartOfAccounts.getAssociatedGlcode());
}
return glCodeList;
}
Aggregations