use of org.mifos.accounts.financial.business.COABO in project head by mifos.
the class ChartOfAccountsCacheTest method testTopLevelAccountCached.
public void testTopLevelAccountCached() throws Exception {
LegacyAccountDao ap = createMockAccountPersistance();
COABO income = ap.getCategory(GLCategoryType.INCOME);
COABO cachedIncome = ChartOfAccountsCache.get(INCOME_GL_ACCOUNT_CODE);
Assert.assertEquals(income, cachedIncome);
}
use of org.mifos.accounts.financial.business.COABO in project head by mifos.
the class FinancialInitializerIntegrationTest method testAssetsCategoryIsCached.
@Test
public void testAssetsCategoryIsCached() throws Exception {
String assetsGlCode = "10000";
COABO account1 = ChartOfAccountsCache.get(assetsGlCode);
Assert.assertEquals(GLCategoryType.ASSET, account1.getCategoryType());
}
use of org.mifos.accounts.financial.business.COABO in project head by mifos.
the class InterestPostingAccountingEntryTest method makeChildCoaboOf.
/**
* Establish child-parent relationship between two COABO instances.
*
* <p>
* ASSUMPTION: the parentCoa's hierarchy has been created. In other words, build the hierarchy from top down.
*
* @throws RuntimeException if parentCoa has no associated COAHierarchy.
*/
protected COABO makeChildCoaboOf(COABO parentCoa, Short accountId, String accountName, String glCode) {
COAHierarchyEntity parentCoah = parentCoa.getCoaHierarchy();
if (parentCoah == null) {
throw new RuntimeException("ParentCoa.coaHierarchy has not been defined");
}
COABO childCoa = new COABO(accountId, accountName, new GLCodeEntity(accountId, glCode));
COAHierarchyEntity hierarchy = new COAHierarchyEntity(childCoa, parentCoa.getCoaHierarchy());
childCoa.setCoaHierarchy(hierarchy);
return childCoa;
}
use of org.mifos.accounts.financial.business.COABO in project head by mifos.
the class LegacyAccountDaoIntegrationTest method testTopLevelAccountPersisted.
@Test
public void testTopLevelAccountPersisted() throws Exception {
COABO incomeCategory = legacyAccountDao.getCategory(GLCategoryType.INCOME);
Assert.assertEquals(GLCategoryType.INCOME, incomeCategory.getCategoryType());
}
use of org.mifos.accounts.financial.business.COABO in project head by mifos.
the class LegacyAccountDaoIntegrationTest method testAddGlAccount.
@Test
public void testAddGlAccount() {
String name = "New Account Name";
String glCode = "999999";
String parentGlCode = ASSETS_GL_ACCOUNT_CODE;
COABO coa = legacyAccountDao.addGeneralLedgerAccount(name, glCode, parentGlCode, null);
Assert.assertEquals(coa.getAccountId(), legacyAccountDao.getAccountIdFromGlCode(glCode));
}
Aggregations