Mk9894 commented on code in PR #3192:
URL: https://github.com/apache/fineract/pull/3192#discussion_r1206654895


##########
fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/domain/SavingsAccountTransactionRepository.java:
##########
@@ -53,4 +56,28 @@ List<SavingsAccountTransaction> 
findTransactionRunningBalanceBeforePivotDate(@Pa
     @Query("select sat from SavingsAccountTransaction sat where 
sat.savingsAccount.id = :savingsId and sat.dateOf <= :transactionDate and 
sat.reversed=false")
     List<SavingsAccountTransaction> 
findBySavingsAccountIdAndLessThanDateOfAndReversedIsFalse(@Param("savingsId") 
Long savingsId,
             @Param("transactionDate") LocalDate transactionDate, Pageable 
pageable);
+
+    @Query("""
+                    SELECT NEW 
org.apache.fineract.portfolio.savings.data.SavingsAccountTransactionDTOV2(tr.id,
+                tr.typeOf, tr.dateOf, tr.amount, 
tr.releaseIdOfHoldAmountTransaction, tr.reasonForBlock,
+                tr.createdDate, tr.appUser, nt.note, tr.runningBalance, 
tr.reversed,
+                tr.reversalTransaction, tr.originalTxnId, tr.lienTransaction, 
tr.isManualTransaction,
+                fromTran, toTran, tr.savingsAccount, tr.paymentDetail, currency
+                )
+                    FROM SavingsAccountTransaction tr
+                    JOIN ApplicationCurrency currency ON (currency.code = 
tr.savingsAccount.currency.code)
+                    LEFT JOIN AccountTransferTransaction fromtran ON 
(fromtran.fromSavingsTransaction = tr)
+                    LEFT JOIN AccountTransferTransaction totran ON 
(totran.toSavingsTransaction = tr)
+                    LEFT JOIN tr.notes nt ON (nt.savingsTransaction = tr)
+                    WHERE tr.savingsAccount.id = :savingsId
+                    AND tr.savingsAccount.depositType = :depositType
+                    AND (:transactionType IS NULL OR tr.typeOf = 
:transactionType )
+                    AND (:#{#searchParameters.fromDate} IS NULL OR tr.dateOf 
>= :#{#searchParameters.fromDate} )
+                    AND (:#{#searchParameters.toDate} IS NULL OR tr.dateOf <= 
:#{#searchParameters.toDate} )
+                    AND (:#{#searchParameters.fromAmount} IS NULL OR tr.amount 
>= :#{#searchParameters.fromAmount} )
+                    AND (:#{#searchParameters.toAmount} IS NULL OR tr.amount 
<= :#{#searchParameters.toAmount} )
+            """)
+    Page<SavingsAccountTransactionDTOV2> findAll(@Param("savingsId") Long 
savingsId, @Param("depositType") Integer depositType,

Review Comment:
   Sure. Thanks for the heads up!



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