Skip to content

Commit

Permalink
fix: Half Day Leave Application Link To Half Day Attendance (backport #…
Browse files Browse the repository at this point in the history
…1147) (#1202)

(cherry picked from commit 30d507f)

Co-authored-by: Parameshwari Palanisamy <[email protected]>
  • Loading branch information
mergify[bot] and creative-paramu authored Dec 21, 2023
1 parent fcdbf2e commit b2af5a4
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion hrms/hr/doctype/attendance/attendance.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ def validate_employee_status(self):
def check_leave_record(self):
leave_record = frappe.db.sql(
"""
select leave_type, half_day, half_day_date
select leave_type, half_day, half_day_date, name
from `tabLeave Application`
where employee = %s
and %s between from_date and to_date
Expand All @@ -160,6 +160,7 @@ def check_leave_record(self):
if leave_record:
for d in leave_record:
self.leave_type = d.leave_type
self.leave_application = d.name
if d.half_day_date == getdate(self.attendance_date):
self.status = "Half Day"
frappe.msgprint(
Expand Down

0 comments on commit b2af5a4

Please sign in to comment.