FINERACT-2330: Buy-Down fees adjustment Acct for non merchant product

This commit is contained in:
Jose Alberto Hernandez
2025-08-21 10:23:09 +02:00
committed by Adam Saghy
parent 14589e2600
commit 141f17ecfc
2 changed files with 18 additions and 4 deletions
@@ -457,12 +457,14 @@ public class AccrualBasedAccountingProcessorForLoan implements AccountingProcess
final BigDecimal amount = loanTransactionDTO.getAmount();
final Long paymentTypeId = loanTransactionDTO.getPaymentTypeId();
final AccrualAccountsForLoan debitAccountType = loanDTO.isMerchantBuyDownFee() ? AccrualAccountsForLoan.BUY_DOWN_EXPENSE
: AccrualAccountsForLoan.FUND_SOURCE;
if (MathUtil.isGreaterThanZero(amount)) {
// Mirror of Buy Down Fee entries (as per PS-2574 requirements)
// Debit: Deferred Income Liability, Credit: Buy Down Expense
// Debit: Deferred Income Liability, Credit: Buy Down Expense (merchant)
// Debit: Deferred Income Liability, Credit: Fund Source (non merchant)
this.helper.createJournalEntriesForLoan(office, currencyCode, AccrualAccountsForLoan.DEFERRED_INCOME_LIABILITY.getValue(),
AccrualAccountsForLoan.BUY_DOWN_EXPENSE.getValue(), loanProductId, paymentTypeId, loanId, transactionId,
transactionDate, amount);
debitAccountType.getValue(), loanProductId, paymentTypeId, loanId, transactionId, transactionDate, amount);
}
}