Merge pull request #35733 from deepeshgarg007/tax_withholding_limit_consumed
fix: Incorrect field while calculating Tax withholding net total
This commit is contained in:
@@ -518,15 +518,19 @@ 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):
|
def get_tds_amount_from_ldc(ldc, parties, pan_no, tax_details, posting_date, net_total):
|
||||||
tds_amount = 0
|
tds_amount = 0
|
||||||
limit_consumed = frappe.db.get_value(
|
|
||||||
"Purchase Invoice",
|
limit_consumed = flt(
|
||||||
{
|
frappe.db.get_all(
|
||||||
"supplier": ("in", parties),
|
"Purchase Invoice",
|
||||||
"apply_tds": 1,
|
filters={
|
||||||
"docstatus": 1,
|
"supplier": ("in", parties),
|
||||||
"posting_date": ("between", (ldc.valid_from, ldc.valid_upto)),
|
"apply_tds": 1,
|
||||||
},
|
"docstatus": 1,
|
||||||
"sum(base_net_total)",
|
"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")
|
||||||
)
|
)
|
||||||
|
|
||||||
if is_valid_certificate(
|
if is_valid_certificate(
|
||||||
|
|||||||
Reference in New Issue
Block a user