Search in sources :

Example 31 with FinancialActionTypeEntity

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

the class WriteOffAccountingEntry method applySpecificAccountActionEntry.

@Override
protected void applySpecificAccountActionEntry() throws FinancialException {
    LoanTrxnDetailEntity loanTrxn = (LoanTrxnDetailEntity) financialActivity.getAccountTrxn();
    FinancialActionTypeEntity finActionWriteOff = FinancialActionCache.getFinancialAction(FinancialActionConstants.WRITEOFF);
    addAccountEntryDetails(loanTrxn.getPrincipalAmount(), finActionWriteOff, getGLcode(finActionWriteOff.getApplicableDebitCharts()), FinancialConstants.DEBIT);
    GLCodeEntity glcodeCredit = ((LoanBO) loanTrxn.getAccount()).getLoanOffering().getPrincipalGLcode();
    addAccountEntryDetails(loanTrxn.getPrincipalAmount(), finActionWriteOff, glcodeCredit, FinancialConstants.CREDIT);
// no 999 account entries are made for write-off loans because if some
// payments have already been made
// the 999 account amount is probably very small and is ignored in 1.1
// release. In the future if we want to
// calculate the 999 amount in this case we need to store the raw amount
// for each installment.
}
Also used : FinancialActionTypeEntity(org.mifos.accounts.financial.business.FinancialActionTypeEntity) GLCodeEntity(org.mifos.accounts.financial.business.GLCodeEntity) LoanTrxnDetailEntity(org.mifos.accounts.loan.business.LoanTrxnDetailEntity)

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