Search in sources :

Example 6 with InstallmentDetailsDto

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());
}
Also used : LoanScheduleEntity(org.mifos.accounts.loan.business.LoanScheduleEntity) OriginalLoanScheduleEntity(org.mifos.accounts.loan.business.OriginalLoanScheduleEntity) Money(org.mifos.framework.util.helpers.Money) AccountActionDateEntity(org.mifos.accounts.business.AccountActionDateEntity) InstallmentDetailsDto(org.mifos.dto.domain.InstallmentDetailsDto) LoanInstallmentDetailsDto(org.mifos.dto.domain.LoanInstallmentDetailsDto)

Aggregations

InstallmentDetailsDto (org.mifos.dto.domain.InstallmentDetailsDto)6 AccountActionDateEntity (org.mifos.accounts.business.AccountActionDateEntity)5 LoanInstallmentDetailsDto (org.mifos.dto.domain.LoanInstallmentDetailsDto)5 Money (org.mifos.framework.util.helpers.Money)5 LoanScheduleEntity (org.mifos.accounts.loan.business.LoanScheduleEntity)4 OriginalLoanScheduleEntity (org.mifos.accounts.loan.business.OriginalLoanScheduleEntity)4 LoanBO (org.mifos.accounts.loan.business.LoanBO)2 ArrayList (java.util.ArrayList)1 Date (java.util.Date)1 List (java.util.List)1 Test (org.junit.Test)1 AccountException (org.mifos.accounts.exceptions.AccountException)1 UserContextFactory (org.mifos.accounts.servicefacade.UserContextFactory)1 MifosRuntimeException (org.mifos.core.MifosRuntimeException)1 MifosUser (org.mifos.security.MifosUser)1 UserContext (org.mifos.security.util.UserContext)1