From 98cccf221e5d1d191b78bb1cb5a879e461e71b71 Mon Sep 17 00:00:00 2001 From: Rucha Mahabal Date: Tue, 19 Apr 2022 13:17:36 +0530 Subject: [PATCH] fix: shift fetching fails in Employee Checkin if shift assignment has an end date Co-authored-by: Ejaaz Khan --- erpnext/hr/doctype/shift_assignment/shift_assignment.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/hr/doctype/shift_assignment/shift_assignment.py b/erpnext/hr/doctype/shift_assignment/shift_assignment.py index 0b21c00eac..cbf798e690 100644 --- a/erpnext/hr/doctype/shift_assignment/shift_assignment.py +++ b/erpnext/hr/doctype/shift_assignment/shift_assignment.py @@ -251,7 +251,7 @@ def get_shifts_for_date(employee: str, for_timestamp: datetime) -> List[Dict[str Criterion.any( [ assignment.end_date.isnull(), - (assignment.end_date.isnotnull() & (getdate(for_timestamp.date()) >= assignment.end_date)), + (assignment.end_date.isnotnull() & (getdate(for_timestamp.date()) <= assignment.end_date)), ] ) )