Files
TicketTracker/tickettracker/web/templates/receipt.html

90 lines
2.5 KiB
HTML
Raw Normal View History

{% extends "base.html" %}
{% block title %}{% if data %}Ticket #{{ data.id }}{% else %}Ticket introuvable{% endif %}{% endblock %}
{% block content %}
{% if data is none %}
<article>
<h2>Ticket introuvable</h2>
<p>Le ticket #{{ receipt_id }} n'existe pas dans la base.</p>
<a href="/">← Retour à l'accueil</a>
</article>
{% else %}
<!-- En-tête ticket -->
<hgroup>
<h1>Ticket #{{ data.id }}</h1>
<p>{{ data.store | capitalize }} — {{ data.date }}</p>
</hgroup>
<!-- Champs du ticket -->
<article>
<dl>
<dt>Enseigne</dt>
<dd>{{ data.store }}</dd>
<dt>Date</dt>
<dd>{{ data.date }}</dd>
<dt>Total</dt>
<dd><strong>{{ "%.2f"|format(data.total) }} €</strong></dd>
{% if data.delivery_fee is not none %}
<dt>Frais de livraison</dt>
<dd>{{ "%.2f"|format(data.delivery_fee) }} €</dd>
{% endif %}
{% if data.order_id %}
<dt>Référence commande</dt>
<dd><code>{{ data.order_id }}</code></dd>
{% endif %}
</dl>
</article>
<!-- Articles -->
<article>
<h2>Articles ({{ data['items'] | length }})</h2>
<div class="overflow-auto">
<table>
<thead>
<tr>
<th>Nom brut</th>
<th>Nom normalisé</th>
<th>Catégorie</th>
<th>Qté</th>
<th>Unité</th>
<th>Prix unit.</th>
<th>Total</th>
</tr>
</thead>
<tbody>
{% for item in data['items'] %}
<tr>
<td>{{ item.name_raw }}</td>
<td>
{% if item.name_normalized %}
<a href="/product/{{ item.name_normalized | urlquote }}">
{{ item.name_normalized }}
</a>
{% else %}
<em></em>
{% endif %}
</td>
<td>{{ item.category or "—" }}</td>
<td>{{ item.quantity }}</td>
<td>{{ item.unit }}</td>
<td>{{ "%.2f"|format(item.unit_price) }} €</td>
<td>{{ "%.2f"|format(item.total_price) }} €</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
</article>
<a href="/">← Retour à l'accueil</a>
{% endif %}
{% endblock %}