From a98a13b683f4333cf214f43d202976e8e815779c Mon Sep 17 00:00:00 2001 From: Deepesh Garg Date: Fri, 16 Jun 2023 12:17:31 +0530 Subject: [PATCH 1/2] fix: Incorrect field while calculating Tax withholding net total (cherry picked from commit 571c977e8e871ff1b12350fc85fc3a995a34789a) # Conflicts: # erpnext/accounts/doctype/tax_withholding_category/tax_withholding_category.py --- .../tax_withholding_category.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) 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 32eaec8cf3e..0c9df9656dd 100644 --- a/erpnext/accounts/doctype/tax_withholding_category/tax_withholding_category.py +++ b/erpnext/accounts/doctype/tax_withholding_category/tax_withholding_category.py @@ -518,6 +518,7 @@ def get_invoice_total_without_tcs(inv, tax_details): def get_tds_amount_from_ldc(ldc, parties, pan_no, tax_details, posting_date, net_total): tds_amount = 0 +<<<<<<< HEAD limit_consumed = frappe.db.get_value( "Purchase Invoice", { @@ -527,6 +528,21 @@ def get_tds_amount_from_ldc(ldc, parties, pan_no, tax_details, posting_date, net "posting_date": ("between", (ldc.valid_from, ldc.valid_upto)), }, "sum(base_net_total)", +======= + + limit_consumed = flt( + frappe.db.get_all( + "Purchase Invoice", + filters={ + "supplier": ("in", parties), + "apply_tds": 1, + "docstatus": 1, + "tax_withholding_category": ldc.tax_withholding_category, + "posting_date": ("between", (ldc.valid_from, ldc.valid_upto)), + }, + fields=["sum(base_net_total) as limit_consumed"], + )[0].get("limit_consumed") +>>>>>>> 571c977e8e (fix: Incorrect field while calculating Tax withholding net total) ) if is_valid_certificate( From d49a8ad74fb4c5ee55fb1c1abb7c1d740a8050fd Mon Sep 17 00:00:00 2001 From: Deepesh Garg Date: Fri, 16 Jun 2023 12:22:23 +0530 Subject: [PATCH 2/2] chore: resolve conflicts --- .../tax_withholding_category.py | 12 ------------ 1 file changed, 12 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 0c9df9656dd..86c6341b68d 100644 --- a/erpnext/accounts/doctype/tax_withholding_category/tax_withholding_category.py +++ b/erpnext/accounts/doctype/tax_withholding_category/tax_withholding_category.py @@ -518,17 +518,6 @@ def get_invoice_total_without_tcs(inv, tax_details): def get_tds_amount_from_ldc(ldc, parties, pan_no, tax_details, posting_date, net_total): tds_amount = 0 -<<<<<<< HEAD - limit_consumed = frappe.db.get_value( - "Purchase Invoice", - { - "supplier": ("in", parties), - "apply_tds": 1, - "docstatus": 1, - "posting_date": ("between", (ldc.valid_from, ldc.valid_upto)), - }, - "sum(base_net_total)", -======= limit_consumed = flt( frappe.db.get_all( @@ -542,7 +531,6 @@ def get_tds_amount_from_ldc(ldc, parties, pan_no, tax_details, posting_date, net }, fields=["sum(base_net_total) as limit_consumed"], )[0].get("limit_consumed") ->>>>>>> 571c977e8e (fix: Incorrect field while calculating Tax withholding net total) ) if is_valid_certificate(