adamsaghy commented on code in PR #3651:
URL: https://github.com/apache/fineract/pull/3651#discussion_r1455451076


##########
fineract-loan/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/transactionprocessor/AbstractLoanRepaymentScheduleTransactionProcessor.java:
##########
@@ -205,6 +207,33 @@ public ChangedTransactionDetail 
reprocessLoanTransactions(final LocalDate disbur
         return changedTransactionDetail;
     }
 
+    protected void addChargeOnlyRepaymentInstallmentIfRequired(Set<LoanCharge> 
charges,
+            List<LoanRepaymentScheduleInstallment> installments) {
+        if (!CollectionUtils.isEmpty(charges) && 
!CollectionUtils.isEmpty(installments)) {
+            LoanRepaymentScheduleInstallment latestRepaymentScheduleInstalment 
= installments.get(installments.size() - 1);
+            LocalDate installmentDueDate = null;
+            for (final LoanCharge loanCharge : charges) {

Review Comment:
   charges are a set, there is no order how you are iterating through on it, 
and it can happen multiple charges are after the last installment due date, no?
   
   I would be happier if we were taking the latest charge which was after the 
maturity date and set that one instead of iterating though on them.



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