fix(tds): Create tds payable under correct parent

This commit is contained in:
Nabin Hait 2018-11-20 16:46:25 +05:30 committed by Nabin Hait
parent 9cdece4ca2
commit f77cd54a6c

View File

@ -350,12 +350,17 @@ def set_tax_withholding_category(company):
def set_tds_account(docs, company):
abbr = frappe.get_value("Company", company, "abbr")
docs.extend([
{
"doctype": "Account", "account_name": "TDS Payable", "account_type": "Tax",
"parent_account": "Duties and Taxes - {0}".format(abbr), "company": company
}
])
parent_account = frappe.db.get_value("Account", filters = {"account_name": "Duties and Taxes", "company": company})
if parent_account:
docs.extend([
{
"doctype": "Account",
"account_name": "TDS Payable",
"account_type": "Tax",
"parent_account": parent_account,
"company": company
}
])
def get_tds_details(accounts, fiscal_year):
# bootstrap default tax withholding sections