diff --git a/erpnext/hr/doctype/attendance/attendance.py b/erpnext/hr/doctype/attendance/attendance.py index e24079ed318..b4650d57da0 100644 --- a/erpnext/hr/doctype/attendance/attendance.py +++ b/erpnext/hr/doctype/attendance/attendance.py @@ -256,7 +256,11 @@ def get_unmarked_days(employee, month, exclude_holidays=0): if joining_date and joining_date.year == today.year and joining_date.month == month_map[month]: start_day = joining_date.day - if relieving_date and relieving_date.month == month_map[month]: + if ( + relieving_date + and relieving_date.year == today.year + and relieving_date.month == month_map[month] + ): end_day = relieving_date.day + 1 dates_of_month = [