Mark attendance only if to_date <= nowdate in Leave Application

This commit is contained in:
Shreya 2018-05-17 17:13:56 +05:30
parent 7c9a6eba3f
commit 65dd1f6b4c

View File

@ -116,7 +116,7 @@ class LeaveApplication(Document):
frappe.db.sql("""update `tabAttendance` set status = %s, leave_type = %s\
where name = %s""",(status, self.leave_type, d.name))
elif self.from_date <= nowdate():
elif self.to_date <= nowdate():
for dt in daterange(getdate(self.from_date), getdate(self.to_date)):
date = dt.strftime("%Y-%m-%d")
if not date == self.half_day_date: