From 11d5327d1b5fc1b9198bad77365d5ca269593e76 Mon Sep 17 00:00:00 2001 From: ruthra kumar Date: Tue, 8 Aug 2023 14:14:30 +0530 Subject: [PATCH] refactor: use base_tax_withholding_net_total for treshold validation (#36528) * refactor: use base_tax_withholding_net_total for treshold validation * fix: only for non payment entry doctypes --- .../tax_withholding_category/tax_withholding_category.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/erpnext/accounts/doctype/tax_withholding_category/tax_withholding_category.py b/erpnext/accounts/doctype/tax_withholding_category/tax_withholding_category.py index 58792d1d8a..e66a886bf9 100644 --- a/erpnext/accounts/doctype/tax_withholding_category/tax_withholding_category.py +++ b/erpnext/accounts/doctype/tax_withholding_category/tax_withholding_category.py @@ -476,7 +476,12 @@ def get_tds_amount(ldc, parties, inv, tax_details, tax_deducted, vouchers): threshold = tax_details.get("threshold", 0) cumulative_threshold = tax_details.get("cumulative_threshold", 0) - if (threshold and inv.tax_withholding_net_total >= threshold) or ( + if inv.doctype != "Payment Entry": + tax_withholding_net_total = inv.base_tax_withholding_net_total + else: + tax_withholding_net_total = inv.tax_withholding_net_total + + if (threshold and tax_withholding_net_total >= threshold) or ( cumulative_threshold and supp_credit_amt >= cumulative_threshold ): if (cumulative_threshold and supp_credit_amt >= cumulative_threshold) and cint(