mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2026-03-17 04:38:32 +01:00
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
This commit is contained in:
@@ -47,17 +47,17 @@
|
||||
</td>
|
||||
<td>
|
||||
{{ detail.price | format_money(detail.currency) }} / {{ detail.PriceRelatedQuantity | format_amount(part.partUnit) }}
|
||||
{% set tmp = pricedetail_helper.convertMoneyToCurrency(detail.price, detail.currency) %}
|
||||
{% set tmp = pricedetail_helper.convertMoneyToCurrency(detail.price, detail.currency, app.user.currency ?? null) %}
|
||||
{% 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>
|
||||
<span class="text-muted">({{ tmp | 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) %}
|
||||
{% set tmp = pricedetail_helper.convertMoneyToCurrency(detail.PricePerUnit, detail.currency, app.user.currency ?? null) %}
|
||||
{% 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>
|
||||
<span class="text-muted">({{ tmp | format_money(app.user.currency ?? null) }})</span>
|
||||
{% endif %}
|
||||
<small class="text-muted">{{- helper.vat_text(detail.includesVAT) -}}</small>
|
||||
</td>
|
||||
|
||||
Reference in New Issue
Block a user