JohnAlva commented on code in PR #4886:
URL: https://github.com/apache/fineract/pull/4886#discussion_r2265515382
##########
fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/service/SavingsAccountInterestPostingServiceImpl.java:
##########
@@ -297,6 +350,54 @@ public List<PostingPeriod> calculateInterestUsing(final
MathContext mc, final Lo
return allPostingPeriods;
}
+ private List<SavingsAccountTransactionData> listForOverdraft(final
SavingsAccountData savingsAccountData,
+ final LocalDateInterval periodInterval) {
+ List<SavingsAccountTransactionData> overdraftTransactionsInPeriod =
new ArrayList<>();
+ for (SavingsAccountTransactionData lists :
retreiveOrderedNonInterestPostingTransactions(savingsAccountData)) {
+ if (MathUtil.isLessThanZero(lists.getRunningBalance()) &&
periodInterval.startDate().getMonth() == lists.getDate().getMonth()) {
+ overdraftTransactionsInPeriod.add(lists);
+
+ }
+ }
+ return overdraftTransactionsInPeriod;
+
+ }
+
+ private List<SavingsAccountTransactionData> listForInterestPosting(final
SavingsAccountData savingsAccountData,
+ final LocalDateInterval periodInterval) {
+ List<SavingsAccountTransactionData> listOfTransactionsIsNotOverdraft =
new ArrayList<>();
+ for (SavingsAccountTransactionData lists :
retreiveOrderedNonInterestPostingTransactions(savingsAccountData)) {
+ if (MathUtil.isGreaterThanZero(lists.getRunningBalance())
+ && periodInterval.startDate().getMonth() ==
lists.getDate().getMonth()) {
+ BigDecimal bd = new
BigDecimal(String.valueOf(lists.getRunningBalance())).setScale(2,
RoundingMode.DOWN);
Review Comment:
Replaced hardcoded BigDecimal rounding with Money to ensure consistent
currency handling and precision across the system.
--
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]