Search in sources :

Example 1 with FinancialActionTypeEntity

use of org.mifos.accounts.financial.business.FinancialActionTypeEntity in project head by mifos.

the class SavingsPostInterestTest method setupMifosLoggerDueToUseOfStaticClientRules.

@BeforeClass
public static void setupMifosLoggerDueToUseOfStaticClientRules() {
    defaultCurrency = TestUtils.RUPEE;
    Money.setDefaultCurrency(defaultCurrency);
    FinancialActionTypeEntity financialAction = new FinancialActionTypeEntity();
    financialAction.setId(FinancialActionConstants.SAVINGS_INTERESTPOSTING.getValue());
    FinancialActionCache.addToCache(financialAction);
}
Also used : FinancialActionTypeEntity(org.mifos.accounts.financial.business.FinancialActionTypeEntity) BeforeClass(org.junit.BeforeClass)

Example 2 with FinancialActionTypeEntity

use of org.mifos.accounts.financial.business.FinancialActionTypeEntity in project head by mifos.

the class WithdrawalAccountingEntry method applySpecificAccountActionEntry.

@Override
protected void applySpecificAccountActionEntry() throws FinancialException {
    SavingsTrxnDetailEntity savingsTrxn = (SavingsTrxnDetailEntity) financialActivity.getAccountTrxn();
    SavingsBO savings = (SavingsBO) savingsTrxn.getAccount();
    FinancialActionTypeEntity finActionWithrawal = null;
    if (savings.isMandatory()) {
        finActionWithrawal = getFinancialAction(FinancialActionConstants.MANDATORYWITHDRAWAL);
    }
    if (savings.isVoluntary()) {
        finActionWithrawal = getFinancialAction(FinancialActionConstants.VOLUNTARYWITHDRAWAL);
    }
    if (savings.getState() == AccountState.SAVINGS_CLOSED) {
        handleRoundingForWithdrawal(savings, savingsTrxn);
    }
    addAccountEntryDetails(savingsTrxn.getWithdrawlAmount(), finActionWithrawal, savings.getSavingsOffering().getDepositGLCode(), FinancialConstants.DEBIT);
    addAccountEntryDetails(savingsTrxn.getWithdrawlAmount(), finActionWithrawal, getGLcode(finActionWithrawal.getApplicableCreditCharts()), FinancialConstants.CREDIT);
}
Also used : FinancialActionTypeEntity(org.mifos.accounts.financial.business.FinancialActionTypeEntity) SavingsBO(org.mifos.accounts.savings.business.SavingsBO) SavingsTrxnDetailEntity(org.mifos.accounts.savings.business.SavingsTrxnDetailEntity)

Example 3 with FinancialActionTypeEntity

use of org.mifos.accounts.financial.business.FinancialActionTypeEntity in project head by mifos.

the class FinancialInitializer method initalizeFinancialAction.

@SuppressWarnings("unchecked")
public static void initalizeFinancialAction() throws FinancialException {
    Session session = StaticHibernateUtil.getSessionTL();
    try {
        Query queryFinancialAction = session.getNamedQuery(FinancialQueryConstants.GET_ALL_FINANCIAL_ACTION);
        List<FinancialActionTypeEntity> listFinancialAction = queryFinancialAction.list();
        for (FinancialActionTypeEntity fabo : listFinancialAction) {
            FinancialActionCache.addToCache(fabo);
        }
    } catch (Exception e) {
        throw new FinancialException(FinancialExceptionConstants.FINANCIALACTION_INITFAILED, e);
    }
}
Also used : FinancialActionTypeEntity(org.mifos.accounts.financial.business.FinancialActionTypeEntity) Query(org.hibernate.Query) FinancialException(org.mifos.accounts.financial.exceptions.FinancialException) FinancialException(org.mifos.accounts.financial.exceptions.FinancialException) IOException(java.io.IOException) ConfigurationException(org.mifos.config.exceptions.ConfigurationException) Session(org.hibernate.Session)

Example 4 with FinancialActionTypeEntity

use of org.mifos.accounts.financial.business.FinancialActionTypeEntity in project head by mifos.

the class GeneralLedgerDaoHibernate method retreiveGlCodesBy.

@Override
public List<GLCodeEntity> retreiveGlCodesBy(FinancialActionConstants financialTransactionType, FinancialConstants debitOrCredit) throws FinancialException {
    List<GLCodeEntity> glCodeList = new ArrayList<GLCodeEntity>();
    Set<COABO> applicableCategory = null;
    FinancialActionTypeEntity finActionFees = FinancialActionCache.getFinancialAction(financialTransactionType);
    if (debitOrCredit.equals(FinancialConstants.DEBIT)) {
        applicableCategory = finActionFees.getApplicableDebitCharts();
    } else if (debitOrCredit.equals(FinancialConstants.CREDIT)) {
        applicableCategory = finActionFees.getApplicableCreditCharts();
    }
    for (COABO chartOfAccounts : applicableCategory) {
        glCodeList.add(chartOfAccounts.getAssociatedGlcode());
    }
    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)

Example 5 with FinancialActionTypeEntity

use of org.mifos.accounts.financial.business.FinancialActionTypeEntity in project head by mifos.

the class CustomerFeesAdjustmentAccountingEntry method applySpecificAccountActionEntry.

@Override
protected void applySpecificAccountActionEntry() throws FinancialException {
    CustomerTrxnDetailEntity customertrxn = (CustomerTrxnDetailEntity) financialActivity.getAccountTrxn();
    Set<FeesTrxnDetailEntity> feesTrxn = customertrxn.getFeesTrxnDetails();
    Iterator<FeesTrxnDetailEntity> iterFees = feesTrxn.iterator();
    FinancialActionTypeEntity finActionFee = getFinancialAction(FinancialActionConstants.FEEPOSTING);
    while (iterFees.hasNext()) {
        FeesTrxnDetailEntity feeTrxn = iterFees.next();
        addAccountEntryDetails(feeTrxn.getFeeAmount(), finActionFee, feeTrxn.getAccountFees().getFees().getGlCode(), FinancialConstants.DEBIT);
        addAccountEntryDetails(feeTrxn.getFeeAmount(), finActionFee, getGLcode(finActionFee.getApplicableDebitCharts()), FinancialConstants.CREDIT);
    }
    // For Misc Fee
    FinancialActionTypeEntity finActionMiscFee = FinancialActionCache.getFinancialAction(FinancialActionConstants.CUSTOMERACCOUNTMISCFEESPOSTING);
    addAccountEntryDetails(customertrxn.getMiscFeeAmount(), finActionMiscFee, getGLcode(finActionMiscFee.getApplicableDebitCharts()), FinancialConstants.CREDIT);
    addAccountEntryDetails(customertrxn.getMiscFeeAmount(), finActionMiscFee, getGLcode(finActionMiscFee.getApplicableCreditCharts()), FinancialConstants.DEBIT);
}
Also used : CustomerTrxnDetailEntity(org.mifos.customers.business.CustomerTrxnDetailEntity) FinancialActionTypeEntity(org.mifos.accounts.financial.business.FinancialActionTypeEntity) FeesTrxnDetailEntity(org.mifos.accounts.business.FeesTrxnDetailEntity)

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