adamsaghy commented on code in PR #5718:
URL: https://github.com/apache/fineract/pull/5718#discussion_r3043949669
##########
fineract-working-capital-loan/src/main/java/org/apache/fineract/portfolio/workingcapitalloan/service/WorkingCapitalLoanDelinquencyRangeScheduleServiceImpl.java:
##########
@@ -175,26 +188,103 @@ private LocalDate calculateToDate(LocalDate fromDate,
Integer frequency, Delinqu
};
}
- private BigDecimal calculateExpectedAmount(WorkingCapitalLoan loan,
DelinquencyMinimumPaymentPeriodAndRule rule) {
- BigDecimal minimumPayment = rule.getMinimumPayment();
+ private BigDecimal calculateExpectedAmount(final WorkingCapitalLoan loan,
final DelinquencyMinimumPaymentPeriodAndRule rule,
+ final WorkingCapitalLoanDelinquencyAction rescheduleOverride) {
+ final BigDecimal principal = loan.getApprovedPrincipal();
+ if (principal == null) {
+ return BigDecimal.ZERO;
+ }
+ if (rescheduleOverride != null) {
+ return MathUtil.percentageOf(principal,
rescheduleOverride.getMinimumPayment(), MathContext.DECIMAL128);
Review Comment:
Expected amount should be Money, We cannot have more precision than the
relevant currency allows!
--
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]