alberto-art3ch commented on code in PR #4000:
URL: https://github.com/apache/fineract/pull/4000#discussion_r1700580769
##########
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();
+ }
+ if (businessDate.compareTo(getFromDate()) >= 0) { // If It is the
current period
+ return
getRatePerDay().multiply(BigDecimal.valueOf(DateUtils.getDifferenceInDays(getPeriodStartDate(),
businessDate)),
Review Comment:
Done! Implementation applied based on the commented
--
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]