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
This commit is contained in:
ruthra kumar 2023-08-08 14:14:30 +05:30 committed by GitHub
parent 492ea3bcc8
commit 11d5327d1b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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(