wip loan charges and loan schedule
This commit is contained in:
+2
@@ -13,6 +13,7 @@ import org.mifosng.platform.loan.domain.LoanProductRelatedDetail;
|
|||||||
import org.mifosng.platform.loan.domain.LoanProductRepository;
|
import org.mifosng.platform.loan.domain.LoanProductRepository;
|
||||||
import org.mifosng.platform.loan.domain.PeriodFrequencyType;
|
import org.mifosng.platform.loan.domain.PeriodFrequencyType;
|
||||||
import org.mifosng.platform.loanschedule.domain.AprCalculator;
|
import org.mifosng.platform.loanschedule.domain.AprCalculator;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
@Service
|
@Service
|
||||||
@@ -21,6 +22,7 @@ public class LoanProductRelatedDetailAssembler {
|
|||||||
private final LoanProductRepository loanProductRepository;
|
private final LoanProductRepository loanProductRepository;
|
||||||
private final AprCalculator aprCalculator;
|
private final AprCalculator aprCalculator;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
public LoanProductRelatedDetailAssembler(
|
public LoanProductRelatedDetailAssembler(
|
||||||
final LoanProductRepository loanProductRepository,
|
final LoanProductRepository loanProductRepository,
|
||||||
final AprCalculator aprCalculator) {
|
final AprCalculator aprCalculator) {
|
||||||
|
|||||||
+3
-3
@@ -42,15 +42,15 @@ public class DecliningBalanceMethodLoanScheduleGenerator implements LoanSchedule
|
|||||||
final LocalDate interestCalculatedFrom) {
|
final LocalDate interestCalculatedFrom) {
|
||||||
|
|
||||||
// 1. generate valid set of 'due dates' based on some of the 'loan attributes'
|
// 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
|
// 2. determine the 'periodic' interest rate based on the 'repayment periods' so we can use
|
||||||
final BigDecimal periodInterestRateForRepaymentPeriod = this.periodicInterestRateCalculator.calculateFrom(loanScheduleInfo);
|
final BigDecimal periodInterestRateForRepaymentPeriod = this.periodicInterestRateCalculator.calculateFrom(loanScheduleInfo);
|
||||||
|
|
||||||
// Determine with 'amortisation' approach to use
|
// Determine with 'amortisation' approach to use
|
||||||
AmortizationLoanScheduleGenerator generator = this.amortizationLoanScheduleGeneratorFactory.createGenerator(loanScheduleInfo.getAmortizationMethod());
|
final AmortizationLoanScheduleGenerator generator = this.amortizationLoanScheduleGeneratorFactory.createGenerator(loanScheduleInfo.getAmortizationMethod());
|
||||||
|
|
||||||
return generator.generate(
|
return generator.generate(
|
||||||
loanScheduleInfo,
|
loanScheduleInfo,
|
||||||
|
|||||||
Reference in New Issue
Block a user