brotherton-erpnext/erpnext/patches/v11_0/set_salary_component_properties.py

16 lines
813 B
Python
Raw Normal View History

import frappe
def execute():
2018-06-29 12:00:29 +00:00
frappe.reload_doc('hr', 'doctype', 'salary_detail')
frappe.reload_doc('hr', 'doctype', 'salary_component')
2018-06-29 12:00:29 +00:00
frappe.db.sql("update `tabSalary Component` set is_payable=1, is_tax_applicable=1 where type='Earning'")
frappe.db.sql("update `tabSalary Component` set is_payable=0 where type='Deduction'")
2018-06-29 12:00:29 +00:00
frappe.db.sql("""update `tabSalary Component` set variable_based_on_taxable_salary=1
where type='Deduction' and name in ('TDS', 'Tax Deducted at Source')""")
frappe.db.sql("""update `tabSalary Detail` set is_tax_applicable=1
where parentfield='earnings' and statistical_component=0""")
frappe.db.sql("""update `tabSalary Detail` set variable_based_on_taxable_salary=1
where parentfield='deductions' and salary_component in ('TDS', 'Tax Deducted at Source')""")