diff --git a/cron/reports.py b/cron/reports.py index 293edd6..62e1570 100644 --- a/cron/reports.py +++ b/cron/reports.py @@ -328,6 +328,7 @@ def sync_attendance_to_tcaoff( # Start with a blank user to time mapping: user_id_to_time = {} + status_count = defaultdict(int) # For each unique user id, # Check the no of times when he successfully triggered the attendance-punching device: @@ -452,6 +453,7 @@ def sync_attendance_to_tcaoff( elif 7.5 < hours_worked <= 10.0: status = "P" elif 2.5 < hours_worked <= 5.0: status = "H" else: status = "A" + status_count[status] += 1 success = tcaoff.attendance_mark( tcaoff_creds, user_id = tcaoff_team["user_id"], @@ -462,6 +464,9 @@ def sync_attendance_to_tcaoff( if success: response["success"] += 1 else: response["fail"] += 1 + # Show the stats: + print("WORKING HOUR STATUS STATS:", json.to_string(status_count)) + # Done here: print("TCAOFF-Cosec Attendance Sync.:", json.to_string(response)) return response