{% extends "base.html" %} {% block title %}{{ _('Workforce Governance') }}{% endblock %} {% block content %}

{{ _('Workforce Governance') }}

{% if users %}
{% endif %}

{{ _('Exports') }}

{{ _('Download payroll, capacity, and compliance exports') }}

{{ _('Timesheet Periods') }}

{% for p in periods %}
{{ p.period_start }} - {{ p.period_end }}
{{ _('Status') }}: {{ p.status }}
{% if p.status != 'closed' and p.user_id == current_user.id %}
{% endif %} {% if can_approve and p.status in ['submitted', 'rejected'] %}
{% endif %} {% if current_user.is_admin and p.status != 'closed' %}
{% endif %} {% set p_status_val = p.status.value if p.status is defined and p.status.value is defined else (p.status|string) %} {% if p_status_val in ['draft', 'rejected'] and (p.user_id == current_user.id or current_user.is_admin) %}
{% endif %}
{% else %}

{{ _('No timesheet periods yet.') }}

{% endfor %}

{{ _('Leave Balances') }}

{% if overtime_ytd_hours is defined %}

{{ _('Accumulated overtime (YTD)') }}: {{ "%.2f"|format(overtime_ytd_hours) }}h {% if overtime_leave_type_id and overtime_ytd_hours > 0 %} — {{ _('Take as paid leave') }} {% endif %}

{% endif %}
{% for b in balances %} {% else %} {% endfor %}
{{ _('Type') }} {{ _('Allowance') }} {{ _('Used') }} {{ _('Remaining') }}
{{ b.leave_type_name }} {{ b.allowance_hours if b.allowance_hours is not none else '-' }} {{ b.used_hours }} {{ b.remaining_hours if b.remaining_hours is not none else '-' }}
{{ _('No leave types configured.') }}

{{ _('Time-Off Requests') }}

0 %}data-overtime-max="{{ "%.2f"|format(overtime_ytd_hours) }}"{% endif %}> {% if overtime_ytd_hours is defined and overtime_ytd_hours > 0 %} {% endif %}
{% for r in leave_requests %} {% set r_status = r.status.value if r.status.value is defined else r.status %}
{{ r.leave_type.name if r.leave_type else r.leave_type_id }}: {{ r.start_date }} - {{ r.end_date }}
{{ _('Status') }}: {{ r_status }}
{% if can_approve and r_status in ['submitted', 'draft'] %}
{% endif %} {% if r_status in ['draft', 'submitted', 'cancelled'] and (r.user_id == current_user.id or can_approve) %}
{% endif %}
{% endfor %}

{{ _('Capacity') }} ({{ cap_start.isoformat() }} - {{ cap_end.isoformat() }})

{% for row in capacity %} {% else %} {% endfor %}
{{ _('User') }} {{ _('Expected') }} {{ _('Allocated') }} {{ _('Time Off') }} {{ _('Available') }} {{ _('Utilization %') }}
{{ row.username }} {{ row.expected_hours }} {{ row.allocated_hours }} {{ row.time_off_hours }} {{ row.available_hours }} {{ row.utilization_pct }}
{{ _('No capacity data available.') }}
{% if current_user.is_admin %}

{{ _('Timesheet Policy') }}

{{ _('Leave Types') }}

{% for lt in leave_types %}
{{ lt.name }} ({{ lt.code }}){% if not lt.enabled %} — {{ _('disabled') }}{% endif %}
{% else %}

{{ _('No leave types configured.') }}

{% endfor %}

{{ _('Company Holidays') }}

{% for h in holidays %}
{{ h.start_date }} - {{ h.end_date }}: {{ h.name }}{% if h.region %} ({{ h.region }}){% endif %}
{% else %}
{{ _('No holidays configured.') }}
{% endfor %}
{% endif %}
{% block scripts_extra %} {% endblock %} {% endblock %}