From b7ae1c1076ad3e4a9c51cdc2eda7fb8dc464b7ef Mon Sep 17 00:00:00 2001 From: Valmik Jangla Date: Wed, 17 Feb 2016 15:05:35 +0530 Subject: [PATCH 1/2] Inactive employees show up in report --- .../monthly_attendance_sheet/monthly_attendance_sheet.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/erpnext/hr/report/monthly_attendance_sheet/monthly_attendance_sheet.py b/erpnext/hr/report/monthly_attendance_sheet/monthly_attendance_sheet.py index d7787b5aa2..68914ea2d3 100644 --- a/erpnext/hr/report/monthly_attendance_sheet/monthly_attendance_sheet.py +++ b/erpnext/hr/report/monthly_attendance_sheet/monthly_attendance_sheet.py @@ -27,7 +27,7 @@ def execute(filters=None): total_p = total_a = 0.0 for day in range(filters["total_days_in_month"]): status = att_map.get(emp).get(day + 1, "None") - status_map = {"Present": "P", "Absent": "A", "Half Day": "H", "None":" "} + status_map = {"Present": "P", "Absent": "A", "Half Day": "H", "None": ""} row.append(status_map[status]) if status == "Present": @@ -39,7 +39,6 @@ def execute(filters=None): total_a += 0.5 row += [total_p, total_a] - data.append(row) return columns, data @@ -96,9 +95,8 @@ def get_conditions(filters): def get_employee_details(): emp_map = frappe._dict() for d in frappe.db.sql("""select name, employee_name, designation, - department, branch, company - from tabEmployee where docstatus < 2 - and status = 'Active'""", as_dict=1): + department, branch, company, status + from tabEmployee""", as_dict=1): emp_map.setdefault(d.name, d) return emp_map From 7ae844f0a02a98799aef598f5edd3c0a5016842b Mon Sep 17 00:00:00 2001 From: Valmik Jangla Date: Wed, 17 Feb 2016 15:06:30 +0530 Subject: [PATCH 2/2] Minor fix --- .../report/monthly_attendance_sheet/monthly_attendance_sheet.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/hr/report/monthly_attendance_sheet/monthly_attendance_sheet.py b/erpnext/hr/report/monthly_attendance_sheet/monthly_attendance_sheet.py index 68914ea2d3..fe11406b30 100644 --- a/erpnext/hr/report/monthly_attendance_sheet/monthly_attendance_sheet.py +++ b/erpnext/hr/report/monthly_attendance_sheet/monthly_attendance_sheet.py @@ -95,7 +95,7 @@ def get_conditions(filters): def get_employee_details(): emp_map = frappe._dict() for d in frappe.db.sql("""select name, employee_name, designation, - department, branch, company, status + department, branch, company from tabEmployee""", as_dict=1): emp_map.setdefault(d.name, d)