adamsaghy commented on code in PR #4886:
URL: https://github.com/apache/fineract/pull/4886#discussion_r2306688998
##########
fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/service/SavingsAccountInterestPostingServiceImpl.java:
##########
@@ -509,6 +615,22 @@ protected SavingsAccountTransactionData
findInterestPostingTransactionFor(final
return postingTransation;
}
+ protected SavingsAccountTransactionData
findInterestPostingTransactionForInterest(final LocalDate postingDate,
+ final SavingsAccountData savingsAccountData, boolean isOverdraft) {
+ SavingsAccountTransactionData postingTransation = null;
+ List<SavingsAccountTransactionData> trans =
savingsAccountData.getSavingsAccountTransactionData();
+
+ for (final SavingsAccountTransactionData transaction : trans) {
+ Boolean interestSearch = isOverdraft ?
transaction.isOverdraftInterestAndNotReversed()
+ : transaction.isInterestPostingAndNotReversed();
+ if (interestSearch && transaction.occursOn(postingDate) &&
!transaction.isReversalTransaction()) {
+ postingTransation = transaction;
Review Comment:
A Stream API + filter + findFirst would be better here!
--
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]