From 4178030c992ada6ce443118af10a98e95f01565e Mon Sep 17 00:00:00 2001 From: Rohit Waghchaure Date: Fri, 29 Jun 2018 17:30:29 +0530 Subject: [PATCH] [Fix] Patch --- .../v11_0/set_salary_component_properties.py | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/erpnext/patches/v11_0/set_salary_component_properties.py b/erpnext/patches/v11_0/set_salary_component_properties.py index 8cc3a330b1..a45c38fe09 100644 --- a/erpnext/patches/v11_0/set_salary_component_properties.py +++ b/erpnext/patches/v11_0/set_salary_component_properties.py @@ -1,13 +1,16 @@ import frappe def execute(): - 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'") + frappe.reload_doc('hr', 'doctype', 'salary_detail') + frappe.reload_doc('hr', 'doctype', 'salary_component') - 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 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'") - 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')""") \ No newline at end of file + 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')""") \ No newline at end of file