{% extends "base.html" %} {% block content %}
|
|
{% for cell in days %}
{{ cell.date.day }}
{{ cell.date.strftime('%a') }}
|
{% endfor %}
|---|---|
|
{{ emp.full_name }}
{{ emp.employee_code }}
{% if frozen %}
· Payroll Frozen
{% endif %}
|
{% for cell in row.days %}
{% set a = cell.record %}
{% set remark = a.remarks if a else '' %}
{% set is_manual = (a and (a.source in ['Manual','Bulk'])) %}
{% set hl = cell.half_leave %}
{% set is_rh_leave = cell.is_rh_leave|default(false) %}
{% set is_wfh = cell.is_wfh|default(false) %}
{# second-half derived from Attendance.note if present: "SH:Present" etc #}
{% set sh = '' %}
{% if a and a.note %}
{% if 'SH:' in a.note %}
{% set sh = (a.note.split('SH:')[1].split('|')[0]).strip() %}
{% endif %}
{% endif %}
{# ✅ UI override for Holiday/Weekend if stored as blank/LWP or no row #}
{% set is_holiday_day = holiday_dates and (cell.date in holiday_dates) %}
{% set is_weekend_day = weekend_dates and (cell.date in weekend_dates) %}
{% set display_remark = remark %}
{% if is_rh_leave %}
{% set display_remark = 'RH' %}
{% elif (not hl) and (not is_manual) and is_holiday_day and ((not a) or (remark in ['', 'LWP'])) %}
{% set display_remark = 'Holiday' %}
{% elif (not hl) and (not is_manual) and is_weekend_day and ((not a) or (remark in ['', 'LWP'])) %}
{% set display_remark = 'Weekend' %}
{% endif %}
{% endfor %} |