Search in sources :

Example 6 with FinancialActionTypeEntity

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

the class CustomerPenaltyAdjustmentAccountingEntry method applySpecificAccountActionEntry.

@Override
protected void applySpecificAccountActionEntry() throws FinancialException {
    CustomerTrxnDetailEntity customertrxn = (CustomerTrxnDetailEntity) financialActivity.getAccountTrxn();
    FinancialActionTypeEntity finActionMiscPenalty = FinancialActionCache.getFinancialAction(FinancialActionConstants.MISCPENALTYPOSTING);
    addAccountEntryDetails(customertrxn.getMiscPenaltyAmount(), finActionMiscPenalty, getGLcode(finActionMiscPenalty.getApplicableDebitCharts()), FinancialConstants.CREDIT);
    addAccountEntryDetails(customertrxn.getMiscPenaltyAmount(), finActionMiscPenalty, getGLcode(finActionMiscPenalty.getApplicableCreditCharts()), FinancialConstants.DEBIT);
}
Also used : CustomerTrxnDetailEntity(org.mifos.customers.business.CustomerTrxnDetailEntity) FinancialActionTypeEntity(org.mifos.accounts.financial.business.FinancialActionTypeEntity)

Example 7 with FinancialActionTypeEntity

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

the class DepositAccountingEntry method applySpecificAccountActionEntry.

@Override
protected void applySpecificAccountActionEntry() throws FinancialException {
    SavingsTrxnDetailEntity savingsTrxn = (SavingsTrxnDetailEntity) financialActivity.getAccountTrxn();
    SavingsBO savings = (SavingsBO) savingsTrxn.getAccount();
    FinancialActionTypeEntity finActionDeposit = null;
    if (savings.isMandatory()) {
        finActionDeposit = getFinancialAction(FinancialActionConstants.MANDATORYDEPOSIT);
    } else if (savings.isVoluntary()) {
        finActionDeposit = getFinancialAction(FinancialActionConstants.VOLUNTARYDEPOSIT);
    }
    addAccountEntryDetails(savingsTrxn.getDepositAmount(), finActionDeposit, getGLcode(finActionDeposit.getApplicableDebitCharts()), FinancialConstants.DEBIT);
    addAccountEntryDetails(savingsTrxn.getDepositAmount(), finActionDeposit, savings.getSavingsOffering().getDepositGLCode(), 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 8 with FinancialActionTypeEntity

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

the class DisbursalAmountReversalAccountingEntry method applySpecificAccountActionEntry.

@Override
protected void applySpecificAccountActionEntry() throws FinancialException {
    LoanTrxnDetailEntity loanTrxn = (LoanTrxnDetailEntity) financialActivity.getAccountTrxn();
    FinancialActionTypeEntity finloanDibursal = getFinancialAction(FinancialActionConstants.DISBURSAL);
    // debit take form the prd offering
    GLCodeEntity glcodeDebit = ((LoanBO) loanTrxn.getAccount()).getLoanOffering().getPrincipalGLcode();
    addAccountEntryDetails(loanTrxn.getAmount(), finloanDibursal, glcodeDebit, FinancialConstants.CREDIT);
    addAccountEntryDetails(loanTrxn.getAmount(), finloanDibursal, getGLcode(finloanDibursal.getApplicableCreditCharts()), FinancialConstants.DEBIT);
}
Also used : FinancialActionTypeEntity(org.mifos.accounts.financial.business.FinancialActionTypeEntity) GLCodeEntity(org.mifos.accounts.financial.business.GLCodeEntity) LoanTrxnDetailEntity(org.mifos.accounts.loan.business.LoanTrxnDetailEntity)

Example 9 with FinancialActionTypeEntity

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

the class DisbursementAccountingEntry method applySpecificAccountActionEntry.

@Override
protected void applySpecificAccountActionEntry() throws FinancialException {
    LoanTrxnDetailEntity loanTrxn = (LoanTrxnDetailEntity) financialActivity.getAccountTrxn();
    FinancialActionTypeEntity finloanDibursal = getFinancialAction(FinancialActionConstants.DISBURSAL);
    // debit take form the prd offering
    GLCodeEntity glcodeDebit = ((LoanBO) loanTrxn.getAccount()).getLoanOffering().getPrincipalGLcode();
    addAccountEntryDetails(loanTrxn.getAmount(), finloanDibursal, glcodeDebit, FinancialConstants.DEBIT);
    Set<COABO> creditCharts = finloanDibursal.getApplicableCreditCharts();
    GLCodeEntity glcodeCredit = getGLcode(creditCharts);
    addAccountEntryDetails(loanTrxn.getAmount(), finloanDibursal, glcodeCredit, FinancialConstants.CREDIT);
}
Also used : FinancialActionTypeEntity(org.mifos.accounts.financial.business.FinancialActionTypeEntity) COABO(org.mifos.accounts.financial.business.COABO) GLCodeEntity(org.mifos.accounts.financial.business.GLCodeEntity) LoanTrxnDetailEntity(org.mifos.accounts.loan.business.LoanTrxnDetailEntity)

Example 10 with FinancialActionTypeEntity

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

the class FeesAdjustmentAccountingEntry method applySpecificAccountActionEntry.

@Override
protected void applySpecificAccountActionEntry() throws FinancialException {
    LoanTrxnDetailEntity loanTrxn = (LoanTrxnDetailEntity) financialActivity.getAccountTrxn();
    Set<FeesTrxnDetailEntity> feesTrxn = loanTrxn.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.MISCFEEPOSTING);
    addAccountEntryDetails(loanTrxn.getMiscFeeAmount(), finActionMiscFee, getGLcode(finActionMiscFee.getApplicableDebitCharts()), FinancialConstants.CREDIT);
    addAccountEntryDetails(loanTrxn.getMiscFeeAmount(), finActionMiscFee, getGLcode(finActionMiscFee.getApplicableCreditCharts()), FinancialConstants.DEBIT);
}
Also used : FinancialActionTypeEntity(org.mifos.accounts.financial.business.FinancialActionTypeEntity) LoanTrxnDetailEntity(org.mifos.accounts.loan.business.LoanTrxnDetailEntity) 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