From d0c60343cd48584867991164f2533552c9b7110a Mon Sep 17 00:00:00 2001 From: venkat102 Date: Tue, 17 Dec 2024 13:15:02 +0530 Subject: [PATCH 1/2] chore: use get function (cherry picked from commit 1663c7983eac8112b535c467ca9c3845f94bb577) --- .../tax_withholding_category/tax_withholding_category.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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 798e264a532..57039424948 100644 --- a/erpnext/accounts/doctype/tax_withholding_category/tax_withholding_category.py +++ b/erpnext/accounts/doctype/tax_withholding_category/tax_withholding_category.py @@ -507,7 +507,7 @@ def get_tds_amount(ldc, parties, inv, tax_details, vouchers): ) supp_credit_amt = supp_jv_credit_amt - supp_credit_amt += inv.tax_withholding_net_total + supp_credit_amt += inv.get("tax_withholding_net_total", 0) for type in payment_entry_amounts: if type.payment_type == "Pay": @@ -519,9 +519,9 @@ def get_tds_amount(ldc, parties, inv, tax_details, vouchers): cumulative_threshold = tax_details.get("cumulative_threshold", 0) if inv.doctype != "Payment Entry": - tax_withholding_net_total = inv.base_tax_withholding_net_total + tax_withholding_net_total = inv.get("base_tax_withholding_net_total", 0) else: - tax_withholding_net_total = inv.tax_withholding_net_total + tax_withholding_net_total = inv.get("tax_withholding_net_total", 0) if (threshold and tax_withholding_net_total >= threshold) or ( cumulative_threshold and (supp_credit_amt + supp_inv_credit_amt) >= cumulative_threshold From 1093c227f1bce2280a7d56d42c69c0b0d59a7d58 Mon Sep 17 00:00:00 2001 From: venkat102 Date: Tue, 17 Dec 2024 13:15:41 +0530 Subject: [PATCH 2/2] fix: fetch tax withholding category from the voucher (cherry picked from commit 09e64594dbd694e4a77b287a08d4e44fd2bc6aba) --- .../accounts/report/tds_payable_monthly/tds_payable_monthly.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/accounts/report/tds_payable_monthly/tds_payable_monthly.py b/erpnext/accounts/report/tds_payable_monthly/tds_payable_monthly.py index 03a5259b96f..3c03005b1cb 100644 --- a/erpnext/accounts/report/tds_payable_monthly/tds_payable_monthly.py +++ b/erpnext/accounts/report/tds_payable_monthly/tds_payable_monthly.py @@ -405,7 +405,7 @@ def get_doc_info(vouchers, doctype, tax_category_map, net_total_map=None): "paid_amount_after_tax", "base_paid_amount", ], - "Journal Entry": ["total_debit"], + "Journal Entry": ["tax_withholding_category", "total_debit"], } entries = frappe.get_all(