Files
schuetz3-erpnext/erpnext/patches/v11_0/set_salary_component_properties.py
Ankush Menat c07713b860 style: bulk format code with black
v13 port because otherwise backports will result in conflicts always
2022-03-29 17:29:34 +05:30

23 lines
739 B
Python

import frappe
def execute():
frappe.reload_doc("Payroll", "doctype", "salary_detail")
frappe.reload_doc("Payroll", "doctype", "salary_component")
frappe.db.sql("update `tabSalary Component` set is_tax_applicable=1 where type='Earning'")
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')"""
)