mirror of
https://github.com/frappe/erpnext.git
synced 2026-06-01 03:09:09 +00:00
Merge pull request #7373 from KanchanChauhan/leave-for-absent
[Fix] Attendance validation in Leave Application
This commit is contained in:
@@ -217,7 +217,7 @@ class LeaveApplication(Document):
|
|||||||
|
|
||||||
def validate_attendance(self):
|
def validate_attendance(self):
|
||||||
attendance = frappe.db.sql("""select name from `tabAttendance` where employee = %s and (att_date between %s and %s)
|
attendance = frappe.db.sql("""select name from `tabAttendance` where employee = %s and (att_date between %s and %s)
|
||||||
and docstatus = 1""",
|
and status = "Present" and docstatus = 1""",
|
||||||
(self.employee, self.from_date, self.to_date))
|
(self.employee, self.from_date, self.to_date))
|
||||||
if attendance:
|
if attendance:
|
||||||
frappe.throw(_("Attendance for employee {0} is already marked for this day").format(self.employee),
|
frappe.throw(_("Attendance for employee {0} is already marked for this day").format(self.employee),
|
||||||
|
|||||||
Reference in New Issue
Block a user