use of org.mifos.accounts.financial.business.COABO in project head by mifos.
the class LegacyAccountDao method getCategory.
/**
* A "category" is a top-level general ledger account. Use this method to fetch a single, specific category from the
* database.
*/
public COABO getCategory(GLCategoryType categoryType) {
Query topLevelAccount = getSession().getNamedQuery(NamedQueryConstants.GET_TOP_LEVEL_ACCOUNT);
topLevelAccount.setParameter("categoryType", categoryType.toString());
return (COABO) topLevelAccount.uniqueResult();
}
use of org.mifos.accounts.financial.business.COABO in project head by mifos.
the class LegacyAccountDao method addAccountSubcategories.
private void addAccountSubcategories(XMLConfiguration config, COABO coa, String path) {
for (COABO subcat : coa.getSubCategoryCOABOs()) {
config.addProperty(path + "(-1)[@code]", subcat.getAssociatedGlcode().getGlcode());
config.addProperty(path + "[@name]", subcat.getAccountName());
addAccountSubcategories(config, subcat, path + GL_ACCOUNT_TAG);
}
}
use of org.mifos.accounts.financial.business.COABO in project head by mifos.
the class FinancialInitializer method cacheCOA.
/**
* Reads chart of accounts from the database and caches in memory.
*/
@SuppressWarnings("unchecked")
public static void cacheCOA() {
if (ChartOfAccountsCache.isInitialized()) {
return;
}
Session session = StaticHibernateUtil.getSessionTL();
Query query = session.getNamedQuery(NamedQueryConstants.GET_ALL_COA);
List<COABO> coaBoList = query.list();
for (COABO coabo : coaBoList) {
ChartOfAccountsCache.add(hibernateInitalize(coabo));
}
}
use of org.mifos.accounts.financial.business.COABO 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;
}
use of org.mifos.accounts.financial.business.COABO in project head by mifos.
the class DisbursementAccountingEntry method applySpecificAccountActionEntry.
@Override
protected void applySpecificAccountActionEntry() throws FinancialException {
LoanTrxnDetailEntity loanTrxn = (LoanTrxnDetailEntity) financialActivity.getAccountTrxn();
FinancialActionTypeEntity finloanDibursal = getFinancialAction(FinancialActionConstants.DISBURSAL);
// debit take form the prd offering
GLCodeEntity glcodeDebit = ((LoanBO) loanTrxn.getAccount()).getLoanOffering().getPrincipalGLcode();
addAccountEntryDetails(loanTrxn.getAmount(), finloanDibursal, glcodeDebit, FinancialConstants.DEBIT);
Set<COABO> creditCharts = finloanDibursal.getApplicableCreditCharts();
GLCodeEntity glcodeCredit = getGLcode(creditCharts);
addAccountEntryDetails(loanTrxn.getAmount(), finloanDibursal, glcodeCredit, FinancialConstants.CREDIT);
}
Aggregations