adamsaghy commented on code in PR #5937:
URL: https://github.com/apache/fineract/pull/5937#discussion_r3467300599
##########
fineract-working-capital-loan/src/main/java/org/apache/fineract/portfolio/workingcapitalloan/service/WorkingCapitalLoanDelinquencyRangeScheduleServiceImpl.java:
##########
@@ -177,6 +177,43 @@ public void applyRepayment(Long loanId, LocalDate
transactionDate, BigDecimal am
}
}
+ private BigDecimal unpayPeriod(WorkingCapitalLoanDelinquencyRangeSchedule
period, BigDecimal transactionAmount) {
+ BigDecimal unpayAmount = period.getPaidAmount().min(transactionAmount);
+ period.setPaidAmount(period.getPaidAmount().subtract(unpayAmount));
+
period.setOutstandingAmount(period.getExpectedAmount().subtract(period.getPaidAmount()).max(BigDecimal.ZERO));
+ if (period.getOutstandingAmount().compareTo(BigDecimal.ZERO) >= 0) {
Review Comment:
This looks weird to me. Can you please help me understand why are we reset
these fields?
--
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]