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


##########
fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/Loan.java:
##########
@@ -6344,38 +6355,31 @@ public Map<String, Object> 
undoLastDisbursal(ScheduleGeneratorDTO scheduleGenera
     /**
      * Reverse only disbursement, accruals, and repayments at disbursal 
transactions
      *
-     * @param actualDisbursementDate
+     * @param lastDisbursalTransaction
      * @return
      */
-    public List<LoanTransaction> 
reverseExistingTransactionsTillLastDisbursal(LocalDate actualDisbursementDate) {
-        final List<LoanTransaction> reversedTransactions = new ArrayList<>();
+    public void reverseExistingTransactionsTillLastDisbursal(LoanTransaction 
lastDisbursalTransaction) {
         for (final LoanTransaction transaction : this.loanTransactions) {
-            if 
((actualDisbursementDate.equals(transaction.getTransactionDate())
-                    || 
actualDisbursementDate.isBefore(transaction.getTransactionDate()))
+            if 
((transaction.getId().compareTo(lastDisbursalTransaction.getId()) >= 0)

Review Comment:
   We need to check the transactionDate as well as it was originally to avoid 
reverting a backdated transaction!



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