{% import "helper.twig" as helper %}
{% include "Parts/info/_picture.html.twig" %}
{% if part.manufacturer %} {% if part.manufacturer.id is not null %} {{ part.manufacturer.name}} {% else %} {{ part.manufacturer.name }} {% endif %} {% endif %} {% if part.manufacturerProductUrl %} {{ part.manufacturerProductNumber }} {% else %} {{ part.manufacturerProductNumber }} {% endif %}

{{ part.name }} {# You need edit permission to use the edit button #} {% if timeTravel is not null %} {% elseif is_granted('edit', part) %} {% endif %}

{{ part.description|format_markdown(true) }}
{{ helper.structural_entity_link(part.category) }}
{{ part.amountSum | format_amount(part.partUnit) }} / {{ part.minAmount | format_amount(part.partUnit) }}
{{ helper.structural_entity_link(part.footprint) }}
{% set min_order_amount = pricedetail_helper.minOrderAmount(part) %} {% set max_order_amount = pricedetail_helper.maxDiscountAmount(part) %} {% set max_order_price = pricedetail_helper.calculateAvgPrice(part, max_order_amount, app.user.currency ?? null) %} {% if max_order_price is not null %}
{{ max_order_price | format_money(app.user.currency ?? null) }} {% if min_order_amount < max_order_amount %} - {{pricedetail_helper.calculateAvgPrice(part, min_order_amount, app.user.currency ?? null ) | format_money(app.user.currency ?? null) }} {% endif %}
{% endif %} {# {% if part.comment != "" %}
{{ part.comment|nl2br }}
{% endif %} #}