feat!: Introduce tax withholding entry (backport #51099)#51297
Closed
mergify[bot] wants to merge 1 commit intoversion-16-betafrom
Closed
feat!: Introduce tax withholding entry (backport #51099)#51297mergify[bot] wants to merge 1 commit intoversion-16-betafrom
mergify[bot] wants to merge 1 commit intoversion-16-betafrom
Conversation
(cherry picked from commit c66f78c) # Conflicts: # erpnext/accounts/doctype/journal_entry/journal_entry.py # erpnext/accounts/doctype/payment_entry/payment_entry.json # erpnext/accounts/doctype/sales_invoice/sales_invoice.py # erpnext/accounts/doctype/tax_withholding_category/tax_withholding_category.py # erpnext/accounts/doctype/tax_withholding_category/test_tax_withholding_category.py # erpnext/patches.txt
Contributor
Author
|
Cherry-pick of c66f78c has failed: To fix up this pull request, you can check it out locally. See documentation: https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/checking-out-pull-requests-locally |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR introduces a comprehensive refactor of the Tax Withholding (TDS/TCS) system in ERPNext. The key change is the introduction of a new child table Tax Withholding Entry that tracks every tax withholding transaction with full auditability, replacing the previous approach of calculating TDS/TCS on-the-fly.
Breaking Changes
Tax Withheld Voucherschild table - Replaced byTax Withholding Entryallocated_amountfield from Advance Taxes and charges table - Advance TDS allocation is now tracked through Tax Withholding Entriesconsider_party_ledger_amountsetting - Simplified threshold calculation logic (User will have select the checkbox for document to be considered).New Architecture
Tax Withholding Entry (Child Table)
A new child doctype that tracks every tax withholding transaction with the following key fields:
tax_withholding_categorytaxable_amountwithholding_amounttax_ratetaxable_doctype/namewithholding_doctype/namestatusunder_withheld_reasonlower_deduction_certificateEntry Status Flow
Controller Architecture
Key Features
1. Automatic Entry Matching
When a document is submitted, the system automatically matches:
2. Cumulative Threshold Tracking
3. Tax on Excess Amount
When
tax_on_excess_amountis enabled:under_withheld_reason = "Threshold Exemption"4. Lower Deduction Certificate (LDC) Support
5. Advance Payment TDS/TCS
Scenario: Payment Entry with TDS → Sales Invoice allocation
6. Item-Level Tax Withholding
tax_withholding_category7. Return Invoice Handling
8. Tax Withholding Group
Introduces Tax Withholding Group to support different TDS/TCS rates within the same category based on entity type.
Use Case
In India, Section 194C has different rates:
Migration
A patch
update_tax_withholding_field_in_payment_entryhandles:apply_tax_withholding_amounttoapply_tdsin Payment EntryFuture Enhancements
Checklist
Features
no-docs
This is an automatic backport of pull request #51099 done by Mergify.