Hello, an employee applied for one day sick leave which was approved but Half Day was recorded in Attendance:
Attendance report showed leave as half day:
I checked the monthly_attendance_report.py and this is what i found:
if not filters.get(“employee”):
filters.update({“employee”: emp})
conditions += " and employee = %(employee)s"
elif not filters.get(“employee”) == emp:
filters.update({“employee”: emp})
leave_details = frappe.db.sql(“”“select leave_type, status, count(*) as count fromtabAttendance
where leave_type is not NULL %s group by leave_type, status”“” % conditions, filters, as_d$
leaves = {}
for d in leave_details:
if d.status == “Half Day”:
d.count = d.count * 0.5
if d.leave_type in leaves:
leaves[d.leave_type] += d.count
else:
leaves[d.leave_type] = d.count
for d in leave_list:
if d in leaves:
row.append(leaves[d])
else:
row.append(“0.0”)
data.append(row)
return columns, data
How can i correct this error