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);
}
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);
}
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);
}
}
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;
}
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);
}
Aggregations