JohnAlva commented on code in PR #4886:
URL: https://github.com/apache/fineract/pull/4886#discussion_r2288981960


##########
fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/service/SavingsAccountInterestPostingServiceImpl.java:
##########
@@ -81,6 +82,7 @@ public SavingsAccountData postInterest(final MathContext mc, 
final LocalDate int
         for (final PostingPeriod interestPostingPeriod : postingPeriods) {
             final LocalDate interestPostingTransactionDate = 
interestPostingPeriod.dateOfPostingTransaction();
             final Money interestEarnedToBePostedForPeriod = 
interestPostingPeriod.getInterestEarned();
+            final Boolean isOverdraft = 
MathUtil.isLessThanZero(interestPostingPeriod.getInterestEarned());

Review Comment:
   I updated PostingPeriod so getInterestEarned() never returns a negative 
value, and added an explicit overdraftInterest flag. In the service we now rely 
on this flag to decide between normal interest posting and overdraft interest, 
instead of checking if the amount is less than zero. This keeps the logic 
clearer and avoids mixing earned vs. charged interest.



-- 
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]

Reply via email to