adamsaghy commented on code in PR #3924:
URL: https://github.com/apache/fineract/pull/3924#discussion_r1634938390
##########
fineract-loan/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/Loan.java:
##########
@@ -3663,14 +3407,10 @@ private ChangedTransactionDetail
closeDisbursements(final ScheduleGeneratorDTO s
}
public LoanTransaction getLatestTransaction() {
- LoanTransaction transaction = null;
- for (LoanTransaction loanTransaction : this.loanTransactions) {
- if (!loanTransaction.isReversed() && (transaction == null
- || DateUtils.isBefore(transaction.getTransactionDate(),
loanTransaction.getTransactionDate()))) {
- transaction = loanTransaction;
- }
- }
- return transaction;
+ return this.loanTransactions.stream() //
Review Comment:
I dont think this is right:
If we have the following list:
LT1: 2024-01-01, ID:1
LT2: 2024-01-02, ID:2
LT3: 2024-01-02, ID:3
It will return LT2 with ID2, but thats not the last one.
--
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]