Skip to content

Commit

Permalink
fix: submit attendance request for future dates (backport #2352) (#2365)
Browse files Browse the repository at this point in the history
Co-authored-by: Aysha <[email protected]>
  • Loading branch information
mergify[bot] and AyshaHakeem authored Oct 30, 2024
1 parent ec0b808 commit 5ed555f
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 5ed555f

Please sign in to comment.