[Error] Display appropriate msg if company is different for TDS (#15601)

* fix(tds): Display appropriate msg if company is different

* Update tax_withholding_category.py
This commit is contained in:
Shreya Shah 2018-10-06 17:56:21 +05:30 committed by Nabin Hait
parent b8c1897a80
commit e7e269d4a4

View File

@ -19,6 +19,9 @@ def get_party_tax_withholding_details(ref_doc):
fy = get_fiscal_year(ref_doc.posting_date, company=ref_doc.company)
tax_details = get_tax_withholding_details(tax_withholding_category, fy[0], ref_doc.company)
if not tax_details:
frappe.throw(_('Please set associated account in Tax Withholding Category {0} against Company {1}')
.format(tax_withholding_category, ref_doc.company))
tds_amount = get_tds_amount(ref_doc, tax_details, fy)
tax_row = get_tax_row(tax_details, tds_amount)
return tax_row