{% extends 'layouts/base.twig' %} {% block title %}{{ translations.material_complaint }}{% endblock %} {% block page_heading %}

{{ translations.material_complaint }}

{% if errors is not empty %}
{% endif %} {% endblock %} {% block content %}
{# Filtry jako badge #}
{{ translations.status }}: {{ translations.all }} {{ translations.status_new }} {{ translations.status_in_review }} {{ translations.status_accepted }} {{ translations.status_rejected }}
{{ translations.supplier }}: {{ translations.all }} {% set seenSuppliers = [] %} {% for complaint in complaints %} {% if complaint.getSupplierName() not in seenSuppliers %} {% set seenSuppliers = seenSuppliers|merge([complaint.getSupplierName()]) %} {{ complaint.getSupplierName() }} {% endif %} {% endfor %}
{# Tabela reklamacji #}

{{ translations.overview }}

{% for complaint in complaints %} {% else %} {% endfor %} {% if complaints is not empty %} {% endif %}
{{ translations.complaint_key }}
{{ translations.date_of_report }}
{{ translations.supplier }}
{{ translations.product_name }}
{{ translations.order_key }}
{{ translations.complaint_reason }}
{{ translations.complained_quantity }} {{ translations.status }}
{{ translations.last_update }}
{{ translations.actions }}
{% if complaint.getComplaintKey() %} {{ complaint.getComplaintKey() }} {% else %} {% endif %}
{{ complaint.getCreatedAt()|slice(0,16)|replace({'T': ' '}) }}
{{ complaint.getSupplierName() }} {{ complaint.getMaterialName() }} {% if complaint.getSupplierSku() %} SKU: {{ complaint.getSupplierSku() }} {% endif %} {{ complaint.getOrderKey() }} {{ complaint.getReasonName() }} {% if complaint.getQty() is not null %} {% set unitLower = complaint.getUnitName()|lower %} {% if unitLower in ['pcs', 'g', 'ml'] %}{{ complaint.getQty()|round(0, 'common') }}{% else %}{{ complaint.getQty() }}{% endif %} {% if complaint.getUnitName() %}
{{ complaint.getUnitName() }}
{% endif %} {% else %} {% endif %}
{% set status = complaint.getStatus() %} {% if status == 'NEW' %} {{ translations.status_new }} {% elseif status == 'IN_REVIEW' %} {{ translations.status_in_review }} {% elseif status == 'ACCEPTED' %} {{ translations.status_accepted }} {% elseif status == 'REJECTED' %} {{ translations.status_rejected }} {% else %} {{ status }} {% endif %}
{% if complaint.getUpdatedAt() and complaint.getUpdatedAt() != complaint.getCreatedAt() %} {{ complaint.getUpdatedAt()|slice(0,16)|replace({'T': ' '}) }} {% else %} {% endif %}
{% set attachCount = complaint.getAttachments()|length %} {% if attachCount > 0 %} {{ attachCount }} {% endif %}
{{ translations.no_complaints_found }}
{# Modal szczegółów reklamacji #} {% endblock %} {% block scripts %} {% endblock %}