alberto-art3ch commented on code in PR #5218:
URL: https://github.com/apache/fineract/pull/5218#discussion_r2668431148


##########
fineract-loan/src/main/java/org/apache/fineract/portfolio/loanaccount/data/TransactionChangeData.java:
##########
@@ -33,4 +34,11 @@ public class TransactionChangeData {
 
     private LoanTransaction oldTransaction;
     private LoanTransaction newTransaction;
+
+    public boolean isBeingReprocessed(final LoanTransaction loanTransaction) {
+        final MonetaryCurrency currency = 
loanTransaction.getLoan().getCurrency();
+        return (oldTransaction.getId() != null && 
oldTransaction.getTypeOf().equals(loanTransaction.getTypeOf()) //
+                && 
oldTransaction.getTransactionDate().equals(loanTransaction.getTransactionDate())
 //
+                && 
(oldTransaction.getAmount(currency).compareTo(loanTransaction.getAmount(currency))
 == 0));

Review Comment:
   The reason to have the other checks is to ensure that we are validating the 
same IR Transaction for the same date and amount, If we use only the getId() 
method we can get a true for other new transaction that is not a IR 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