[
https://issues.apache.org/jira/browse/FINERACT-2908?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18125735#comment-18125735
]
Ashutosh Panda commented on FINERACT-2908:
------------------------------------------
Hi Abhishek, I understand it builds on #6174. When I claimed the ticket it was
unassigned with no comments, so I implemented the fix and opened #6614, which
is ready. I am happy to rebase it on top of #6174 once that merges so nothing
conflicts could we keep #6614 open until then and decide after it lands? Thanks.
> Post Interest For Savings job does not withhold tax on posted interest
> ----------------------------------------------------------------------
>
> Key: FINERACT-2908
> URL: https://issues.apache.org/jira/browse/FINERACT-2908
> Project: Apache Fineract
> Issue Type: Bug
> Components: Accounting, Savings
> Reporter: Abhishek Chaudhary
> Priority: Major
> Fix For: 1.13.0
>
>
> The scheduled *Post Interest For Savings* job never withholds tax. For a
> savings account with withhold tax enabled, the job credits the full interest,
> creates no withhold-tax transaction and books no tax liability. Posting
> interest manually through the API (command=postInterest) on the same account
> does withhold tax.
> *Cause*
> The job loads accounts through {{SavingAccountMapperForInterestPosting}},
> which builds the tax group with {{TaxGroupData.lookup(taxGroupId, null)}}.
> That leaves the tax associations {{null}}, so
> {{SavingsAccountInterestPostingServiceImpl.createWithHoldTransaction}}
> returns without creating a transaction. The manual path uses the
> {{SavingsAccount}} entity, whose tax group has its mappings, so it works.
> The same guard affects re-posting: when the job corrects an interest posting
> for a period that already had tax withheld, it reverses the old withhold-tax
> transaction and creates no replacement.
> *Steps to reproduce*
> # Create a tax group (e.g. 10%) and a savings product with withhold tax
> enabled and that tax group.
> # Activate an account, deposit, and let interest accrue for a posting period.
> # Run the Post Interest For Savings job.
> # Expected: a withhold-tax transaction for 10% of the interest, and journal
> entries debiting Savings Control and crediting the tax component's account.
> Actual: neither.
> *What a fix needs*
> * Load the tax group's components (percentage, validity dates, credit
> account) for the job.
> * Insert the withhold-tax transaction and its
> {{m_savings_account_transaction_tax_details}} rows in the job's batch insert.
> * Book Savings Control against each tax component's credit account, as
> {{CashBasedAccountingProcessorForSavings}} and
> {{AccrualBasedAccountingProcessorForSavings}} do.
> {{SavingsSchedularInterestPoster.batchUpdateJournalEntries}} writes one
> debit/credit pair per transaction, so it needs to support one credit per tax
> component.
> Found while reviewing FINERACT-2705 (PR #6174).
--
This message was sent by Atlassian Jira
(v8.20.10#820010)