From e0ff9142accec3660e01bad6ffb47411bd049349 Mon Sep 17 00:00:00 2001 From: Rucha Mahabal Date: Mon, 27 Apr 2020 13:29:46 +0530 Subject: [PATCH] fix: show date in the message for already marked attendance --- erpnext/hr/doctype/attendance/attendance.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/erpnext/hr/doctype/attendance/attendance.py b/erpnext/hr/doctype/attendance/attendance.py index b6c80655c2..9df097923e 100644 --- a/erpnext/hr/doctype/attendance/attendance.py +++ b/erpnext/hr/doctype/attendance/attendance.py @@ -35,13 +35,14 @@ class Attendance(Document): and docstatus != 2 """, (self.employee, getdate(self.attendance_date), self.name)) if res: - frappe.throw(_("Attendance for employee {0} is already marked").format(self.employee)) + frappe.throw(_("Attendance for employee {0} is already marked for the date {1}").format( + frappe.bold(self.employee), frappe.bold(self.attendance_date))) def check_leave_record(self): leave_record = frappe.db.sql(""" select leave_type, half_day, half_day_date from `tabLeave Application` - where employee = %s + where employee = %s and %s between from_date and to_date and status = 'Approved' and docstatus = 1