FINERACT-2311: Buy Down fees - Reversal of existing transaction
This commit is contained in:
committed by
Adam Saghy
parent
0581c09273
commit
e46a98065e
+4
@@ -707,6 +707,10 @@ public class LoanTransaction extends AbstractAuditableWithUTCDateTimeCustom<Long
|
||||
return LoanTransactionType.CAPITALIZED_INCOME.equals(getTypeOf()) && isNotReversed();
|
||||
}
|
||||
|
||||
public boolean isDeferredIncome() {
|
||||
return isCapitalizedIncome() || isBuyDownFee();
|
||||
}
|
||||
|
||||
public boolean isCapitalizedIncomeAmortization() {
|
||||
return LoanTransactionType.CAPITALIZED_INCOME_AMORTIZATION.equals(getTypeOf()) && isNotReversed();
|
||||
}
|
||||
|
||||
+9
@@ -20,8 +20,17 @@ package org.apache.fineract.portfolio.loanaccount.domain;
|
||||
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
|
||||
import org.springframework.data.jpa.repository.Query;
|
||||
|
||||
public interface LoanTransactionRelationRepository
|
||||
extends JpaRepository<LoanTransactionRelation, Long>, JpaSpecificationExecutor<LoanTransactionRelation> {
|
||||
|
||||
@Query("""
|
||||
SELECT CASE WHEN COUNT(ltr) > 0 THEN true ELSE false END
|
||||
FROM LoanTransactionRelation ltr
|
||||
WHERE ltr.toTransaction = :toTransaction AND ltr.relationType = :relationType
|
||||
AND ltr.fromTransaction.reversed = false
|
||||
""")
|
||||
boolean hasLoanTransactionRelationsWithType(LoanTransaction toTransaction, LoanTransactionRelationTypeEnum relationType);
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user