JohnAlva commented on code in PR #4886:
URL: https://github.com/apache/fineract/pull/4886#discussion_r2249401106
##########
fineract-core/src/main/java/org/apache/fineract/portfolio/savings/domain/interest/CompoundInterestHelper.java:
##########
@@ -47,9 +47,14 @@ public Money calculateInterestForAllPostingPeriods(final
MonetaryCurrency curren
// total interest earned in previous periods but not yet recognised
BigDecimal compoundedInterest = BigDecimal.ZERO;
BigDecimal unCompoundedInterest = BigDecimal.ZERO;
+ LocalDate endDay = DateUtils.getBusinessLocalDate();
final CompoundInterestValues compoundInterestValues = new
CompoundInterestValues(compoundedInterest, unCompoundedInterest);
for (final PostingPeriod postingPeriod : allPeriods) {
+ if (postingPeriod.dateOfPostingTransaction().getMonth() !=
endDay.getMonth()) {
Review Comment:
Sure! This logic accumulates interest for each posting period. If the month
changes, it resets the compoundedInterest. For example, if posting runs from
June 1 to July 31, it resets at July, and only carries over interest within the
same month—unless interestTransferEnabled or lockUntil prevent it.
--
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]