Search in sources :

Example 1 with ChartOfAccountsCache

use of org.mifos.accounts.financial.util.helpers.ChartOfAccountsCache in project head by mifos.

the class SavingsCloseTest method setupChartOfAccountsAndFinancialTransactions.

@BeforeClass
public static void setupChartOfAccountsAndFinancialTransactions() {
    defaultCurrency = TestUtils.RUPEE;
    Money.setDefaultCurrency(defaultCurrency);
    Short glcodeId = Short.valueOf("1");
    String glcode = "123456";
    GLCodeEntity glCodeEntity = new GLCodeEntity(glcodeId, glcode);
    COABO coabo = new COABO("testAccountName", glCodeEntity);
    ChartOfAccountsCache chartOfAccountsCache = new ChartOfAccountsCache();
    chartOfAccountsCache.clear();
    chartOfAccountsCache.add(coabo);
    Map<FinancialActionConstants, String> actionToCreditAccount = new HashMap<FinancialActionConstants, String>();
    actionToCreditAccount.put(FinancialActionConstants.SAVINGS_INTERESTPOSTING, glcode);
    actionToCreditAccount.put(FinancialActionConstants.MANDATORYDEPOSIT, glcode);
    actionToCreditAccount.put(FinancialActionConstants.MANDATORYWITHDRAWAL, glcode);
    actionToCreditAccount.put(FinancialActionConstants.MANDATORYDEPOSIT_ADJUSTMENT, glcode);
    actionToCreditAccount.put(FinancialActionConstants.MANDATORYWITHDRAWAL_ADJUSTMENT, glcode);
    actionToCreditAccount.put(FinancialActionConstants.ROUNDING, glcode);
    FinancialRules.getInstance().setActionToCreditAccount(actionToCreditAccount);
    Map<FinancialActionConstants, String> actionToDebitAccount = new HashMap<FinancialActionConstants, String>();
    actionToDebitAccount.put(FinancialActionConstants.SAVINGS_INTERESTPOSTING, glcode);
    actionToDebitAccount.put(FinancialActionConstants.MANDATORYDEPOSIT, glcode);
    actionToDebitAccount.put(FinancialActionConstants.MANDATORYWITHDRAWAL, glcode);
    actionToDebitAccount.put(FinancialActionConstants.MANDATORYDEPOSIT_ADJUSTMENT, glcode);
    actionToDebitAccount.put(FinancialActionConstants.MANDATORYWITHDRAWAL_ADJUSTMENT, glcode);
    actionToDebitAccount.put(FinancialActionConstants.ROUNDING, glcode);
    FinancialRules.getInstance().setActionToDebitAccount(actionToDebitAccount);
    FinancialActionTypeEntity roundingAction = new FinancialActionTypeEntity();
    roundingAction.setId(FinancialActionConstants.ROUNDING.getValue());
    FinancialActionTypeEntity depositAction = new FinancialActionTypeEntity();
    depositAction.setId(FinancialActionConstants.MANDATORYDEPOSIT.getValue());
    FinancialActionTypeEntity withdrawalAction = new FinancialActionTypeEntity();
    withdrawalAction.setId(FinancialActionConstants.MANDATORYWITHDRAWAL.getValue());
    FinancialActionTypeEntity depositAdjustmentAction = new FinancialActionTypeEntity();
    depositAdjustmentAction.setId(FinancialActionConstants.MANDATORYDEPOSIT_ADJUSTMENT.getValue());
    FinancialActionTypeEntity withdrawalAdjustmentAction = new FinancialActionTypeEntity();
    withdrawalAdjustmentAction.setId(FinancialActionConstants.MANDATORYWITHDRAWAL_ADJUSTMENT.getValue());
    FinancialActionTypeEntity interestPostingAction = new FinancialActionTypeEntity();
    interestPostingAction.setId(FinancialActionConstants.SAVINGS_INTERESTPOSTING.getValue());
    FinancialActionCache.addToCache(depositAction);
    FinancialActionCache.addToCache(withdrawalAction);
    FinancialActionCache.addToCache(depositAdjustmentAction);
    FinancialActionCache.addToCache(withdrawalAdjustmentAction);
    FinancialActionCache.addToCache(interestPostingAction);
    FinancialActionCache.addToCache(roundingAction);
}
Also used : FinancialActionConstants(org.mifos.accounts.financial.util.helpers.FinancialActionConstants) FinancialActionTypeEntity(org.mifos.accounts.financial.business.FinancialActionTypeEntity) HashMap(java.util.HashMap) ChartOfAccountsCache(org.mifos.accounts.financial.util.helpers.ChartOfAccountsCache) COABO(org.mifos.accounts.financial.business.COABO) GLCodeEntity(org.mifos.accounts.financial.business.GLCodeEntity) BeforeClass(org.junit.BeforeClass)

