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);
}
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);
}
Aggregations