Mar 06 2026: fixed employee exported empty

This commit is contained in:
2026-03-06 16:01:40 -05:00
parent f96009df90
commit e04935772b
2 changed files with 21 additions and 0 deletions
+9
View File
@@ -9613,7 +9613,16 @@ def export_time_attendance_excel(records, project_name_for_filename, date_range_
if _di + 1 >= len(sorted_dk):
continue
# Guard: _dk or _ndk may have been deleted by a prior iteration
# when all its records were moved to the previous day's bucket.
# Without this check, iterating the stale sorted_dk snapshot raises KeyError.
if _dk not in daily_location_data:
continue
_ndk = sorted_dk[_di + 1]
if _ndk not in daily_location_data:
continue
# Must be consecutive calendar days
_dn = datetime.strptime(_dk, '%Y-%m-%d').date()
_dn1 = datetime.strptime(_ndk, '%Y-%m-%d').date()