wip loan charges and loan schedule

This commit is contained in:
Keith Woodlock
2012-09-18 15:15:35 +01:00
parent 3adfd9c073
commit 3e5b47f562
2 changed files with 5 additions and 3 deletions
@@ -13,6 +13,7 @@ import org.mifosng.platform.loan.domain.LoanProductRelatedDetail;
import org.mifosng.platform.loan.domain.LoanProductRepository;
import org.mifosng.platform.loan.domain.PeriodFrequencyType;
import org.mifosng.platform.loanschedule.domain.AprCalculator;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@Service
@@ -21,6 +22,7 @@ public class LoanProductRelatedDetailAssembler {
private final LoanProductRepository loanProductRepository;
private final AprCalculator aprCalculator;
@Autowired
public LoanProductRelatedDetailAssembler(
final LoanProductRepository loanProductRepository,
final AprCalculator aprCalculator) {
@@ -42,15 +42,15 @@ public class DecliningBalanceMethodLoanScheduleGenerator implements LoanSchedule
final LocalDate interestCalculatedFrom) {
// 1. generate valid set of 'due dates' based on some of the 'loan attributes'
List<LocalDate> scheduledDates = this.scheduledDateGenerator.generate(loanScheduleInfo, disbursementDate, firstRepaymentDate);
final List<LocalDate> scheduledDates = this.scheduledDateGenerator.generate(loanScheduleInfo, disbursementDate, firstRepaymentDate);
LocalDate idealDisbursementDateBasedOnFirstRepaymentDate = this.scheduledDateGenerator.idealDisbursementDateBasedOnFirstRepaymentDate(loanScheduleInfo, scheduledDates);
final LocalDate idealDisbursementDateBasedOnFirstRepaymentDate = this.scheduledDateGenerator.idealDisbursementDateBasedOnFirstRepaymentDate(loanScheduleInfo, scheduledDates);
// 2. determine the 'periodic' interest rate based on the 'repayment periods' so we can use
final BigDecimal periodInterestRateForRepaymentPeriod = this.periodicInterestRateCalculator.calculateFrom(loanScheduleInfo);
// Determine with 'amortisation' approach to use
AmortizationLoanScheduleGenerator generator = this.amortizationLoanScheduleGeneratorFactory.createGenerator(loanScheduleInfo.getAmortizationMethod());
final AmortizationLoanScheduleGenerator generator = this.amortizationLoanScheduleGeneratorFactory.createGenerator(loanScheduleInfo.getAmortizationMethod());
return generator.generate(
loanScheduleInfo,