mirror of
https://github.com/almet/copanier.git
synced 2025-04-28 19:42:37 +02:00
107 lines
4.7 KiB
HTML
107 lines
4.7 KiB
HTML
{% extends "base.html" %}
|
||
|
||
{% block body %}
|
||
<h3>{{ delivery.producer }} {% include "includes/order_button.html" %}</h3>
|
||
{% include "includes/delivery_head.html" %}
|
||
<article class="delivery">
|
||
<table class="delivery">
|
||
<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">Total</th>
|
||
{% for email, order in delivery.orders.items() %}
|
||
<th class="person{% if delivery.is_passed and not order.paid %} not-paid{% endif %}">
|
||
{% if request.user and request.user.is_staff %}
|
||
<a href="/livraison/{{ delivery.id }}/commander?email={{ email }}" title="{{ email }}">{{ email }}</a>
|
||
{% else %}
|
||
<span title="{{ email }}">{{ email }}</span>
|
||
{% endif %}
|
||
</th>
|
||
{% endfor %}
|
||
</tr>
|
||
</thead>
|
||
<tbody>
|
||
{% for product in delivery.products %}
|
||
<tr>
|
||
<th class="product">{{ product }}</th>
|
||
<td>{{ product.price | round(2) }} €</td>
|
||
{% if delivery.has_packing %}
|
||
<td class="packing">{{ product.packing or '—'}}</td>
|
||
{% endif %}
|
||
<th{% if delivery.status == delivery.ADJUSTMENT and delivery.product_missing(product) %} class="missing" title="Les commandes individuelles ne correspondent pas aux conditionnements"{% endif %}>
|
||
{{ delivery.product_wanted(product) }}
|
||
{% if delivery.status == delivery.ADJUSTMENT and delivery.product_missing(product) %} (−{{ delivery.product_missing(product) }})
|
||
{% if request.user.is_staff %}<a href="/livraison/{{ delivery.id }}/ajuster/{{ product.ref }}" class="button" title="ajuster le produit">ajuster</a>{% endif %}
|
||
{% endif %}
|
||
</th>
|
||
{% for email, order in delivery.orders.items() %}
|
||
<td title="Commandé: {{ order[product.ref].wanted }} — Ajusté: {{ "%+d"|format(order[product.ref].adjustment) }}">{{ order[product.ref].quantity or "—" }}</td>
|
||
{% endfor %}
|
||
</tr>
|
||
{% endfor %}
|
||
<tr>
|
||
<th class="total"><i class="icon-pricetags"></i> Total</th><td>—</td>
|
||
{% if delivery.has_packing %}
|
||
<td>—</td>
|
||
{% endif %}
|
||
<th class="total">{{ delivery.total }} €</th>
|
||
{% for email, order in delivery.orders.items() %}
|
||
<td>{{ order.total(delivery.products) }} €</td>
|
||
{% endfor %}
|
||
</tr>
|
||
</tbody>
|
||
</table>
|
||
</article>
|
||
<hr>
|
||
<ul class="toolbox">
|
||
{% if not delivery.is_archived %}
|
||
<li>
|
||
<a href="/livraison/{{ delivery.id }}/bon-de-commande.xlsx"><i class="icon-ribbon"></i> Bon de commande</a>
|
||
</li>
|
||
<li>
|
||
<a href="/livraison/{{ delivery.id }}/rapport-complet.xlsx"><i class="icon-grid"></i> Rapport complet</a>
|
||
</li>
|
||
<li>
|
||
<a href="/livraison/{{ delivery.id }}/émargement" target="_blank"><i class="icon-document"></i> Liste d'émargement</a>
|
||
</li>
|
||
{% if request.user and request.user.is_staff %}
|
||
<li>
|
||
<a href="/livraison/{{ delivery.id }}/exporter/produits"><i class="icon-layers"></i> Télécharger les produits</a>
|
||
</li>
|
||
<li>
|
||
<a href="/livraison/{{ delivery.id }}/edit"><i class="icon-adjustments"></i> Modifier la livraison</a>
|
||
</li>
|
||
<li>
|
||
{% with unique_id="import-command" %}
|
||
{% include "includes/modal_import_command.html" %}
|
||
{% endwith %}
|
||
</li>
|
||
<li>
|
||
{% with unique_id="add-command" %}
|
||
{% include "includes/modal_add_command.html" %}
|
||
{% endwith %}
|
||
</li>
|
||
<li>
|
||
{% with unique_id="copy-emails" %}
|
||
{% include "includes/modal_copy_emails.html" %}
|
||
{% endwith %}
|
||
</li>
|
||
{% if delivery.is_passed %}
|
||
<li>
|
||
<a href="/livraison/{{ delivery.id }}/solde"><i class="icon-wallet"></i> Gérer les soldes</a>
|
||
</li>
|
||
{% endif %}
|
||
{% endif %}
|
||
{% else %}
|
||
{% if request.user and request.user.is_staff %}
|
||
<li>
|
||
<a href="/livraison/{{ delivery.id }}/désarchiver" class="button danger"><i class="icon-hazardous"></i> Désarchiver</a>
|
||
</li>
|
||
{% endif %}
|
||
{% endif %}
|
||
</ul>
|
||
{% endblock body %}
|