(20260219) Updarted APIs to now show last-in time and loc also.

This commit is contained in:
2026-02-19 14:48:41 +05:30
parent 81021a4b38
commit d8aaf942b2
7 changed files with 360 additions and 218 deletions
@@ -307,10 +307,22 @@ async def in_out_report_generate(
"status": r.get("status"),
"firstIn": cosec_notes.get("firstIn"),
"firstInLoc": cosec_notes.get("firstInLoc"),
"lastIn": cosec_notes.get("lastIn"),
"lastInLoc": cosec_notes.get("lastInLoc"),
"lastOut": cosec_notes.get("lastOut"),
"lastOutLoc": cosec_notes.get("lastOutLoc"),
"workSeconds": cosec_notes.get("workSeconds"),
"workHours": cosec_notes.get("workHours"),
})
# Remove unwanted records:
from_ts = inbound_data.fromDate.timestamp()
to_ts = inbound_data.toDate.timestamp()
cumulative_register = [
cr for cr in cumulative_register
if from_ts <= cr["date"] <= to_ts
]
# Sort the records:
cumulative_register = sorted(cumulative_register, key = lambda x: x["date"])
print(f"REGISTER ({len(cumulative_register)}):", json.to_string(cumulative_register[-10:]))