Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(Monthly Attendance Sheet): parsing error (backport #1415) #1422

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading