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


##########
fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/service/LoanWritePlatformServiceJpaRepositoryImpl.java:
##########
@@ -869,6 +873,20 @@ public CommandProcessingResult undoLoanDisbursal(final 
Long loanId, final JsonCo
             final Map<String, Object> accountingBridgeData = 
loan.deriveAccountingBridgeData(currency.getCode(), existingTransactionIds,
                     existingReversedTransactionIds, isAccountTransfer);
             
journalEntryWritePlatformService.createJournalEntriesForLoan(accountingBridgeData);
+
+            // Remove All the Disbursement Details If the Loan Product is 
disabled and exists one
+            if (loan.loanProduct().isDisallowExpectedDisbursements()) {
+                if (!loan.getDisbursementDetails().isEmpty()) {
+                    
this.loanDisbursementDetailsRepository.deleteAll(loan.getDisbursementDetails());
+                }
+            }
+
+            // Remove All the Loan Delinquency Tags If exist one
+            List<LoanDelinquencyTagHistory> loanDelinquencyTagsHistory = 
this.loanDelinquencyTagHistoryRepository.findByLoan(loan);

Review Comment:
   Same here... if the loan is not getting back to approved state (there was 
multiple disbursement) we shall not remove the delinquency state



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