use of org.mifos.accounts.financial.business.FinancialActionTypeEntity in project head by mifos.
the class InterestPostingAccountingEntry method applySpecificAccountActionEntry.
@Override
protected void applySpecificAccountActionEntry() throws FinancialException {
SavingsTrxnDetailEntity savingsTrxn = (SavingsTrxnDetailEntity) financialActivity.getAccountTrxn();
FinancialActionTypeEntity finIntPostingAction = getFinancialAction(FinancialActionConstants.SAVINGS_INTERESTPOSTING);
SavingsOfferingBO savingsOffering = ((SavingsBO) savingsTrxn.getAccount()).getSavingsOffering();
addAccountEntryDetails(savingsTrxn.getInterestAmount(), finIntPostingAction, savingsOffering.getInterestGLCode(), FinancialConstants.DEBIT);
addAccountEntryDetails(savingsTrxn.getInterestAmount(), finIntPostingAction, savingsOffering.getDepositGLCode(), FinancialConstants.CREDIT);
}
use of org.mifos.accounts.financial.business.FinancialActionTypeEntity in project head by mifos.
the class PenaltyAdjustmentAccountingEntry method applySpecificAccountActionEntry.
@Override
protected void applySpecificAccountActionEntry() throws FinancialException {
Money amount = financialActivity.getMiscPenaltyAmount();
FinancialActionTypeEntity finActionMiscPenalty = FinancialActionCache.getFinancialAction(FinancialActionConstants.MISCPENALTYPOSTING);
addAccountEntryDetails(amount, finActionMiscPenalty, getGLcode(finActionMiscPenalty.getApplicableDebitCharts()), FinancialConstants.CREDIT);
addAccountEntryDetails(amount, finActionMiscPenalty, getGLcode(finActionMiscPenalty.getApplicableCreditCharts()), FinancialConstants.DEBIT);
}
use of org.mifos.accounts.financial.business.FinancialActionTypeEntity 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.business.FinancialActionTypeEntity in project head by mifos.
the class FinancialInitializerIntegrationTest method testFinancialActionInitializer.
@Test
public void testFinancialActionInitializer() throws FinancialException {
FinancialInitializer.initalizeFinancialAction();
FinancialActionTypeEntity financialActionPrincipal = FinancialActionCache.getFinancialAction(FinancialActionConstants.PRINCIPALPOSTING);
Assert.assertEquals(financialActionPrincipal.getId().shortValue(), FinancialActionConstants.PRINCIPALPOSTING.value);
}
use of org.mifos.accounts.financial.business.FinancialActionTypeEntity in project head by mifos.
the class FinancialBusinessService method getGLCodes.
/**
* @deprecated - use {@link GeneralLedgerDao#retreiveGlCodesBy(FinancialActionConstants, FinancialConstants)}
*/
@Deprecated
public List<GLCodeEntity> getGLCodes(FinancialActionConstants financialAction, FinancialConstants debitCredit) throws SystemException, ApplicationException {
List<GLCodeEntity> glCodeList = new ArrayList<GLCodeEntity>();
Set<COABO> applicableCategory = null;
FinancialActionTypeEntity finActionFees = FinancialActionCache.getFinancialAction(financialAction);
if (debitCredit.equals(FinancialConstants.DEBIT)) {
applicableCategory = finActionFees.getApplicableDebitCharts();
} else if (debitCredit.equals(FinancialConstants.CREDIT)) {
applicableCategory = finActionFees.getApplicableCreditCharts();
}
for (COABO chartOfAccounts : applicableCategory) {
GLCodeEntity codeEntity = new GLCodeEntity(chartOfAccounts.getAssociatedGlcode().getGlcodeId(), chartOfAccounts.getAssociatedGlcode().getGlcode(), chartOfAccounts.getAssociatedGlcode().getAssociatedCOA());
glCodeList.add(codeEntity);
}
return glCodeList;
}
Aggregations