{% 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 is_granted('edit', part) %} {% endif %}

{{ part.description|markdown(true) }}
{{ helper.structural_entity_link(part.category) }}
{{ part.amountSum | amountFormat(part.partUnit) }} / {{ part.minAmount | amountFormat(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 | moneyFormat(app.user.currency ?? null) }} {% if min_order_amount < max_order_amount %} - {{pricedetail_helper.calculateAvgPrice(part, min_order_amount, app.user.currency ?? null ) | moneyFormat(app.user.currency ?? null) }} {% endif %} {% endif %}
{# {% if part.comment != "" %}
{{ part.comment|nl2br }}
{% endif %} #}