FINERACT-2330: Buy-Down fees adjustment Acct for non merchant product
This commit is contained in:
committed by
Adam Saghy
parent
14589e2600
commit
141f17ecfc
+5
-3
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+13
-1
@@ -881,7 +881,7 @@ public class LoanBuyDownFeeTest extends BaseLoanIntegrationTest {
|
||||
loanTransactionHelper.approveLoan(loanId, approveLoanRequest(1000.0, "01 September 2024"));
|
||||
disburseLoan(loanId, BigDecimal.valueOf(1000.0), "01 September 2024");
|
||||
|
||||
final Long buyDownFeeTransactionId = addBuyDownFeeForLoan(loanId, 400.0, "10 September 2024");
|
||||
Long buyDownFeeTransactionId = addBuyDownFeeForLoan(loanId, 400.0, "10 September 2024");
|
||||
assertNotNull(buyDownFeeTransactionId);
|
||||
|
||||
verifyTransactions(loanId, //
|
||||
@@ -902,6 +902,18 @@ public class LoanBuyDownFeeTest extends BaseLoanIntegrationTest {
|
||||
// Verify initial buy down fee (non merchant) reversed accounting entries
|
||||
verifyTRJournalEntries(buyDownFeeTransactionId, debit(fundSource, 400.0), credit(deferredIncomeLiabilityAccount, 400.0),
|
||||
credit(fundSource, 400.0), debit(deferredIncomeLiabilityAccount, 400.0));
|
||||
|
||||
buyDownFeeTransactionId = addBuyDownFeeForLoan(loanId, 400.0, "10 September 2024");
|
||||
assertNotNull(buyDownFeeTransactionId);
|
||||
|
||||
// Buy Down Fee Adjustment (non merchant)
|
||||
final PostLoansLoanIdTransactionsResponse buyDownFeeAdjustmentTransaction = loanTransactionHelper.buyDownFeeAdjustment(loanId,
|
||||
buyDownFeeTransactionId, "10 September 2024", 200.0);
|
||||
assertNotNull(buyDownFeeAdjustmentTransaction);
|
||||
|
||||
// Verify buy down fee adjustment (non merchant)
|
||||
verifyTRJournalEntries(buyDownFeeAdjustmentTransaction.getResourceId(), debit(deferredIncomeLiabilityAccount, 200.0),
|
||||
credit(fundSource, 200.0));
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user