From dab10cc234624d6416676a54be1d61c45ca3e38b Mon Sep 17 00:00:00 2001 From: Horilla Date: Thu, 8 Aug 2024 11:47:01 +0530 Subject: [PATCH] [UPDT] ATTENDANCE: Added indication for employees with leave and marked attendance --- attendance/models.py | 5 +++-- .../templates/attendance/work_record/work_record_list.html | 5 +++++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/attendance/models.py b/attendance/models.py index 8ae21e290..83dfd1731 100644 --- a/attendance/models.py +++ b/attendance/models.py @@ -1069,8 +1069,9 @@ class OverrideAttendances(Attendance): if status == "HDP" and work_record.is_leave_record: message = _("Half day leave") - - if status == "FDP": + elif status == "FDP" and work_record.is_leave_record: + message = _("An approved leave exists") + elif status == "FDP": message = _("Present") work_record.message = message diff --git a/attendance/templates/attendance/work_record/work_record_list.html b/attendance/templates/attendance/work_record/work_record_list.html index 006c13725..c673ea15d 100644 --- a/attendance/templates/attendance/work_record/work_record_list.html +++ b/attendance/templates/attendance/work_record/work_record_list.html @@ -49,6 +49,10 @@ {% trans "Absent" %} + + + {% trans "On leave, But attendance exist" %} + {% trans "Half Day Present" %} @@ -82,6 +86,7 @@ background-color: #a8b1ff; color: #fff {% elif work_record %} {% if work_record.work_record_type == 'CONF' %}background-color: #ed4c4c; color: #fff + {% elif work_record.is_leave_record and work_record.work_record_type == 'FDP' %}background-color: #c65d0f; color: #fff {% elif work_record.work_record_type == 'FDP' %}background-color: #38c338; color: #fff {% elif work_record.work_record_type == 'HDP' %}background-color: #dfdf52; {% elif work_record.work_record_type == 'ABS' %}background-color: #808080; color: #fff