use of org.mifos.accounts.financial.util.helpers.FinancialActionConstants in project head by mifos.
the class DepositAccountingEntryTest method testBuildAccountEntryDepositIntoVoluntarySavings.
@Test
public void testBuildAccountEntryDepositIntoVoluntarySavings() throws FinancialException {
SavingsType savingsType = SavingsType.VOLUNTARY;
GLCategoryType bankCategoryType = GLCategoryType.ASSET;
GLCategoryType savingsCategoryType = GLCategoryType.LIABILITY;
FinancialActionConstants financialActionConstant = FinancialActionConstants.VOLUNTARYDEPOSIT;
setupVoluntaryForOneTest(savingsType, bankCategoryType, savingsCategoryType, financialActionConstant);
doBuild(new DepositAccountingEntry(), mockedFinancialBusinessService, mockedFinancialActivity);
// verify the two transactions created
verifyCreatedTransactions(depositAmount, mockedFinancialActivity, mockedIncomingTransaction, mockedFinancialAction, mockedBankGLCode, mockedSavingsDepositGLCode, bankCategoryType, FinancialConstants.DEBIT, savingsCategoryType, FinancialConstants.CREDIT);
}
use of org.mifos.accounts.financial.util.helpers.FinancialActionConstants in project head by mifos.
the class InterestPostingAccountingEntryTest method setupAndInjectMocks.
@Before
public void setupAndInjectMocks() {
// Build a little Chart of Accounts
coaLiability = makeCategory((short) 1, GLCategoryType.LIABILITY, "22000");
coaSavingsInterestPayable = makeChildCoaboOf(coaLiability, (short) 2, "SavingsInterest Payable", "22100");
coaClientsSavings = makeChildCoaboOf(coaLiability, (short) 3, "ClientsSavings", "22200");
interestPostingAccountingEntry = new InterestPostingAccountingEntry() {
@Override
protected FinancialActionTypeEntity getFinancialAction(@SuppressWarnings("unused") final FinancialActionConstants financialActionId) throws FinancialException {
return financialAction;
}
@Override
protected COABO getChartOfAccountsEntry(final String glcode) throws FinancialException {
if (glcode.equals("22000")) {
return coaLiability;
} else if (glcode.equals("22100")) {
return coaSavingsInterestPayable;
} else if (glcode.equals("22200")) {
return coaClientsSavings;
} else {
throw new FinancialException("unexpected glcode: " + glcode);
}
}
};
}
use of org.mifos.accounts.financial.util.helpers.FinancialActionConstants in project head by mifos.
the class DepositAccountingEntryTest method testBuildAccountEntryDepositIntoMandatorySavings.
@Test
public void testBuildAccountEntryDepositIntoMandatorySavings() throws FinancialException {
SavingsType savingsType = SavingsType.MANDATORY;
GLCategoryType bankCategoryType = GLCategoryType.ASSET;
GLCategoryType savingsCategoryType = GLCategoryType.LIABILITY;
FinancialActionConstants financialActionConstant = FinancialActionConstants.MANDATORYDEPOSIT;
setupMandatoryForOneTest(savingsType, bankCategoryType, savingsCategoryType, financialActionConstant);
doBuild(new DepositAccountingEntry(), mockedFinancialBusinessService, mockedFinancialActivity);
verifyCreatedTransactions(depositAmount, mockedFinancialActivity, mockedIncomingTransaction, mockedFinancialAction, mockedBankGLCode, mockedSavingsDepositGLCode, bankCategoryType, FinancialConstants.DEBIT, savingsCategoryType, FinancialConstants.CREDIT);
}
use of org.mifos.accounts.financial.util.helpers.FinancialActionConstants 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.FinancialActionConstants 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