oleksii-novikov-onix commented on code in PR #4430:
URL: https://github.com/apache/fineract/pull/4430#discussion_r1984715913


##########
fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/service/LoanAccrualActivityProcessingServiceImpl.java:
##########
@@ -207,14 +207,21 @@ private LoanTransaction 
reverseReplayAccrualActivityTransaction(@NotNull Loan lo
             
newLoanTransaction.copyLoanTransactionRelations(loanTransaction.getLoanTransactionRelations());
             
newLoanTransaction.getLoanTransactionRelations().add(LoanTransactionRelation.linkToTransaction(newLoanTransaction,
                     loanTransaction, 
LoanTransactionRelationTypeEnum.REPLAYED));
+
+            
newLoanTransaction.updateExternalId(loanTransaction.getExternalId());
+            loanTransaction.reverse();
+            loanTransaction.updateExternalId(null);
+            
loanAccountService.saveLoanTransactionWithDataIntegrityViolationChecks(loanTransaction);
+
             
loanAccountService.saveLoanTransactionWithDataIntegrityViolationChecks(newLoanTransaction);
             loan.addLoanTransaction(newLoanTransaction);
 
             LoanAdjustTransactionBusinessEvent.Data data = new 
LoanAdjustTransactionBusinessEvent.Data(loanTransaction);
             data.setNewTransactionDetail(newLoanTransaction);
             businessEventNotifierService.notifyPostBusinessEvent(new 
LoanAdjustTransactionBusinessEvent(data));
+        } else {
+            reverseAccrualActivityTransaction(loanTransaction);

Review Comment:
   I was asking myself the same question, but it turns out that 
updateExternalId(null) was removed 
[here](https://github.com/apache/fineract/commit/001797b97a3895e75299e94650eab8bd0b0e63e8).
   @adamsaghy , please take a look.



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