use of org.mifos.dto.domain.InstallmentDetailsDto in project head by mifos.
the class LoanAccountServiceFacadeWebTier method getOverDueInstallmentDetailsForGroupLoan.
//TODO
private InstallmentDetailsDto getOverDueInstallmentDetailsForGroupLoan(final List<List<AccountActionDateEntity>> overDueInstallmentList, final MifosCurrency currency) {
Money principalDue = new Money(currency);
Money interestDue = new Money(currency);
Money feesDue = new Money(currency);
Money penaltyDue = new Money(currency);
for (List<AccountActionDateEntity> member : overDueInstallmentList) {
for (AccountActionDateEntity accountActionDate : member) {
LoanScheduleEntity installment = (LoanScheduleEntity) accountActionDate;
principalDue = principalDue.add(installment.getPrincipalDue());
interestDue = interestDue.add(installment.getInterestDue());
feesDue = feesDue.add(installment.getTotalFeeDueWithMiscFeeDue());
penaltyDue = penaltyDue.add(installment.getPenaltyDue());
}
}
Money subTotal = principalDue.add(interestDue).add(feesDue).add(penaltyDue);
return new InstallmentDetailsDto(principalDue.toString(), interestDue.toString(), feesDue.toString(), penaltyDue.toString(), subTotal.toString());
}
Aggregations