Use BigDecimal for Pricedetail price field.

This commit is contained in:
Jan Böhmer 2020-05-20 22:02:07 +02:00
parent db4d7dc5fc
commit b1db89e3b4
8 changed files with 116 additions and 49 deletions

View file

@ -38,18 +38,21 @@
<tbody>
{% for detail in order.pricedetails %}
<tr>
<td>
{{ detail.MinDiscountQuantity | amountFormat(part.partUnit) }}
</td>
<td>
{{ detail.price | moneyFormat(detail.currency) }} / {{ detail.PriceRelatedQuantity | amountFormat(part.partUnit) }}
{% if detail.currency != (app.user.currency ?? null) and pricedetail_helper.convertMoneyToCurrency(detail.price, detail.currency) > 0 %}
{% 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) | moneyFormat(app.user.currency ?? null) }})</span>
{% endif %}
</td>
<td>
{{ detail.PricePerUnit | moneyFormat(detail.currency) }}
{% if detail.currency != (app.user.currency ?? null) and pricedetail_helper.convertMoneyToCurrency(detail.PricePerUnit, detail.currency) > 0 %}
{% 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) | moneyFormat(app.user.currency ?? null) }})</span>
{% endif %}
</td>