Search in sources :

Example 11 with AccountFeesActionDetailEntity

use of org.mifos.accounts.business.AccountFeesActionDetailEntity 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);
        }
    }
}
Also used : AccountFeesActionDetailEntity(org.mifos.accounts.business.AccountFeesActionDetailEntity) FeesTrxnDetailEntity(org.mifos.accounts.business.FeesTrxnDetailEntity)

Example 12 with AccountFeesActionDetailEntity

use of org.mifos.accounts.business.AccountFeesActionDetailEntity in project head by mifos.

the class LoanScheduleEntity method payFees.

private Money payFees(final Money amount) {
    Money balance = amount;
    for (AccountFeesActionDetailEntity accountFeesActionDetailEntity : getAccountFeesActionDetails()) {
        balance = accountFeesActionDetailEntity.payFee(balance);
        Integer feeId = accountFeesActionDetailEntity.getAccountFeesActionDetailId();
        if (feeId == null) {
            // special workaround for MIFOS-4517
            feeId = accountFeesActionDetailEntity.hashCode();
        }
        Money feeAllocated = accountFeesActionDetailEntity.getFeeAllocated();
        paymentAllocation.allocateForFee(feeId, feeAllocated);
    }
    return balance;
}
Also used : Money(org.mifos.framework.util.helpers.Money) AccountFeesActionDetailEntity(org.mifos.accounts.business.AccountFeesActionDetailEntity)

Example 13 with AccountFeesActionDetailEntity

use of org.mifos.accounts.business.AccountFeesActionDetailEntity in project head by mifos.

the class LoanScheduleEntity method removeAllFees.

public void removeAllFees() {
    while (getAccountFeesActionDetails().iterator().hasNext()) {
        AccountFeesActionDetailEntity fee = getAccountFeesActionDetails().iterator().next();
        removeAccountFeesActionDetailEntity(fee);
    }
}
Also used : AccountFeesActionDetailEntity(org.mifos.accounts.business.AccountFeesActionDetailEntity)

Example 14 with AccountFeesActionDetailEntity

use of org.mifos.accounts.business.AccountFeesActionDetailEntity in project head by mifos.

the class CustomerScheduleEntity method applyPeriodicFees.

void applyPeriodicFees(Short feeId, Money totalAmount) {
    AccountFeesEntity accountFeesEntity = account.getAccountFees(feeId);
    AccountFeesActionDetailEntity accountFeesActionDetailEntity = new CustomerFeeScheduleEntity(this, accountFeesEntity.getFees(), accountFeesEntity, totalAmount);
    addAccountFeesAction(accountFeesActionDetailEntity);
}
Also used : AccountFeesActionDetailEntity(org.mifos.accounts.business.AccountFeesActionDetailEntity) AccountFeesEntity(org.mifos.accounts.business.AccountFeesEntity)

Example 15 with AccountFeesActionDetailEntity

use of org.mifos.accounts.business.AccountFeesActionDetailEntity in project head by mifos.

the class CustomerScheduleEntity method removeFees.

Money removeFees(Short feeId) {
    Money feeAmount = null;
    AccountFeesActionDetailEntity objectToRemove = null;
    Set<AccountFeesActionDetailEntity> accountFeesActionDetailSet = this.getAccountFeesActionDetails();
    for (AccountFeesActionDetailEntity accountFeesActionDetailEntity : accountFeesActionDetailSet) {
        if (accountFeesActionDetailEntity.getFee().getFeeId().equals(feeId)) {
            objectToRemove = accountFeesActionDetailEntity;
            break;
        }
    }
    if (objectToRemove != null) {
        feeAmount = objectToRemove.getFeeAmount();
        this.removeAccountFeesActionDetailEntity(objectToRemove);
    }
    return feeAmount;
}
Also used : Money(org.mifos.framework.util.helpers.Money) AccountFeesActionDetailEntity(org.mifos.accounts.business.AccountFeesActionDetailEntity)

Aggregations

AccountFeesActionDetailEntity (org.mifos.accounts.business.AccountFeesActionDetailEntity)39 Money (org.mifos.framework.util.helpers.Money)21 AccountFeesEntity (org.mifos.accounts.business.AccountFeesEntity)9 ArrayList (java.util.ArrayList)8 LoanScheduleEntity (org.mifos.accounts.loan.business.LoanScheduleEntity)8 AccountActionDateEntity (org.mifos.accounts.business.AccountActionDateEntity)7 BigDecimal (java.math.BigDecimal)6 FeesTrxnDetailEntity (org.mifos.accounts.business.FeesTrxnDetailEntity)6 Date (java.sql.Date)5 CustomerScheduleEntity (org.mifos.customers.business.CustomerScheduleEntity)5 Date (java.util.Date)4 LocalDate (org.joda.time.LocalDate)4 AccountPaymentEntity (org.mifos.accounts.business.AccountPaymentEntity)4 AccountException (org.mifos.accounts.exceptions.AccountException)4 FeeBO (org.mifos.accounts.fees.business.FeeBO)4 MeetingBO (org.mifos.application.meeting.business.MeetingBO)4 CustomerAccountBO (org.mifos.customers.business.CustomerAccountBO)4 Test (org.junit.Test)3 AccountTrxnEntity (org.mifos.accounts.business.AccountTrxnEntity)3 AmountFeeBO (org.mifos.accounts.fees.business.AmountFeeBO)3