Merge pull request #24424 from AfshanKhan/fix-add-stat-comp-in-sal-struct
fix: allow statistical component in salary structure.
diff --git a/erpnext/payroll/doctype/salary_structure/salary_structure.py b/erpnext/payroll/doctype/salary_structure/salary_structure.py
index 340f4e8..bf1c746 100644
--- a/erpnext/payroll/doctype/salary_structure/salary_structure.py
+++ b/erpnext/payroll/doctype/salary_structure/salary_structure.py
@@ -216,8 +216,9 @@
return frappe.db.sql("""
select t1.salary_component
from `tabSalary Component` t1, `tabSalary Component Account` t2
- where t1.name = t2.parent
+ where (t1.name = t2.parent
and t1.type = %s
- and t2.company = %s
+ and t2.company = %s)
+ or (t1.statistical_component = 1)
order by salary_component
- """, (filters['type'], filters['company']) )
+ """, (filters['type'], filters['company']))