{% extends 'base.html' %} {% block content %}
| # | Employee | Dates | Days | Leave | Reason | Action | |
|---|---|---|---|---|---|---|---|
| {{ loop.index }} |
{{ r.employee.full_name }}
{{ r.employee.code }}
|
{% set applied_local = r.applied_on + timedelta(hours=5, minutes=30) if r.applied_on else None %}
{{ r.start_date.strftime('%d-%b-%Y') }}
{% if r.end_date != r.start_date %}
→
{{ r.end_date.strftime('%d-%b-%Y') }}
{% endif %}
Requested on:
{{ applied_local.strftime('%d-%b-%Y %I:%M %p') if applied_local else '-' }}
{% if r.half_day %}
Half Day
{% endif %}
|
{{ r.total_days if r.total_days else (0.5 if r.half_day else 1) }} | {{ r.leave_type.name }} | {{ r.reason }} |
|
| # | Employee | Dates | Days | Leave | Status | HR Remark | Action |
|---|---|---|---|---|---|---|---|
| {{ loop.index }} |
{{ r.employee.full_name }}
{{ r.employee.code }}
|
{% set applied_local = r.applied_on + timedelta(hours=5, minutes=30) if r.applied_on else None %}
{{ r.start_date.strftime('%d-%b-%Y') }}
{% if r.end_date != r.start_date %}
→
{{ r.end_date.strftime('%d-%b-%Y') }}
{% endif %}
Requested on:
{{ applied_local.strftime('%d-%b-%Y %I:%M %p') if applied_local else '-' }}
{% if r.half_day %}
Half Day
{% endif %}
|
{{ r.total_days if r.total_days else (0.5 if r.half_day else 1) }} | {{ r.leave_type.name }} | {% set s = r.status %} {% if s == 'final_approved' %} HR Approved {% elif s == 'rejected' %} Rejected {% elif s == 'manager_approved' %} Manager Approved {% elif s == 'cancelled' %} Cancelled by HR {% else %} {{ s|replace('_',' ')|capitalize }} {% endif %} |
{% set hr_logs = r.approval_logs | selectattr('approver_role','equalto','hr') | list %}
{% if hr_logs %}
{% set last = hr_logs[-1] %}
{{ last.status|capitalize }}
{{ last.remark or '—' }}
{% else %}
—
{% endif %}
|
{% if r.status == 'final_approved' %} {% elif r.status == 'cancelled' %} Already cancelled {% else %} — {% endif %} |