[Solved] Employee Attendance Timestamp and Custom Status

@hereabdulla , after much investigation and unable to find the source of the issue, i had a do-over: i reverted the changes and modified both attendance.py

def validate(self):
from erpnext.controllers.status_updater import validate_status
validate_status(self.status, [“Present”, “Absent”, “Out of Office”, “On Leave”, “Half Day”])
self.validate_attendance_date()
self.validate_duplicate_record()
self.check_leave_record()

and monthly_attendance_sheet.py

row = [emp, emp_det.employee_name, emp_det.branch, emp_det.department, emp_det.designation,
emp_det.company]
total_p = total_a = total_l = 0.0
for day in range(filters[“total_days_in_month”]):
status = att_map.get(emp).get(day + 1, “None”)
status_map = {“Present”: “P”, “Absent”: “A”, “Out of Office”: “OA”, “Half Day”: “HD”, "On $
if status == “None” and holiday_map:
emp_holiday_list = emp_det.holiday_list if emp_det.holiday_list else default_holid$
if emp_holiday_list in holiday_map and (day+1) in holiday_map[emp_holiday_list]:
status = “Holiday”
row.append(status_map[status])
if status == “Present”:
total_p += 1
elif status == “Absent”:
total_a += 1
elif status == “Out of Office”:
total_p += 1
elif status == “On Leave”:
total_l += 1
elif status == “Half Day”:
total_p += 0.5
total_a += 0.5
row += [total_p, total_l, total_a]
data.append(row)

def get_columns(filters):
columns = [
_(“Employee”) + “:Link/Employee:120”, _(“Employee Name”) + “::140”, _(“Branch”)+ ":Link/Branch:120$
_(“Department”) + “:Link/Department:120”, _(“Designation”) + “:Link/Designation:120”,
(“Company”) + “:Link/Company:120”
]
for day in range(filters[“total_days_in_month”]):
columns.append(cstr(day+1) +“::20”)
columns += [
(“Total Present”) + “:Float:80”, _(“Total Leaves”) + “:Float:80”, _(“Total Absent”) + “:Float:80”, _(“Total Out of Office”) + “:Float:80”]$
return columns

and i was able to validate the attendance status “Out of Office”:

and the monthly attendance report captured the attendance accordingly:

My issue has now been resolved as i have achieved the customization i wanted. It would however be nice if there’s a way for an approved leave day to automatically reflect on the attendance report.

7 Likes