mirror of
https://github.com/ae-utbm/sith.git
synced 2026-03-14 07:35:00 +00:00
adapt formulas to new price system
This commit is contained in:
@@ -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 }},
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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 -%}
|
||||
|
||||
Reference in New Issue
Block a user