Merge pull request #20537 from Alchez/dev-wfh-attendance-report

fix: show WFH in monthly attendance sheet report
This commit is contained in:
Deepesh Garg 2020-02-06 18:20:55 +05:30 committed by GitHub
commit 38f7e7b9f0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -37,13 +37,22 @@ def execute(filters=None):
total_p = total_a = total_l = 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": "HD", "On Leave": "L", "None": "", "Holiday":"<b>H</b>"}
if status == "None" and holiday_map:
status = att_map.get(emp).get(day + 1)
status_map = {
"Absent": "A",
"Half Day": "HD",
"Holiday":"<b>H</b>",
"On Leave": "L",
"Present": "P",
"Work From Home": "WFH"
}
if status is None and holiday_map:
emp_holiday_list = emp_det.holiday_list if emp_det.holiday_list else default_holiday_list
if emp_holiday_list in holiday_map and (day+1) in holiday_map[emp_holiday_list]:
status = "Holiday"
row.append(status_map[status])
row.append(status_map.get(status, ""))
if status == "Present":
total_p += 1