Skip to content

Commit

Permalink
fix: submit attendance request for future dates (#2352)
Browse files Browse the repository at this point in the history
  • Loading branch information
AyshaHakeem authored Oct 30, 2024
1 parent 852c13f commit 97559c3
Showing 1 changed file with 1 addition and 12 deletions.
13 changes: 1 addition & 12 deletions hrms/hr/doctype/attendance/attendance.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,18 +50,7 @@ def on_cancel(self):
def validate_attendance_date(self):
date_of_joining = frappe.db.get_value("Employee", self.employee, "date_of_joining")

# leaves can be marked for future dates
if (
self.status != "On Leave"
and not self.leave_application
and getdate(self.attendance_date) > getdate(nowdate())
):
frappe.throw(
_("Attendance can not be marked for future dates: {0}").format(
frappe.bold(format_date(self.attendance_date)),
)
)
elif date_of_joining and getdate(self.attendance_date) < getdate(date_of_joining):
if date_of_joining and getdate(self.attendance_date) < getdate(date_of_joining):
frappe.throw(
_("Attendance date {0} can not be less than employee {1}'s joining date: {2}").format(
frappe.bold(format_date(self.attendance_date)),
Expand Down

0 comments on commit 97559c3

Please sign in to comment.