taskain7 commented on code in PR #3377:
URL: https://github.com/apache/fineract/pull/3377#discussion_r1297140062
##########
fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/loanschedule/domain/AbstractLoanScheduleGenerator.java:
##########
@@ -128,16 +132,17 @@ private LoanScheduleModel generate(final MathContext mc,
final LoanApplicationTe
loanApplicationTerms.getLoanCalendar(),
loanApplicationTerms.getHolidayDetailDTO(), loanApplicationTerms);
if (!scheduleParams.isPartialUpdate()) {
+ Long notDownPaymentPeriodNumber = periods.stream().filter(period
-> !period.isDownPaymentPeriod()).count();
// Set Fixed Principal Amount
- updateAmortization(mc, loanApplicationTerms,
scheduleParams.getPeriodNumber(), scheduleParams.getOutstandingBalance());
+ updateAmortization(mc, loanApplicationTerms,
notDownPaymentPeriodNumber.intValue(), scheduleParams.getOutstandingBalance());
if (loanApplicationTerms.isMultiDisburseLoan()) {
/* fetches the first tranche amount and also updates other
tranche details to map */
BigDecimal disburseAmt =
getDisbursementAmount(loanApplicationTerms,
scheduleParams.getPeriodStartDate(), periods,
- chargesDueAtTimeOfDisbursement,
scheduleParams.getDisburseDetailMap(),
scheduleParams.applyInterestRecalculation());
+ chargesDueAtTimeOfDisbursement,
scheduleParams.getDisburseDetailMap(),
scheduleParams.applyInterestRecalculation(),
+ scheduleParams);
scheduleParams.setPrincipalToBeScheduled(Money.of(currency,
disburseAmt));
loanApplicationTerms.setPrincipal(loanApplicationTerms.getPrincipal().zero().plus(disburseAmt));
- scheduleParams.setOutstandingBalance(Money.of(currency,
disburseAmt));
Review Comment:
the scheduleParams.outstandingBalance will be tracked in the method where
we're calculating the disbursement amount so if down payment is enabled then
down payment can be handled as well
--
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]