Merge pull request #35354 from frappe/mergify/bp/version-13-hotfix/pr-35335
fix: tds incorrectly calculated for invoice that are below threshold (backport #35335)
This commit is contained in:
@@ -274,7 +274,7 @@ def get_invoice_vouchers(parties, tax_details, company, party_type="Supplier"):
|
|||||||
"docstatus": 1,
|
"docstatus": 1,
|
||||||
}
|
}
|
||||||
|
|
||||||
if not tax_details.get("consider_party_ledger_amount") and doctype != "Sales Invoice":
|
if doctype != "Sales Invoice":
|
||||||
filters.update(
|
filters.update(
|
||||||
{"apply_tds": 1, "tax_withholding_category": tax_details.get("tax_withholding_category")}
|
{"apply_tds": 1, "tax_withholding_category": tax_details.get("tax_withholding_category")}
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -110,9 +110,9 @@ class TestTaxWithholdingCategory(unittest.TestCase):
|
|||||||
invoices.append(pi1)
|
invoices.append(pi1)
|
||||||
|
|
||||||
# Cumulative threshold is 30000
|
# Cumulative threshold is 30000
|
||||||
# Threshold calculation should be on both the invoices
|
# Threshold calculation should be only on the Second invoice
|
||||||
# TDS should be applied only on 1000
|
# Second didn't breach, no TDS should be applied
|
||||||
self.assertEqual(pi1.taxes[0].tax_amount, 1000)
|
self.assertEqual(pi1.taxes, [])
|
||||||
|
|
||||||
for d in reversed(invoices):
|
for d in reversed(invoices):
|
||||||
d.cancel()
|
d.cancel()
|
||||||
|
|||||||
Reference in New Issue
Block a user