use of org.mifos.accounts.business.FeesTrxnDetailEntity in project head by mifos.
the class LoanBO method addFeeTransactions.
private void addFeeTransactions(LoanTrxnDetailEntity loanTrxnDetailEntity, Set<AccountFeesActionDetailEntity> accountFeesActionDetails) {
for (AccountFeesActionDetailEntity accountFeesActionDetailEntity : accountFeesActionDetails) {
if (accountFeesActionDetailEntity.getFeeDue().isGreaterThanZero()) {
FeesTrxnDetailEntity feesTrxnDetailEntity = new FeesTrxnDetailEntity(loanTrxnDetailEntity, accountFeesActionDetailEntity.getAccountFee(), accountFeesActionDetailEntity.getFeeDue());
loanTrxnDetailEntity.addFeesTrxnDetail(feesTrxnDetailEntity);
}
}
}
use of org.mifos.accounts.business.FeesTrxnDetailEntity in project head by mifos.
the class CustomerAccountFeesAccountingEntry method applySpecificAccountActionEntry.
@Override
protected void applySpecificAccountActionEntry() throws FinancialException {
CustomerTrxnDetailEntity customertrxn = (CustomerTrxnDetailEntity) financialActivity.getAccountTrxn();
Set<FeesTrxnDetailEntity> feesTrxns = customertrxn.getFeesTrxnDetails();
FinancialActionTypeEntity finActionFee = getFinancialAction(FinancialActionConstants.FEEPOSTING);
for (FeesTrxnDetailEntity feeTrxn : feesTrxns) {
addAccountEntryDetails(feeTrxn.getFeeAmount(), finActionFee, feeTrxn.getAccountFees().getFees().getGlCode(), FinancialConstants.CREDIT);
addAccountEntryDetails(feeTrxn.getFeeAmount(), finActionFee, getGLcode(finActionFee.getApplicableDebitCharts()), FinancialConstants.DEBIT);
}
// For Misc Fee
FinancialActionTypeEntity finActionMiscFee = FinancialActionCache.getFinancialAction(FinancialActionConstants.CUSTOMERACCOUNTMISCFEESPOSTING);
addAccountEntryDetails(customertrxn.getMiscFeeAmount(), finActionMiscFee, getGLcode(finActionMiscFee.getApplicableDebitCharts()), FinancialConstants.DEBIT);
addAccountEntryDetails(customertrxn.getMiscFeeAmount(), finActionMiscFee, getGLcode(finActionMiscFee.getApplicableCreditCharts()), FinancialConstants.CREDIT);
}
use of org.mifos.accounts.business.FeesTrxnDetailEntity in project head by mifos.
the class FeesAccountingEntry 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.CREDIT);
addAccountEntryDetails(feeTrxn.getFeeAmount(), finActionFee, getGLcode(finActionFee.getApplicableDebitCharts()), FinancialConstants.DEBIT);
}
// For Misc Fee
FinancialActionTypeEntity finActionMiscFee = FinancialActionCache.getFinancialAction(FinancialActionConstants.MISCFEEPOSTING);
addAccountEntryDetails(loanTrxn.getMiscFeeAmount(), finActionMiscFee, getGLcode(finActionMiscFee.getApplicableDebitCharts()), FinancialConstants.DEBIT);
addAccountEntryDetails(loanTrxn.getMiscFeeAmount(), finActionMiscFee, getGLcode(finActionMiscFee.getApplicableCreditCharts()), FinancialConstants.CREDIT);
}
use of org.mifos.accounts.business.FeesTrxnDetailEntity in project head by mifos.
the class CustomerTrxnDetailEntity method generateReverseTrxn.
@Override
protected AccountTrxnEntity generateReverseTrxn(final PersonnelBO loggedInUser, final String adjustmentComment) throws AccountException {
logger.debug("Inside generate reverse transaction method of loan trxn detail");
String comment = null;
if (null == adjustmentComment) {
comment = getComments();
} else {
comment = adjustmentComment;
}
CustomerTrxnDetailEntity reverseAccntTrxn;
reverseAccntTrxn = new CustomerTrxnDetailEntity(getAccountPayment(), AccountActionTypes.CUSTOMER_ADJUSTMENT, getInstallmentId(), getDueDate(), loggedInUser, getActionDate(), getAmount().negate(), comment, this, getMiscFeeAmount().negate(), getMiscPenaltyAmount().negate());
if (null != getFeesTrxnDetails() && getFeesTrxnDetails().size() > 0) {
logger.debug("Before generating reverse entries for fees");
for (FeesTrxnDetailEntity feeTrxnDetail : getFeesTrxnDetails()) {
reverseAccntTrxn.addFeesTrxnDetail(feeTrxnDetail.generateReverseTrxn(reverseAccntTrxn));
}
logger.debug("after generating reverse entries for fees");
}
return reverseAccntTrxn;
}
use of org.mifos.accounts.business.FeesTrxnDetailEntity in project head by mifos.
the class FinancialBusinessServiceIntegrationTest method getAccountTrxnObj.
private AccountTrxnEntity getAccountTrxnObj(AccountPaymentEntity accountPaymentEntity) throws Exception {
Date currentDate = new Date(System.currentTimeMillis());
LoanScheduleEntity accountAction = (LoanScheduleEntity) loan.getAccountActionDate(Short.valueOf("1"));
LoanTrxnDetailEntity accountTrxnEntity = new LoanTrxnDetailEntity(accountPaymentEntity, AccountActionTypes.LOAN_ADJUSTMENT, Short.valueOf("1"), accountAction.getActionDate(), TestObjectFactory.getPersonnel(PersonnelConstants.SYSTEM_USER), currentDate, TestUtils.createMoney(630), "test for loan adjustment", null, TestUtils.createMoney(200), TestUtils.createMoney(300), TestUtils.createMoney(), TestUtils.createMoney(10), TestUtils.createMoney(20), null, null);
for (AccountFeesActionDetailEntity accountFeesActionDetailEntity : accountAction.getAccountFeesActionDetails()) {
LoanBOTestUtils.setFeeAmountPaid(accountFeesActionDetailEntity, TestUtils.createMoney(100));
FeesTrxnDetailEntity feeTrxn = new FeesTrxnDetailEntity(accountTrxnEntity, accountFeesActionDetailEntity.getAccountFee(), accountFeesActionDetailEntity.getFeeAmount());
accountTrxnEntity.addFeesTrxnDetail(feeTrxn);
}
return accountTrxnEntity;
}
Aggregations