Skip to content

Commit

Permalink
fix(Monthly Attendance Sheet): parsing error (backport #1415) (#1423)
Browse files Browse the repository at this point in the history
(cherry picked from commit 1ac2f52)

Co-authored-by: Akash  Tom <[email protected]>
  • Loading branch information
mergify[bot] and krantheman authored Feb 12, 2024
1 parent aa49f74 commit 2118961
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -160,12 +160,13 @@ def get_columns_for_days(filters: Filters) -> List[Dict]:
days = []

for day in range(1, total_days + 1):
day = cstr(day)
# forms the dates from selected year and month from filters
date = "{}-{}-{}".format(cstr(filters.year), cstr(filters.month), cstr(day))
date = "{}-{}-{}".format(cstr(filters.year), cstr(filters.month), day)
# gets abbr from weekday number
weekday = day_abbr[getdate(date).weekday()]
# sets days as 1 Mon, 2 Tue, 3 Wed
label = "{} {}".format(cstr(day), weekday)
label = "{} {}".format(day, weekday)
days.append({"label": label, "fieldtype": "Data", "fieldname": day, "width": 65})

return days
Expand Down Expand Up @@ -619,7 +620,7 @@ def get_chart_data(attendance_map: Dict, filters: Filters) -> Dict:

for employee, attendance_dict in attendance_map.items():
for shift, attendance in attendance_dict.items():
attendance_on_day = attendance.get(day["fieldname"])
attendance_on_day = attendance.get(cint(day["fieldname"]))

if attendance_on_day == "On Leave":
# leave should be counted only once for the entire day
Expand Down

0 comments on commit 2118961

Please sign in to comment.