mirror of
https://github.com/almet/copanier.git
synced 2025-05-03 13:31:48 +02:00
58 lines
3.2 KiB
HTML
58 lines
3.2 KiB
HTML
{% extends "base.html" %}
|
||
|
||
{% block body %}
|
||
<article class="order">
|
||
<h3><a href="/livraison/{{ delivery.id }}">{{ delivery.name }}</a> — Commande pour « {{ person.name }} »</h3>
|
||
{% include "includes/delivery_head.html" %}
|
||
<form method="post">
|
||
|
||
{% for producer in delivery.producers %}
|
||
<h2>{{ producer }}</h2>
|
||
<table class="order">
|
||
<thead>
|
||
<tr>
|
||
<th class="product">Produit</th>
|
||
<th class="price">Prix</th>
|
||
{% if delivery.has_packing %}
|
||
<th class="packing">Conditionnement</th>
|
||
{% endif %}
|
||
<th class="amount">Commande</th>
|
||
{% if delivery.status == delivery.ADJUSTMENT or force_adjustment %}
|
||
<th class="amount">Ajustement +/−</th>
|
||
{% endif %}
|
||
</tr>
|
||
</thead>
|
||
<tbody>
|
||
{% for product in delivery.get_products_by(producer) %}
|
||
<tr>
|
||
<th class="product {% if product.rupture %}rupture{% endif %}">{{ product }} {% if product.rupture %}(RUPTURE !){% endif %}
|
||
{% if product.description or product.img %}
|
||
{% with unique_id=loop.index %}
|
||
{% include "includes/modal_product.html" %}
|
||
{% endwith %}
|
||
{% endif %}
|
||
</th>
|
||
<td>{{ product.price | round(2) }} €</td>
|
||
{% if delivery.has_packing %}
|
||
<td {% if delivery.status == delivery.ADJUSTMENT and delivery.product_missing(product) %} class="missing" title="Les commandes individuelles ne correspondent pas aux conditionnements"{% endif %}>{{ product.packing or "—" }}{% if delivery.status == delivery.ADJUSTMENT and delivery.product_missing(product) %} (manque {{ delivery.product_missing(product) }}){% endif %}</td>
|
||
{% endif %}
|
||
<td class="with-input"><input {% if not request.user.is_referent(delivery) and delivery.status != delivery.OPEN or product.rupture %}type="text" readonly{% else%}type="number"{% endif%} min=0 name="wanted:{{ product.ref }}" value="{{ order[product].wanted }}">{% if not (delivery.status == delivery.ADJUSTMENT or force_adjustments) %} x {{ product.unit }}{% endif %}</td>
|
||
{% if delivery.status == delivery.ADJUSTMENT or force_adjustments %}
|
||
<td class="with-input"><input type="number" name="adjustment:{{ product.ref }}" value="{{ order[product].adjustment }}" min="{{ order[product].wanted * -1 }}" {% if not (delivery.product_missing(product) or force_adjustment) %}readonly{% endif %}> x {{ product.unit }}</td>
|
||
{% endif %}
|
||
</tr>
|
||
{% endfor %}
|
||
</tbody>
|
||
</table>
|
||
{% endfor %}
|
||
<p>Total: {{ order.total(delivery.products) if order else 0 }} €</p>
|
||
<input type="hidden" name="email" value="{{ person.email }}">
|
||
{% if delivery.status != delivery.CLOSED or request.user.is_staff %}
|
||
<input type="submit" value="Enregistrer la commande" class="primary">
|
||
{% endif %}
|
||
{% if request.user.is_staff and delivery.status == delivery.CLOSED %}
|
||
<a class="button danger" href="/livraison/{{ delivery.id }}/commander?email={{ person.email }}&adjust">Ajuster</a>
|
||
{% endif %}
|
||
</form>
|
||
</article>
|
||
{% endblock body %}
|