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


##########
fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/Loan.java:
##########
@@ -6301,26 +6302,18 @@ public Map<String, Object> 
undoLastDisbursal(ScheduleGeneratorDTO scheduleGenera
             List<Long> existingReversedTransactionIds, Loan loan) {
 
         validateAccountStatus(LoanEvent.LOAN_DISBURSAL_UNDO_LAST);
-        existingTransactionIds.addAll(findExistingTransactionIds());
-        
existingReversedTransactionIds.addAll(findExistingReversedTransactionIds());
-        final Map<String, Object> actualChanges = new LinkedHashMap<>();
         
validateActivityNotBeforeClientOrGroupTransferDate(LoanEvent.LOAN_DISBURSAL_UNDO_LAST,
 getDisbursementDate());
-        LocalDate actualDisbursementDate = null;
-        LocalDate lastTransactionDate = getDisbursementDate();
-        List<LoanTransaction> loanTransactions = 
retrieveListOfTransactionsExcludeAccruals();
-        Collections.reverse(loanTransactions);
-        for (final LoanTransaction previousTransaction : loanTransactions) {
-            if 
(lastTransactionDate.isBefore(previousTransaction.getTransactionDate())
-                    && (previousTransaction.isRepaymentType() || 
previousTransaction.isWaiver() || previousTransaction.isChargePayment())) {
-                throw new 
UndoLastTrancheDisbursementException(previousTransaction.getId());
-            }
-            if (previousTransaction.isDisbursement()) {
-                lastTransactionDate = previousTransaction.getTransactionDate();
-                break;
-            }
-        }
-        actualDisbursementDate = lastTransactionDate;
-        updateLoanToLastDisbursalState(actualDisbursementDate);
+
+        final Map<String, Object> actualChanges = new LinkedHashMap<>();

Review Comment:
   Done



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