Merge pull request #26683 from deepeshgarg007/tds_194q_fix

fix(minor): Consider grand total for threshold check
This commit is contained in:
Deepesh Garg 2021-07-28 11:56:29 +05:30 committed by GitHub
commit 7365e9704f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -243,10 +243,13 @@ def get_tds_amount(ldc, parties, inv, tax_details, fiscal_year_details, tax_dedu
'docstatus': 1 'docstatus': 1
} }
field = 'sum(net_total)'
if not cint(tax_details.consider_party_ledger_amount): if not cint(tax_details.consider_party_ledger_amount):
invoice_filters.update({'apply_tds': 1}) invoice_filters.update({'apply_tds': 1})
field = 'sum(grand_total)'
supp_credit_amt = frappe.db.get_value('Purchase Invoice', invoice_filters, 'sum(net_total)') or 0.0 supp_credit_amt = frappe.db.get_value('Purchase Invoice', invoice_filters, field) or 0.0
supp_jv_credit_amt = frappe.db.get_value('Journal Entry Account', { supp_jv_credit_amt = frappe.db.get_value('Journal Entry Account', {
'parent': ('in', vouchers), 'docstatus': 1, 'parent': ('in', vouchers), 'docstatus': 1,