fix: update attendace from leave application (#21155)

This commit is contained in:
Nabin Hait 2020-04-06 10:15:38 +05:30 committed by GitHub
parent 0268c553a3
commit 75ef458b34
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -130,7 +130,7 @@ class LeaveApplication(Document):
if self.status == "Approved":
for dt in daterange(getdate(self.from_date), getdate(self.to_date)):
date = dt.strftime("%Y-%m-%d")
status = "Half Day" if date == self.half_day_date else "On Leave"
status = "Half Day" if getdate(date) == getdate(self.half_day_date) else "On Leave"
attendance_name = frappe.db.exists('Attendance', dict(employee = self.employee,
attendance_date = date, docstatus = ('!=', 2)))