Show total cost for minimum order quantity in price-tier view (#1384)

The Price column on a part's Shopping information tab divided by
price_related_quantity (almost always 1 for imported supplier data),
producing redundant "$X / 1" entries that matched the Unit Price
column. Compute the total for min_discount_quantity instead, so each
tier shows what you'd actually pay for the minimum bulk order.
This commit is contained in:
Niklas 2026-07-27 17:54:43 +02:00 committed by GitHub
parent 01d19cd7f7
commit ab296687de
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -46,8 +46,9 @@
{{ 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, app.user.currency ?? null) %}
{% set total = detail.PricePerUnit(detail.MinDiscountQuantity) %}
{{ total | format_money(detail.currency) }} / {{ detail.MinDiscountQuantity | format_amount(part.partUnit) }}
{% set tmp = pricedetail_helper.convertMoneyToCurrency(total, 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">({{ tmp | format_money(app.user.currency ?? null) }})</span>
{% endif %}