mirror of
https://github.com/frappe/erpnext.git
synced 2026-03-18 01:36:55 +00:00
[minor] check employee date of joining before marking the employee attendance
This commit is contained in:
@@ -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'",
|
||||
|
||||
Reference in New Issue
Block a user