Search in sources :

Example 11 with FinancialActionTypeEntity

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);
}
Also used : FinancialActionTypeEntity(org.mifos.accounts.financial.business.FinancialActionTypeEntity) SavingsOfferingBO(org.mifos.accounts.productdefinition.business.SavingsOfferingBO) SavingsBO(org.mifos.accounts.savings.business.SavingsBO) SavingsTrxnDetailEntity(org.mifos.accounts.savings.business.SavingsTrxnDetailEntity)

Example 12 with FinancialActionTypeEntity

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);
}
Also used : Money(org.mifos.framework.util.helpers.Money) FinancialActionTypeEntity(org.mifos.accounts.financial.business.FinancialActionTypeEntity)

Example 13 with FinancialActionTypeEntity

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);
            }
        }
    };
}
Also used : FinancialActionConstants(org.mifos.accounts.financial.util.helpers.FinancialActionConstants) FinancialActionTypeEntity(org.mifos.accounts.financial.business.FinancialActionTypeEntity) COABO(org.mifos.accounts.financial.business.COABO) FinancialException(org.mifos.accounts.financial.exceptions.FinancialException) Before(org.junit.Before)

Example 14 with FinancialActionTypeEntity

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);
}
Also used : FinancialActionTypeEntity(org.mifos.accounts.financial.business.FinancialActionTypeEntity) Test(org.junit.Test)

Example 15 with FinancialActionTypeEntity

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;
}
Also used : FinancialActionTypeEntity(org.mifos.accounts.financial.business.FinancialActionTypeEntity) COABO(org.mifos.accounts.financial.business.COABO) ArrayList(java.util.ArrayList) GLCodeEntity(org.mifos.accounts.financial.business.GLCodeEntity)

Aggregations

FinancialActionTypeEntity (org.mifos.accounts.financial.business.FinancialActionTypeEntity)31 GLCodeEntity (org.mifos.accounts.financial.business.GLCodeEntity)14 LoanTrxnDetailEntity (org.mifos.accounts.loan.business.LoanTrxnDetailEntity)10 Money (org.mifos.framework.util.helpers.Money)7 COABO (org.mifos.accounts.financial.business.COABO)6 LoanBO (org.mifos.accounts.loan.business.LoanBO)5 FeesTrxnDetailEntity (org.mifos.accounts.business.FeesTrxnDetailEntity)4 BeforeClass (org.junit.BeforeClass)3 FinancialActionConstants (org.mifos.accounts.financial.util.helpers.FinancialActionConstants)3 SavingsBO (org.mifos.accounts.savings.business.SavingsBO)3 SavingsTrxnDetailEntity (org.mifos.accounts.savings.business.SavingsTrxnDetailEntity)3 CustomerTrxnDetailEntity (org.mifos.customers.business.CustomerTrxnDetailEntity)3 ArrayList (java.util.ArrayList)2 HashMap (java.util.HashMap)2 Test (org.junit.Test)2 FinancialException (org.mifos.accounts.financial.exceptions.FinancialException)2 ChartOfAccountsCache (org.mifos.accounts.financial.util.helpers.ChartOfAccountsCache)2 IOException (java.io.IOException)1 Query (org.hibernate.Query)1 Session (org.hibernate.Session)1