[ 
https://issues.apache.org/jira/browse/FINERACT-2908?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18125655#comment-18125655
 ] 

Ashutosh Panda commented on FINERACT-2908:
------------------------------------------

Hi, I would like to work on this. The fix loads the tax group mappings and 
components in SavingAccountMapperForInterestPosting so the job creates the 
withhold tax transaction, persists its tax details in the batch insert, and 
books Savings Control against each tax component's credit account in 
SavingsSchedularInterestPoster. I have a branch ready and will open the PR 
shortly: 
https://github.com/apache/fineract/compare/develop...Ashutosh-Panda2004:FINERACT-2908

> 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)

Reply via email to