janez89 commented on code in PR #4048:
URL: https://github.com/apache/fineract/pull/4048#discussion_r1754144705


##########
fineract-progressive-loan/src/main/java/org/apache/fineract/portfolio/loanaccount/loanschedule/domain/ProgressiveLoanScheduleGenerator.java:
##########
@@ -103,11 +104,15 @@ public LoanScheduleModel generate(final MathContext mc, 
final LoanApplicationTer
 
         prepareDisbursementsOnLoanApplicationTerms(loanApplicationTerms);
 
+        final ArrayList<DisbursementData> disbursementDataList = new 
ArrayList<>(loanApplicationTerms.getDisbursementDatas());
+        
disbursementDataList.sort(Comparator.comparing(DisbursementData::disbursementDate));

Review Comment:
   Okay, I understand.
   The secondary sorting occurs in the original order in the submitted JSON 
array, just like before. 
   If the date matches, we will retrieve the identical order as previously 
submitted by the client.
    
   From a calculation perspective, if we have multiple disbursements on the 
same date, the amounts of those disbursements are accumulated. The "addition" 
operation is associative, so it doesn't matter which disbursement came first on 
the same day.



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