{% extends "layouts/base.twig" %} {% block title %}{{ translations.orders_title }}{% endblock %} {% block page_heading %}

{{ translations.orders_heading }}

{{ translations.orders_subtitle }}

{% endblock %} {% block content %} {% include "page_components/messages.twig" %} {# Filters #}
{# Orders table #}
{% if orders is empty %}

{{ translations.orders_empty }}

{% else %}
{% for order in orders %} {% endfor %}
{{ translations.orders_col_order_key }} {{ translations.orders_col_shop }} {{ translations.orders_col_order_date }} {{ translations.orders_col_expected_date }} {{ translations.orders_col_value_net }} {{ translations.orders_col_status }}
{{ order.order_key }} {{ order.shop_name ?? '—' }} {{ order.order_date ? order.order_date|date('d.m.Y') : '—' }} {{ order.expected_date ? order.expected_date|date('d.m.Y') : '—' }} {{ order.approximate_value_net is not null ? order.approximate_value_net|number_format(2, '.', ' ') : '—' }} {% set statusMap = { 'NEW': 'primary', 'IN_TRANSIT': 'info', 'DELIVERED': 'success', 'CANCELLED': 'danger', 'ARCHIVED': 'secondary' } %} {% set badgeColor = statusMap[order.status] ?? 'secondary' %} {% set statusLabel = translations['orders_status_' ~ order.status|lower|replace({'-': '_', ' ': '_'})] ?? order.status %} {{ statusLabel }}
{% endif %}
{% endblock %}