From 07e6bdd4f2890717a50b24d370b59816a4d0cf44 Mon Sep 17 00:00:00 2001 From: mbauskar Date: Wed, 29 Mar 2017 18:40:42 +0530 Subject: [PATCH] [minor] check employee date of joining before marking the employee attendance --- erpnext/hr/doctype/attendance/attendance.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/erpnext/hr/doctype/attendance/attendance.py b/erpnext/hr/doctype/attendance/attendance.py index feecae08eb..2e087f5c01 100644 --- a/erpnext/hr/doctype/attendance/attendance.py +++ b/erpnext/hr/doctype/attendance/attendance.py @@ -32,6 +32,8 @@ class Attendance(Document): def validate_att_date(self): if getdate(self.att_date) > getdate(nowdate()): frappe.throw(_("Attendance can not be marked for future dates")) + elif getdate(self.att_date) < frappe.db.get_value("Employee", self.employee, "date_of_joining"): + frappe.throw(_("Attendance date can not be less than employee's joining date")) def validate_employee(self): emp = frappe.db.sql("select name from `tabEmployee` where name = %s and status = 'Active'",