{% extends "base.html" %} {% block title %}{{ ltext('Finished Tickets / التذاكر المنتهية') }} | {{ app_name }}{% endblock %} {% block content %}

{{ ltext('Finished Tickets / التذاكر المنتهية') }}

{{ ltext('Archived tickets that were completed or cancelled. / التذاكر المؤرشفة التي تم إنهاؤها أو إلغاؤها.') }}

{{ ltext('Export Excel / تصدير Excel') }}
{% if archive_groups %}
{% for group in archive_groups %}

{{ ltext(group.title) }}

{{ group.tickets|length }}
{% for ticket in group.tickets %}
{{ ltext('Cancelled / ملغاة') if ticket.is_cancelled else (ticket.status.name if ticket.status else ltext('Finished / منتهية')) }}

{{ (ticket.description[:160] ~ '...') if ticket.description and ticket.description|length > 160 else (ticket.description or t('no_description')) }}

{{ ltext('Company / الشركة') }} {{ ticket.company.name if ticket.company else t('internal') }}
{{ ltext('Department / القسم') }} {{ ticket.department.name if ticket.department else t('unassigned') }}
{{ ltext('Closed / أغلقت') }} {{ ticket.closed_at.strftime('%Y-%m-%d %H:%M') if ticket.closed_at else '-' }}
{{ ltext('Priority / الأولوية') }} {{ ticket.priority.name if ticket.priority else ('N/A'|ltext) }}
{% endfor %}
{% endfor %}
{% else %}

{{ ltext('No finished or cancelled tickets found. / لا توجد تذاكر منتهية أو ملغاة.') }}

{% endif %} {% set pagination = tickets %} {% include "partials/pagination.html" %}
{% endblock %}