Foo Developer created FINERACT-2997:
---------------------------------------
Summary: Interest received on an NPA loan is never recognised as
income; Interest Receivable goes negative on repayment and closure
Key: FINERACT-2997
URL: https://issues.apache.org/jira/browse/FINERACT-2997
Project: Apache Fineract
Issue Type: Bug
Components: Loan
Reporter: Foo Developer
Assignee: Foo Developer
h3. Summary
On a loan with periodic accrual accounting, interest accrual stops once the
loan is flagged as a non-performing asset (NPA). When the borrower then pays
interest that was never accrued, the repayment credits Interest Receivable with
the full interest portion, but nothing recognises that interest as income. The
loan's Interest Receivable goes negative and Interest Income is understated. If
the loan is closed while NPA, the final accrual on closure is skipped as well,
so the closed loan keeps a negative receivable permanently.
h3. Steps to reproduce
# Create a loan product with accounting "Accrual (periodic)", an interest rate,
and "Overdue days for NPA" = {{5}}. Use short repayment periods so installments
go overdue quickly (for example 12 daily installments).
# Create, approve and disburse a loan on that product.
# Move the business date forward past several due dates without repaying. Each
day, run "Add Periodic Accrual Transactions" and "Update Non Performing
Assets", until the loan has {{isNPA = true}}. From then on no more accruals are
posted.
# Post a repayment covering several overdue installments, including interest
that was never accrued.
# Repay the remaining balance so the loan closes while still NPA.
h3. Expected
* At step 4, the interest received but never accrued is recognised as income
(Dr Interest Receivable / Cr Interest Income for that portion), so the loan's
Interest Receivable does not go negative.
* At step 5, the closure accrual runs, and the closed loan's Interest
Receivable nets to zero.
h3. Actual
* At step 4, the repayment journal entry credits Interest Receivable with the
full interest portion and no accrual is posted. Interest Receivable for the
loan is negative by the unaccrued interest, and Interest Income is not credited.
* At step 5, no closure accrual is posted, so the closed loan's Interest
Receivable stays negative, and lifetime interest income is short by the
interest of the NPA period.
h3. Root cause
{{LoanAccrualsProcessingServiceImpl.addAccruals}} returns immediately when
{{loan.isNpa()}}, for every caller: the periodic accrual job / COB step, and
{{processAccrualsOnLoanClosure}} (the final accrual).
{{LoanAccrualEventService.LoanBalanceChangedListener}} only processes accruals
for closed or overpaid loans. Nothing recognises interest actually received
while a loan is NPA, even though the repayment journal clears Interest
Receivable for it.
h3. Proposed fix
Keep NPA loans out of normal accrual, but recognise interest on receipt:
* {{addAccruals}} no longer returns for NPA. For an NPA loan on a non-final
run, each period's accruable interest is capped at the interest already paid on
that installment (never below what is already accrued), and fees and penalties
are left unaccrued. These accruals are dated on the run date rather than
back-dated to the installment's due date, and {{accruedTill}} is not advanced,
because unpaid interest is still unaccrued. Since the installment's accrued
interest is updated, the normal accrual after the loan leaves NPA adds only the
remainder, so there is no double income.
* The final accrual on closure runs for NPA loans too, so the closing
repayment's unaccrued interest is recognised and the receivable nets to zero.
* A new {{LoanAccrualsProcessingService.processAccrualsOnNpaLoanRepayment}} is
called from {{LoanBalanceChangedListener}} for an open NPA loan, so the income
is recognised in the same transaction as the repayment.
Tests: unit tests in {{LoanAccrualsProcessingServiceImplTest}} for the capping
(accrued-and-paid, paid-but-unaccrued, unpaid, partly paid, fee not accrued)
and for the new entry point being a no-op on a non-NPA or closed loan.
--
This message was sent by Atlassian Jira
(v10.3.26#10030026)