Minor fix in monthly attendance report
Cherry-picked and modified by @anandpdoshi Conflicts: hr/report/monthly_attendance_sheet/monthly_attendance_sheet.py
This commit is contained in:
parent
6298536e46
commit
450d9d72d7
@ -17,6 +17,9 @@ def execute(filters=None):
|
|||||||
data = []
|
data = []
|
||||||
for emp in sorted(att_map):
|
for emp in sorted(att_map):
|
||||||
emp_det = emp_map.get(emp)
|
emp_det = emp_map.get(emp)
|
||||||
|
if not emp_det:
|
||||||
|
continue
|
||||||
|
|
||||||
row = [emp, emp_det.employee_name, emp_det.branch, emp_det.department, emp_det.designation,
|
row = [emp, emp_det.employee_name, emp_det.branch, emp_det.department, emp_det.designation,
|
||||||
emp_det.company]
|
emp_det.company]
|
||||||
|
|
||||||
@ -84,11 +87,11 @@ def get_conditions(filters):
|
|||||||
return conditions, filters
|
return conditions, filters
|
||||||
|
|
||||||
def get_employee_details():
|
def get_employee_details():
|
||||||
employee = frappe.db.sql("""select name, employee_name, designation, department,
|
emp_map = frappe._dict()
|
||||||
branch, company from tabEmployee where docstatus < 2 and status = 'Active'""", as_dict=1)
|
for d in frappe.db.sql("""select name, employee_name, designation,
|
||||||
|
department, branch, company
|
||||||
emp_map = {}
|
from tabEmployee where docstatus < 2
|
||||||
for emp in employee:
|
and status = 'Active'""", as_dict=1):
|
||||||
emp_map[emp.name] = emp
|
emp_map.setdefault(d.name, d)
|
||||||
|
|
||||||
return emp_map
|
return emp_map
|
Loading…
x
Reference in New Issue
Block a user