adamsaghy commented on code in PR #5219:
URL: https://github.com/apache/fineract/pull/5219#discussion_r2661173817
##########
fineract-progressive-loan/src/main/java/org/apache/fineract/portfolio/loanaccount/loanschedule/domain/ProgressiveLoanScheduleGenerator.java:
##########
@@ -108,11 +109,27 @@ public LoanScheduleModel generate(final MathContext mc,
final LoanApplicationTer
final ProgressiveLoanInterestScheduleModel interestScheduleModel =
emiCalculator.generatePeriodInterestScheduleModel(
expectedRepaymentPeriods,
loanApplicationTerms.toLoanConfigurationDetails(),
loanApplicationTerms.getInstallmentAmountInMultiplesOf(), mc);
+
+
interestScheduleModel.allowFullTermForTranche(loanApplicationTerms.isAllowFullTermForTranche());
+
interestScheduleModel.originalNumberOfRepayments(loanApplicationTerms.getNumberOfRepayments());
+
final List<LoanScheduleModelPeriod> periods = new
ArrayList<>(expectedRepaymentPeriods.size());
prepareDisbursementsOnLoanApplicationTerms(loanApplicationTerms);
final List<DisbursementData> disbursementDataList =
getSortedDisbursementList(loanApplicationTerms);
+ if (loanApplicationTerms.isAllowFullTermForTranche() &&
loanApplicationTerms.isMultiDisburseLoan()) {
+ ScheduleExtensionResult extensionResult =
calculateAdditionalPeriodsForFullTermTranches(disbursementDataList,
+ expectedRepaymentPeriods, loanApplicationTerms);
+ if (extensionResult.additionalPeriods > 0) {
+ List<LoanScheduleModelRepaymentPeriod> extensionPeriods =
generateAdditionalPeriods(mc, extensionResult.additionalPeriods,
+ expectedRepaymentPeriods, loanApplicationTerms,
holidayDetailDTO);
+ expectedRepaymentPeriods.addAll(extensionPeriods);
+ emiCalculator.addRepaymentPeriods(interestScheduleModel,
extensionResult.disbursementDate,
+ extensionResult.additionalPeriods, List.of());
+ }
+ }
Review Comment:
I dont think we need this at all. When a new disbursement added to the loan,
we can handle the additional periods to be added.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]