chinmaya samantara created FINERACT-2994:
--------------------------------------------
Summary: Undoing a savings transaction does not reverse the
interest accruals booked after it
Key: FINERACT-2994
URL: https://issues.apache.org/jira/browse/FINERACT-2994
Project: Apache Fineract
Issue Type: Bug
Reporter: chinmaya samantara
Assignee: chinmaya samantara
With accrual (periodic) accounting on a savings product, undoing a deposit or
withdrawal leaves the interest accruals that were booked from its date. The
"Add Accrual Transactions For Savings" job only adds accruals after the last
one, so it never corrects them: Interest Payable and Interest Expense stay
wrong.
*Cause*
SavingsAccount.deposit() and withdraw() call accrualsForSavingsReverse(), which
reverses the accruals dated on or after the transaction so they are calculated
again. The undo methods (undoTransaction(Long), undoSavingsTransaction(Long),
undoTransaction(SavingsAccountTransaction)) only reverse the transaction itself.
*Steps to reproduce* (develop 0df2ef786f, PostgreSQL)
Savings product with accountingRule 3, 6% nominal annual interest, interest
payable account set. Account activated 01 July 2026.
||Case||After accrual job||After undo||After accrual job again||Expected||
|B. deposit 5000, undo the deposit|payable 96.80|balance 0, payable
96.80|payable 96.80|0.00|
|C. deposit 10000, withdraw 4000 on 01 Aug, undo the withdrawal|payable
136.53|balance 10000, payable 136.53|payable 136.53|193.54 (same as an account
that never withdrew)|
*Expected*: undo reverses the accruals dated on or after the undone transaction
(with reversal journal entries), like a new deposit or withdrawal does, and the
next accrual job books them again from the corrected balance.
*Fix*: call the same reversal from the three undo methods, plus unit tests.
--
This message was sent by Atlassian Jira
(v10.3.26#10030026)