mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2026-03-17 04:39:38 +00: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:
parent
44bb132de1
commit
a070ebb2ce
1 changed files with 4 additions and 4 deletions
|
|
@ -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>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue