adamsaghy commented on code in PR #4000:
URL: https://github.com/apache/fineract/pull/4000#discussion_r1698403143
##########
fineract-loan/src/main/java/org/apache/fineract/portfolio/loanaccount/loanschedule/data/LoanSchedulePeriodData.java:
##########
@@ -402,6 +403,49 @@ private BigDecimal defaultToZeroIfNull(final BigDecimal
possibleNullValue) {
return value;
}
+ public BigDecimal getRatePerDay() {
+ return
getInterestOriginalDue().divide(BigDecimal.valueOf(getDaysInPeriod()),
MoneyHelper.getMathContext());
+ }
+
+ public BigDecimal getInterestDueUntilDate(final LocalDate businessDate) {
+ if (getComplete()) {
+ return BigDecimal.ZERO;
+ } else {
+ if (businessDate.compareTo(getDueDate()) >= 0) { // Period is
matured
+ return getInterestOriginalDue();
Review Comment:
This is incorrect. We want to know what interest was not yet paid and not
yet due. If we are on or over the due date, it cannot be not yet due, so it
must be 0.
--
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]