{% extends "layouts/base.twig" %} {% block title %}{{ translations.orders_title | default('Zamówienia klientów') }}{% endblock %} {% block head %} {% endblock %} {% block page_heading %}

{{ translations.orders_title | default('Zamówienia klientów') }}

{{ translations.orders_subtitle | default('Przeglądaj zamówienia klientów oczekujące na realizację.') }}

{% endblock %} {% block content %} {# ── Formularz filtrów ───────────────────────────────────────────────────── #}
{# Data odbioru #}
{# Nazwa klienta #}
{# Tylko oczekujące #}
{# Ukryte pole — wartość zmieniana przez JS #}
{# Przyciski #}
{# ── Tabela zamówień ─────────────────────────────────────────────────────── #}
{{ translations.orders | default('Zamówienia') }} — {{ date | date('d.m.Y') }} {{ orders | length }} {{ translations.orders_count | default('zamówień') }}
{% if orders is not empty %} {% for order in orders %} {# Klient #} {# Typ klienta #} {# Data i godzina odbioru #} {# Wartość #} {# Inicjały osoby przyjmującej #} {# Status #} {# Akcja – szczegóły #} {% endfor %} {% else %} {% endif %}
{{ translations.col_client | default('Klient') }} {{ translations.col_type | default('Typ') }} {{ translations.col_pickup | default('Data odbioru') }} {{ translations.col_value | default('Wartość') }} {{ translations.col_accepted_by | default('Przyjął') }} {{ translations.col_status | default('Status') }}
{{ order.getClientName() ?? translations.not_available | default('—') }} {% if order.getClientPhone() %}
{{ order.getClientPhone() }}
{% endif %}
{% if order.isB2B() %} {{ translations.type_b2b | default('Firma') }} {% else %} {{ translations.type_individual | default('Indywidualny') }} {% endif %} {% if order.getPickUpDatetime() %} {{ order.getPickUpDatetime() | date('H:i') }}
{{ order.getPickUpDatetime() | date('d.m.Y') }}
{% else %} {{ translations.not_available | default('—') }} {% endif %}
{{ order.getTotalValue() | number_format(2, ',', ' ') }} {{ constant('APP_CURRENCY_SYMBOL') }} {% if order.getAcceptingEmployeeInitials() %} {{ order.getAcceptingEmployeeInitials() }} {% else %} {{ translations.not_available | default('—') }} {% endif %} {% set statusKey = order.getOrderStatus() | lower | default('unknown') %} {% set statusLabel = translations['status_' ~ statusKey] | default(order.getOrderStatus() | capitalize | default('?')) %} {{ statusLabel }}
{{ translations.no_orders | default('Brak zamówień spełniających kryteria wyszukiwania.') }}
{{ translations.no_orders_hint | default('Zmień dzień odbioru lub usuń filtr nazwy klienta.') }}
{% endblock %} {% block scripts %} {% endblock %}