use of org.mifos.accounts.loan.util.helpers.RepaymentScheduleInstallment in project head by mifos.
the class InstallmentsValidatorImpl method validateInstallmentFormat.
private void validateInstallmentFormat(List<RepaymentScheduleInstallment> installments, Errors errors) {
for (RepaymentScheduleInstallment installment : installments) {
errors.addErrors(installmentFormatValidator.validateTotalAmountFormat(installment));
errors.addErrors(installmentFormatValidator.validateDueDateFormat(installment));
}
}
use of org.mifos.accounts.loan.util.helpers.RepaymentScheduleInstallment in project head by mifos.
the class ListOfInstallmentsValidatorImpl method getDueDateInstallmentsLookup.
private Map<Date, List<String>> getDueDateInstallmentsLookup(List<RepaymentScheduleInstallment> installments) {
Map<Date, List<String>> dateInstallmentsLookup = new LinkedHashMap<Date, List<String>>();
for (RepaymentScheduleInstallment installment : installments) {
Date key = installment.getDueDateValue();
String value = installment.getInstallmentNumberAsString();
CollectionUtils.addKeyValue(dateInstallmentsLookup, key, value);
}
return dateInstallmentsLookup;
}
use of org.mifos.accounts.loan.util.helpers.RepaymentScheduleInstallment in project head by mifos.
the class LoanBO method updateInstallmentSchedule.
public void updateInstallmentSchedule(List<RepaymentScheduleInstallment> installments) {
Map<Integer, LoanScheduleEntity> loanScheduleEntityLookUp = getLoanScheduleEntityMap();
for (RepaymentScheduleInstallment installment : installments) {
LoanScheduleEntity loanScheduleEntity = loanScheduleEntityLookUp.get(installment.getInstallment());
loanScheduleEntity.setPrincipal(installment.getPrincipal());
loanScheduleEntity.setInterest(installment.getInterest());
loanScheduleEntity.setActionDate(new java.sql.Date(installment.getDueDateValue().getTime()));
}
updateLoanSummary();
}
use of org.mifos.accounts.loan.util.helpers.RepaymentScheduleInstallment in project head by mifos.
the class LoanBO method toRepaymentScheduleDto.
public List<RepaymentScheduleInstallment> toRepaymentScheduleDto(Locale userLocale) {
List<RepaymentScheduleInstallment> installments = new ArrayList<RepaymentScheduleInstallment>();
for (AccountActionDateEntity actionDate : this.getAccountActionDates()) {
LoanScheduleEntity loanSchedule = (LoanScheduleEntity) actionDate;
installments.add(loanSchedule.toDto());
}
Collections.sort(installments, new Comparator<RepaymentScheduleInstallment>() {
@Override
public int compare(final RepaymentScheduleInstallment act1, final RepaymentScheduleInstallment act2) {
return act1.getInstallment().compareTo(act2.getInstallment());
}
});
return installments;
}
use of org.mifos.accounts.loan.util.helpers.RepaymentScheduleInstallment in project head by mifos.
the class LoanBusinessService method applyDailyInterestRatesWhereApplicable.
public List<RepaymentScheduleInstallment> applyDailyInterestRatesWhereApplicable(LoanScheduleGenerationDto loanScheduleGenerationDto, Locale locale) {
LoanBO loanBO = loanScheduleGenerationDto.getLoanBO();
List<RepaymentScheduleInstallment> installments = loanBO.toRepaymentScheduleDto(locale);
return applyDailyInterestRatesWhereApplicable(loanScheduleGenerationDto, installments);
}
Aggregations