{% extends "base.html" %} {% block title %}Attendance · {{ month_name }} · WageWise Neo{% endblock %} {% block content %} {% if locked_run %}

🔒 {{ month_name }} is finalized and locked. This month's payroll has already been finalized — attendance can't be edited to avoid a mismatch with figures that may already be filed with PF/ESI or paid out. {% if is_admin %}An Admin can reopen it from the Payroll Run page if a genuine correction is needed.{% endif %}

{% endif %}
{% for code, label, cls in [('P','Present','s-P'),('A','Absent','s-A'),('CL','Casual Leave','s-CL'),('SL','Sick Leave','s-SL'),('HD','Half Day','s-HD'),('H','Holiday','s-H'),('L','Late','s-L')] %}
{{ code[0] }}
{{ code }} — {{ label }}
{% endfor %} Click any cell to cycle status · Sundays auto-marked H
Company Holidays — {{ month_name }} (marks H for all employees)
{% for h in holidays_rows %} {% if h.holiday_date.startswith(year|string ~ '-' ~ '%02d'|format(month)) %} {{ h.holiday_date[8:] }} — {{ h.description or 'Holiday' }}
{% endif %} {% endfor %}
Weekly Off: {{ weekly_off_name }} — change in Company Settings
{% for d in range(1, days_in_month + 1) %} {% set is_future = d > max_editable_day %} {% set day_title = "This date is in the future — attendance can't be marked yet" if is_future else "Click to mark all Present for day " ~ d %} {% endfor %} {% for emp in employees %} {% for d in range(1, days_in_month + 1) %} {% set st = att_map.get((emp.id, d), '') %} {% set is_sun = d in sundays %} {% set is_future = d > max_editable_day %} {% endfor %} {% set s = summaries[emp.id] %} {% for code in ['P','A','CL','SL','HD','H','L'] %} {% endfor %} {% endfor %}
Employee{{ d }}PACLSLHDHL Days
{{ emp.full_name }} {% if emp.employee_code %}#{{ emp.employee_code }}{% endif %} {{ st }} {{ s.counts[code] or '' }}{{ s.worked }}
{% if locked_run %} 🔒 Locked — this month is finalized. Attendance cannot be edited. {% else %} Discard changes Changes save automatically as you click — the button is just for a manual save. {% endif %}
{% endblock %}