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