adamsaghy commented on code in PR #2882:
URL: https://github.com/apache/fineract/pull/2882#discussion_r1082702226
##########
fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/Loan.java:
##########
@@ -6301,26 +6307,27 @@ 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();
+
+ final Map<String, Object> actualChanges = new LinkedHashMap<>();
+ List<LoanTransaction> loanTransactions =
retrieveListOfTransactionsByType(LoanTransactionType.DISBURSEMENT);
Review Comment:
This is wrong, we filter the transactions to have only the transactions
which are disbursement, but at line 6323, we are iterating through on the same
list and try to decide whether there was any transaction after the last
disbursement which prevent to undo the disbursement... (any repayment happened,
we cannot undo 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]