From 4740b6d19ef6868584f15a1fc8eae1fc0a209721 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20B=C3=B6hmer?= Date: Sun, 8 Feb 2026 22:09:36 +0100 Subject: [PATCH] Show in part info page whether price is inclusive VAT or not --- templates/helper.twig | 10 +++- templates/parts/info/_order_infos.html.twig | 59 +++++++++++---------- translations/messages.en.xlf | 12 +++++ 3 files changed, 52 insertions(+), 29 deletions(-) diff --git a/templates/helper.twig b/templates/helper.twig index 66268a96..9e68d56c 100644 --- a/templates/helper.twig +++ b/templates/helper.twig @@ -192,7 +192,7 @@ {% set preview_attach = part_preview_generator.tablePreviewAttachment(part) %} {% if preview_attach %} Part image + {{ stimulus_controller('elements/hoverpic') }} data-thumbnail="{{ attachment_thumbnail(preview_attach) }}"> {% endif %} {{ part.name }} {% endmacro %} @@ -241,3 +241,11 @@ {{ datetime|format_datetime }} {% endif %} {% endmacro %} + +{% macro vat_text(bool) %} + {% if bool === true %} + ({% trans %}prices.incl_vat{% endtrans %}) + {% elseif bool === false %} + ({% trans %}prices.excl_vat{% endtrans %}) + {% endif %} +{% endmacro %} diff --git a/templates/parts/info/_order_infos.html.twig b/templates/parts/info/_order_infos.html.twig index 68462de5..59b904df 100644 --- a/templates/parts/info/_order_infos.html.twig +++ b/templates/parts/info/_order_infos.html.twig @@ -24,8 +24,8 @@ {% if order.pricedetails is not empty %} - - +
+ @@ -36,32 +36,35 @@ {% endif %} - - - {% for detail in order.pricedetails %} - + + + {% for detail in order.pricedetails %} + {# @var detail App\Entity\PriceInformations\Pricedetail #} + - - - - - {% endfor %} - -
{% trans %}part.order.minamount{% endtrans %} {% trans %}part.order.price{% endtrans %}
- {{ detail.MinDiscountQuantity | format_amount(part.partUnit) }} - - {{ detail.price | format_money(detail.currency) }} / {{ detail.PriceRelatedQuantity | format_amount(part.partUnit) }} - {% set tmp = pricedetail_helper.convertMoneyToCurrency(detail.price, detail.currency) %} - {% if detail.currency != (app.user.currency ?? null) and tmp is not null and tmp.GreaterThan(0) %} - ({{ pricedetail_helper.convertMoneyToCurrency(detail.price, detail.currency, app.user.currency ?? null) | format_money(app.user.currency ?? null) }}) - {% endif %} - - {{ detail.PricePerUnit | format_money(detail.currency) }} - {% set tmp = pricedetail_helper.convertMoneyToCurrency(detail.PricePerUnit, detail.currency) %} - {% if detail.currency != (app.user.currency ?? null) and tmp is not null and tmp.GreaterThan(0) %} - ({{ pricedetail_helper.convertMoneyToCurrency(detail.PricePerUnit, detail.currency, app.user.currency ?? null) | format_money(app.user.currency ?? null) }}) - {% endif %} -
+ + {{ detail.MinDiscountQuantity | format_amount(part.partUnit) }} + + + {{ detail.price | format_money(detail.currency) }} / {{ detail.PriceRelatedQuantity | format_amount(part.partUnit) }} + {% set tmp = pricedetail_helper.convertMoneyToCurrency(detail.price, detail.currency) %} + {% if detail.currency != (app.user.currency ?? null) and tmp is not null and tmp.GreaterThan(0) %} + ({{ pricedetail_helper.convertMoneyToCurrency(detail.price, detail.currency, app.user.currency ?? null) | format_money(app.user.currency ?? null) }}) + {% endif %} + {{- helper.vat_text(detail.includesVAT) -}} + + + {{ detail.PricePerUnit | format_money(detail.currency) }} + {% set tmp = pricedetail_helper.convertMoneyToCurrency(detail.PricePerUnit, detail.currency) %} + {% if detail.currency != (app.user.currency ?? null) and tmp is not null and tmp.GreaterThan(0) %} + ({{ pricedetail_helper.convertMoneyToCurrency(detail.PricePerUnit, detail.currency, app.user.currency ?? null) | format_money(app.user.currency ?? null) }}) + {% endif %} + {{- helper.vat_text(detail.includesVAT) -}} + + + {% endfor %} + + {% endif %} {# Action for order information #} @@ -80,4 +83,4 @@ {% endfor %} - \ No newline at end of file + diff --git a/translations/messages.en.xlf b/translations/messages.en.xlf index 2310286c..a776eb9d 100644 --- a/translations/messages.en.xlf +++ b/translations/messages.en.xlf @@ -12443,5 +12443,17 @@ Buerklin-API Authentication server: Prices include VAT + + + prices.incl_vat + Incl. VAT + + + + + prices.excl_vat + Excl. VAT + +