diff --git a/erpnext/hr/doctype/salary_component/salary_component.js b/erpnext/hr/doctype/salary_component/salary_component.js index a7e2899196..74afd54cfc 100644 --- a/erpnext/hr/doctype/salary_component/salary_component.js +++ b/erpnext/hr/doctype/salary_component/salary_component.js @@ -52,10 +52,16 @@ frappe.ui.form.on('Salary Component', { create_separate_payment_entry_against_benefit_claim: function(frm) { if(frm.doc.create_separate_payment_entry_against_benefit_claim){ frm.set_df_property("accounts", "reqd", 1); + frm.set_value("only_tax_impact", 0); } else{ frm.set_df_property("accounts", "reqd", 0); } + }, + only_tax_impact: function(frm) { + if(frm.only_tax_impact){ + frm.set_value("create_separate_payment_entry_against_benefit_claim", 0); + } } }); diff --git a/erpnext/hr/doctype/salary_component/salary_component.json b/erpnext/hr/doctype/salary_component/salary_component.json index b92098fe28..bd3dd205fb 100644 --- a/erpnext/hr/doctype/salary_component/salary_component.json +++ b/erpnext/hr/doctype/salary_component/salary_component.json @@ -410,7 +410,7 @@ "bold": 0, "collapsible": 0, "columns": 0, - "depends_on": "eval:doc.type==\"Earning\" && doc.is_additional_component != 1", + "depends_on": "eval:doc.type==\"Earning\" && doc.is_additional_component != 1 && doc.statistical_component!=1", "fieldname": "flexible_benefits", "fieldtype": "Section Break", "hidden": 0, @@ -573,7 +573,7 @@ "bold": 0, "collapsible": 0, "columns": 0, - "depends_on": "is_flexible_benefit", + "depends_on": "eval:doc.is_flexible_benefit == 1 & doc.create_separate_payment_entry_against_benefit_claim !=1", "fieldname": "only_tax_impact", "fieldtype": "Check", "hidden": 0, @@ -606,7 +606,7 @@ "bold": 0, "collapsible": 0, "columns": 0, - "depends_on": "is_flexible_benefit", + "depends_on": "eval:doc.is_flexible_benefit == 1 & doc.only_tax_impact !=1", "fieldname": "create_separate_payment_entry_against_benefit_claim", "fieldtype": "Check", "hidden": 0, @@ -703,7 +703,7 @@ "bold": 0, "collapsible": 0, "columns": 0, - "depends_on": "eval:doc.is_payable == 1", + "depends_on": "eval:doc.is_payable == 1 && doc.statistical_component != 1", "fieldname": "section_break_5", "fieldtype": "Section Break", "hidden": 0, @@ -1003,7 +1003,7 @@ "issingle": 0, "istable": 0, "max_attachments": 0, - "modified": "2018-06-22 17:27:08.334858", + "modified": "2018-06-29 13:59:12.958648", "modified_by": "Administrator", "module": "HR", "name": "Salary Component", @@ -1057,4 +1057,4 @@ "sort_order": "DESC", "track_changes": 0, "track_seen": 0 -} \ No newline at end of file +}