Show in part info page whether price is inclusive VAT or not
Some checks failed
Build assets artifact / Build assets artifact (push) Has been cancelled
Docker Image Build / docker (push) Has been cancelled
Docker Image Build (FrankenPHP) / docker (push) Has been cancelled
Static analysis / Static analysis (push) Has been cancelled
PHPUnit Tests / PHPUnit and coverage Test (PHP 8.2, mysql) (push) Has been cancelled
PHPUnit Tests / PHPUnit and coverage Test (PHP 8.3, mysql) (push) Has been cancelled
PHPUnit Tests / PHPUnit and coverage Test (PHP 8.4, mysql) (push) Has been cancelled
PHPUnit Tests / PHPUnit and coverage Test (PHP 8.5, mysql) (push) Has been cancelled
PHPUnit Tests / PHPUnit and coverage Test (PHP 8.2, postgres) (push) Has been cancelled
PHPUnit Tests / PHPUnit and coverage Test (PHP 8.3, postgres) (push) Has been cancelled
PHPUnit Tests / PHPUnit and coverage Test (PHP 8.4, postgres) (push) Has been cancelled
PHPUnit Tests / PHPUnit and coverage Test (PHP 8.5, postgres) (push) Has been cancelled
PHPUnit Tests / PHPUnit and coverage Test (PHP 8.2, sqlite) (push) Has been cancelled
PHPUnit Tests / PHPUnit and coverage Test (PHP 8.3, sqlite) (push) Has been cancelled
PHPUnit Tests / PHPUnit and coverage Test (PHP 8.4, sqlite) (push) Has been cancelled
PHPUnit Tests / PHPUnit and coverage Test (PHP 8.5, sqlite) (push) Has been cancelled

This commit is contained in:
Jan Böhmer 2026-02-08 22:09:36 +01:00
parent 5a47b15c97
commit 4740b6d19e
3 changed files with 52 additions and 29 deletions

View file

@ -192,7 +192,7 @@
{% set preview_attach = part_preview_generator.tablePreviewAttachment(part) %}
{% if preview_attach %}
<img src="{{ attachment_thumbnail(preview_attach, 'thumbnail_xs') }}" class="entity-image-xs" alt="Part image"
{{ stimulus_controller('elements/hoverpic') }} data-thumbnail="{{ attachment_thumbnail(preview_attach) }}">
{{ stimulus_controller('elements/hoverpic') }} data-thumbnail="{{ attachment_thumbnail(preview_attach) }}">
{% endif %}
<a href="{{ entity_url(part) }}">{{ part.name }}</a>
{% 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 %}

View file

@ -24,8 +24,8 @@
</td>
<td>
{% if order.pricedetails is not empty %}
<table class="table table-bordered table-sm table-striped table-hover">
<thead class="thead-dark">
<table class="table table-bordered table-sm table-striped table-hover">
<thead class="thead-dark">
<tr>
<th>{% trans %}part.order.minamount{% endtrans %}</th>
<th>{% trans %}part.order.price{% endtrans %}</th>
@ -36,32 +36,35 @@
{% endif %}
</th>
</tr>
</thead>
<tbody>
{% for detail in order.pricedetails %}
<tr>
</thead>
<tbody>
{% for detail in order.pricedetails %}
{# @var detail App\Entity\PriceInformations\Pricedetail #}
<tr>
<td>
{{ detail.MinDiscountQuantity | format_amount(part.partUnit) }}
</td>
<td>
{{ 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) %}
<span class="text-muted">({{ pricedetail_helper.convertMoneyToCurrency(detail.price, detail.currency, app.user.currency ?? null) | format_money(app.user.currency ?? null) }})</span>
{% endif %}
</td>
<td>
{{ 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) %}
<span class="text-muted">({{ pricedetail_helper.convertMoneyToCurrency(detail.PricePerUnit, detail.currency, app.user.currency ?? null) | format_money(app.user.currency ?? null) }})</span>
{% endif %}
</td>
</tr>
{% endfor %}
</tbody>
</table>
<td>
{{ detail.MinDiscountQuantity | format_amount(part.partUnit) }}
</td>
<td>
{{ 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) %}
<span class="text-muted">({{ pricedetail_helper.convertMoneyToCurrency(detail.price, detail.currency, app.user.currency ?? null) | format_money(app.user.currency ?? null) }})</span>
{% endif %}
<small class="text-muted">{{- helper.vat_text(detail.includesVAT) -}}</small>
</td>
<td>
{{ 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) %}
<span class="text-muted">({{ pricedetail_helper.convertMoneyToCurrency(detail.PricePerUnit, detail.currency, app.user.currency ?? null) | format_money(app.user.currency ?? null) }})</span>
{% endif %}
<small class="text-muted">{{- helper.vat_text(detail.includesVAT) -}}</small>
</td>
</tr>
{% endfor %}
</tbody>
</table>
{% endif %}
</td>
<td> {# Action for order information #}
@ -80,4 +83,4 @@
{% endfor %}
</tbody>
</table>
</div>
</div>

View file

@ -12443,5 +12443,17 @@ Buerklin-API Authentication server:
<target>Prices include VAT</target>
</segment>
</unit>
<unit id="GUsVh5T" name="prices.incl_vat">
<segment>
<source>prices.incl_vat</source>
<target>Incl. VAT</target>
</segment>
</unit>
<unit id="3ipwaVQ" name="prices.excl_vat">
<segment>
<source>prices.excl_vat</source>
<target>Excl. VAT</target>
</segment>
</unit>
</file>
</xliff>