adapt formulas to new price system

This commit is contained in:
imperosol
2026-03-06 15:27:22 +01:00
parent 680dc44486
commit 0f1660ad79
11 changed files with 39 additions and 97 deletions

View File

@@ -202,7 +202,7 @@
</div>
<div id="products">
{% if not products %}
{% if not prices %}
<div class="alert alert-red">
{% trans %}No products available on this counter for this user{% endtrans %}
</div>
@@ -242,9 +242,11 @@
{{ super() }}
<script>
const products = {
{%- for price in products -%}
{%- for price in prices -%}
{{ price.id }}: {
productId: {{ price.product_id }},
price: { id: "{{ price.id }}", amount: {{ price.amount }} },
code: "{{ price.product.code }}",
name: "{{ price.full_label }}",
hasTrayPrice: {{ price.product.tray | tojson }},
quantityForTrayPrice: {{ price.product.QUANTITY_FOR_TRAY_PRICE }},

View File

@@ -49,14 +49,10 @@
<strong class="card-title">{{ formula.result.name }}</strong>
<p>
{% for p in formula.products.all() %}
<i>{{ p.code }} ({{ p.selling_price }})</i>
<i>{{ p.name }} ({{ p.code }})</i>
{% if not loop.last %}+{% endif %}
{% endfor %}
</p>
<p>
{{ formula.result.selling_price }}
({% trans %}instead of{% endtrans %} {{ formula.max_selling_price}} €)
</p>
</div>
{% if user.has_perm("counter.delete_productformula") %}
<button

View File

@@ -54,7 +54,12 @@
</div>
<div class="form-group">
<div>
{{ form.is_always_shown.as_field_group() }}
{{ form.is_always_shown.errors }}
<div class="row gap">
{{ form.is_always_shown }}
<label for="{{ form.is_always_shown.id_for_label }}">{{ form.is_always_shown.label }}</label>
</div>
<span class="helptext">{{ form.is_always_shown.help_text }}</span>
</div>
</div>
{%- if form.DELETE -%}