Skip to content

Commit

Permalink
Merge pull request #35733 from deepeshgarg007/tax_withholding_limit_c…
Browse files Browse the repository at this point in the history
…onsumed

fix: Incorrect field while calculating Tax withholding net total
  • Loading branch information
deepeshgarg007 committed Jun 16, 2023
2 parents 1685305 + bcc8a45 commit e37b6bb
Showing 1 changed file with 13 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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):
tds_amount = 0
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(
"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")
)

if is_valid_certificate(
Expand Down

0 comments on commit e37b6bb

Please sign in to comment.