Example 2 with ChartOfAccountsCache

use of org.mifos.accounts.financial.util.helpers.ChartOfAccountsCache in project head by mifos.

the class SavingsAdjustmentTest method setupChartOfAccountsAndFinancialTransactions.

@BeforeClass
public static void setupChartOfAccountsAndFinancialTransactions() {
    defaultCurrency = TestUtils.RUPEE;
    Money.setDefaultCurrency(defaultCurrency);
    Short glcodeId = Short.valueOf("1");
    String glcode = "123456";
    GLCodeEntity glCodeEntity = new GLCodeEntity(glcodeId, glcode);
    COABO coabo = new COABO("testAccountName", glCodeEntity);
    ChartOfAccountsCache chartOfAccountsCache = new ChartOfAccountsCache();
    chartOfAccountsCache.clear();
    chartOfAccountsCache.add(coabo);
    Map<FinancialActionConstants, String> actionToCreditAccount = new HashMap<FinancialActionConstants, String>();
    actionToCreditAccount.put(FinancialActionConstants.MANDATORYDEPOSIT, glcode);
    actionToCreditAccount.put(FinancialActionConstants.MANDATORYWITHDRAWAL, glcode);
    actionToCreditAccount.put(FinancialActionConstants.MANDATORYDEPOSIT_ADJUSTMENT, glcode);
    actionToCreditAccount.put(FinancialActionConstants.MANDATORYWITHDRAWAL_ADJUSTMENT, glcode);
    FinancialRules.getInstance().setActionToCreditAccount(actionToCreditAccount);
    Map<FinancialActionConstants, String> actionToDebitAccount = new HashMap<FinancialActionConstants, String>();
    actionToDebitAccount.put(FinancialActionConstants.MANDATORYDEPOSIT, glcode);
    actionToDebitAccount.put(FinancialActionConstants.MANDATORYWITHDRAWAL, glcode);
    actionToDebitAccount.put(FinancialActionConstants.MANDATORYDEPOSIT_ADJUSTMENT, glcode);
    actionToDebitAccount.put(FinancialActionConstants.MANDATORYWITHDRAWAL_ADJUSTMENT, glcode);
    FinancialRules.getInstance().setActionToDebitAccount(actionToDebitAccount);
    FinancialActionTypeEntity depositAction = new FinancialActionTypeEntity();
    depositAction.setId(FinancialActionConstants.MANDATORYDEPOSIT.getValue());
    FinancialActionTypeEntity withdrawalAction = new FinancialActionTypeEntity();
    withdrawalAction.setId(FinancialActionConstants.MANDATORYWITHDRAWAL.getValue());
    FinancialActionTypeEntity depositAdjustmentAction = new FinancialActionTypeEntity();
    depositAdjustmentAction.setId(FinancialActionConstants.MANDATORYDEPOSIT_ADJUSTMENT.getValue());
    FinancialActionTypeEntity withdrawalAdjustmentAction = new FinancialActionTypeEntity();
    withdrawalAdjustmentAction.setId(FinancialActionConstants.MANDATORYWITHDRAWAL_ADJUSTMENT.getValue());
    FinancialActionCache.addToCache(depositAction);
    FinancialActionCache.addToCache(withdrawalAction);
    FinancialActionCache.addToCache(depositAdjustmentAction);
    FinancialActionCache.addToCache(withdrawalAdjustmentAction);
}
Also used : FinancialActionConstants(org.mifos.accounts.financial.util.helpers.FinancialActionConstants) FinancialActionTypeEntity(org.mifos.accounts.financial.business.FinancialActionTypeEntity) HashMap(java.util.HashMap) ChartOfAccountsCache(org.mifos.accounts.financial.util.helpers.ChartOfAccountsCache) COABO(org.mifos.accounts.financial.business.COABO) GLCodeEntity(org.mifos.accounts.financial.business.GLCodeEntity) BeforeClass(org.junit.BeforeClass)

Aggregations

HashMap (java.util.HashMap)2 BeforeClass (org.junit.BeforeClass)2 COABO (org.mifos.accounts.financial.business.COABO)2 FinancialActionTypeEntity (org.mifos.accounts.financial.business.FinancialActionTypeEntity)2 GLCodeEntity (org.mifos.accounts.financial.business.GLCodeEntity)2 ChartOfAccountsCache (org.mifos.accounts.financial.util.helpers.ChartOfAccountsCache)2 FinancialActionConstants (org.mifos.accounts.financial.util.helpers.FinancialActionConstants)2