Skip to content

Commit a070ebb

Browse files
committed
Fixed 500 error with displaying part prices, when a user has a currency preference different of base currency, and there is no conversion rate known for it
This fixes issue #1317
1 parent 44bb132 commit a070ebb

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

templates/parts/info/_order_infos.html.twig

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,17 +47,17 @@
4747
</td>
4848
<td>
4949
{{ detail.price | format_money(detail.currency) }} / {{ detail.PriceRelatedQuantity | format_amount(part.partUnit) }}
50-
{% set tmp = pricedetail_helper.convertMoneyToCurrency(detail.price, detail.currency) %}
50+
{% set tmp = pricedetail_helper.convertMoneyToCurrency(detail.price, detail.currency, app.user.currency ?? null) %}
5151
{% if detail.currency != (app.user.currency ?? null) and tmp is not null and tmp.GreaterThan(0) %}
52-
<span class="text-muted">({{ pricedetail_helper.convertMoneyToCurrency(detail.price, detail.currency, app.user.currency ?? null) | format_money(app.user.currency ?? null) }})</span>
52+
<span class="text-muted">({{ tmp | format_money(app.user.currency ?? null) }})</span>
5353
{% endif %}
5454
<small class="text-muted">{{- helper.vat_text(detail.includesVAT) -}}</small>
5555
</td>
5656
<td>
5757
{{ detail.PricePerUnit | format_money(detail.currency) }}
58-
{% set tmp = pricedetail_helper.convertMoneyToCurrency(detail.PricePerUnit, detail.currency) %}
58+
{% set tmp = pricedetail_helper.convertMoneyToCurrency(detail.PricePerUnit, detail.currency, app.user.currency ?? null) %}
5959
{% if detail.currency != (app.user.currency ?? null) and tmp is not null and tmp.GreaterThan(0) %}
60-
<span class="text-muted">({{ pricedetail_helper.convertMoneyToCurrency(detail.PricePerUnit, detail.currency, app.user.currency ?? null) | format_money(app.user.currency ?? null) }})</span>
60+
<span class="text-muted">({{ tmp | format_money(app.user.currency ?? null) }})</span>
6161
{% endif %}
6262
<small class="text-muted">{{- helper.vat_text(detail.includesVAT) -}}</small>
6363
</td>

0 commit comments

Comments
 (0)