This is an automated email from the ASF dual-hosted git repository.

Aman-Mittal pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/fineract.git

commit d72a8a101017fc87d60f2bc8ca086b1db1129759
Merge: d805815336 e8ec4c685d
Author: Aman Mittal <[email protected]>
AuthorDate: Fri Nov 27 10:05:07 2026 +0530

    Merge pull request #6867 from 
abhinavjha0239/FINERACT-3205-pay-charge-after-reversal
    
    FINERACT-3205: Fix savings charge payment failing after a reversal

 .../domain/SavingsAccountTransactionRepository.java  |  2 +-
 .../SavingsAccountBalanceCheckAfterReversalTest.java | 20 ++++++++++++++++++++
 2 files changed, 21 insertions(+), 1 deletion(-)

diff --cc 
fineract-savings/src/main/java/org/apache/fineract/portfolio/savings/domain/SavingsAccountTransactionRepository.java
index 8b5eb7a830,42286e075d..6228342469
--- 
a/fineract-savings/src/main/java/org/apache/fineract/portfolio/savings/domain/SavingsAccountTransactionRepository.java
+++ 
b/fineract-savings/src/main/java/org/apache/fineract/portfolio/savings/domain/SavingsAccountTransactionRepository.java
@@@ -56,17 -56,7 +56,17 @@@ public interface SavingsAccountTransact
  
      List<SavingsAccountTransaction> findByRefNo(@Param("refNo") String refNo);
  
-     @Query("select sat from SavingsAccountTransaction sat where 
sat.savingsAccount.id = :savingsId and sat.dateOf <= :transactionDate and 
sat.reversed=false")
+     @Query("select sat from SavingsAccountTransaction sat where 
sat.savingsAccount.id = :savingsId and sat.dateOf <= :transactionDate and 
sat.reversed=false and sat.reversalTransaction=false")
      List<SavingsAccountTransaction> 
findBySavingsAccountIdAndLessThanDateOfAndReversedIsFalse(@Param("savingsId") 
Long savingsId,
              @Param("transactionDate") LocalDate transactionDate, Pageable 
pageable);
 +
 +    @Query("""
 +            SELECT MAX(sat.dateOf) FROM SavingsAccountTransaction sat
 +            WHERE sat.savingsAccount.id = :savingsId
 +              AND sat.typeOf IN :transactionTypes
 +              AND sat.reversed = false
 +              AND sat.reversalTransaction = false
 +            """)
 +    LocalDate findLastTransactionDateBySavingsIdAndTypes(@Param("savingsId") 
Long savingsId,
 +            @Param("transactionTypes") List<Integer> transactionTypes);
  }

Reply via email to