Added default 'All' option to filters to differentiate all and empty filter
diff --git a/erpnext/hr/doctype/employee_attendance_tool/employee_attendance_tool.js b/erpnext/hr/doctype/employee_attendance_tool/employee_attendance_tool.js
index de8e17c..c0c0ef0 100644
--- a/erpnext/hr/doctype/employee_attendance_tool/employee_attendance_tool.js
+++ b/erpnext/hr/doctype/employee_attendance_tool/employee_attendance_tool.js
@@ -4,6 +4,7 @@
},
onload: function(frm) {
+ frm.doc.department = frm.doc.branch = frm.doc.company = "All";
frm.set_value("date", get_today());
erpnext.employee_attendance_tool.load_employees(frm);
},
diff --git a/erpnext/hr/doctype/employee_attendance_tool/employee_attendance_tool.py b/erpnext/hr/doctype/employee_attendance_tool/employee_attendance_tool.py
index 7438737..6ddb722 100644
--- a/erpnext/hr/doctype/employee_attendance_tool/employee_attendance_tool.py
+++ b/erpnext/hr/doctype/employee_attendance_tool/employee_attendance_tool.py
@@ -13,11 +13,18 @@
@frappe.whitelist()
-def get_employees(date, department=None, branch=None, company=None):
+def get_employees(date, department = None, branch = None, company = None):
attendance_not_marked = []
attendance_marked = []
- employee_list = frappe.get_list("Employee", fields=["employee", "employee_name"], filters={
- "status": "Active", "department": department, "branch": branch, "company": company}, order_by="employee_name")
+ filters = {"status": "Active"}
+ if department != "All":
+ filters["department"] = department
+ if branch != "All":
+ filters["branch"] = branch
+ if company != "All":
+ filters["company"] = company
+
+ employee_list = frappe.get_list("Employee", fields=["employee", "employee_name"], filters=filters, order_by="employee_name")
marked_employee = {}
for emp in frappe.get_list("Attendance", fields=["employee", "status"],
filters={"attendance_date": date}):