64 lines
4.2 KiB
HTML
64 lines
4.2 KiB
HTML
{% extends "base.html" %}
|
||
{% block title %}Bestellhistorie · Fil-A-Management{% endblock %}
|
||
{% block content %}
|
||
<div class="page-heading">
|
||
<div>
|
||
<h1>Bestellhistorie</h1>
|
||
</div>
|
||
<div class="order-page-actions">
|
||
<a class="button secondary" href="{% url 'order_history' %}"{% if not cancelled %} aria-current="page"{% endif %}>Übergaben</a>
|
||
<a class="button secondary" href="{% url 'order_history' %}?ansicht=storniert"{% if cancelled %} aria-current="page"{% endif %}>Stornierungen</a>
|
||
</div>
|
||
</div>
|
||
<section class="panel">
|
||
{% if page.object_list %}
|
||
<div class="table-wrap">
|
||
<table aria-label="Bestellhistorie">
|
||
<thead>
|
||
<tr><th>Bestellt am</th><th>Für wen</th><th>Stück</th><th>Produktart</th><th>Farbe</th><th>Artikelnr.</th><th>Spulenausführung</th><th>Gesamtpreis</th><th>Status</th><th>{% if cancelled %}Storniert{% else %}Übergeben{% endif %} am</th><th scope="col"><span class="sr-only">Aktionen</span></th></tr>
|
||
</thead>
|
||
<tbody>
|
||
{% for entry in page %}
|
||
{% with catalog=entry.catalog_details %}
|
||
<tr>
|
||
<td class="history-date">{% if entry.ordered_at %}<time datetime="{{ entry.ordered_at|date:'c' }}">{{ entry.ordered_at|date:"d.m.Y" }}<small>{{ entry.ordered_at|date:"H:i" }} Uhr</small></time>{% else %}<span class="muted">Nicht erfasst</span>{% endif %}</td>
|
||
<td>{{ entry.owner.username }}</td>
|
||
<td class="quantity">{{ entry.quantity }}</td>
|
||
<td>{{ catalog.product }}<small>{{ catalog.manufacturer }}</small></td>
|
||
<td><div class="variant-preview">{% include "filament/variant_thumbnail.html" with variant=catalog only %}<strong>{{ catalog.color }}</strong></div></td>
|
||
<td class="article-number">{{ catalog.article_number|default:"–" }}</td>
|
||
<td><span class="badge">{{ catalog.spool }}</span></td>
|
||
<td class="order-amount-total">{% if entry.total_cost is not None %}{{ entry.total_cost|floatformat:2 }} €{% else %}–{% endif %}</td>
|
||
<td><span class="badge">{{ entry.get_status_display }}</span></td>
|
||
<td class="history-date">
|
||
{% if entry.cancelled_at %}<time datetime="{{ entry.cancelled_at|date:'c' }}">{{ entry.cancelled_at|date:"d.m.Y" }}<small>{{ entry.cancelled_at|date:"H:i" }} Uhr</small></time>
|
||
{% elif entry.handed_over_at %}<time datetime="{{ entry.handed_over_at|date:'c' }}">{{ entry.handed_over_at|date:"d.m.Y" }}<small>{{ entry.handed_over_at|date:"H:i" }} Uhr</small></time>
|
||
{% else %}<span class="muted">Nicht erfasst</span>{% endif %}
|
||
</td>
|
||
<td class="actions">
|
||
{% if entry.handover_previous_status %}
|
||
{% if entry.owner_id == user.pk or perms.filament.change_orderitem %}
|
||
<a href="{% url 'order_handover_undo' entry.pk %}">Übergabe rückgängig machen</a>
|
||
{% endif %}
|
||
{% endif %}
|
||
{% if entry.adjustments.all %}<a href="{% url 'order_adjustment' entry.pk %}">Verlauf</a>{% endif %}
|
||
</td>
|
||
</tr>
|
||
{% endwith %}
|
||
{% endfor %}
|
||
</tbody>
|
||
</table>
|
||
</div>
|
||
{% if page.has_other_pages %}
|
||
<div class="panel-heading history-pagination">
|
||
{% if page.has_previous %}<a href="?{% if cancelled %}ansicht=storniert&{% endif %}page={{ page.previous_page_number }}">← Zurück</a>{% endif %}
|
||
<span>Seite {{ page.number }} von {{ page.paginator.num_pages }}</span>
|
||
{% if page.has_next %}<a href="?{% if cancelled %}ansicht=storniert&{% endif %}page={{ page.next_page_number }}">Weiter →</a>{% endif %}
|
||
</div>
|
||
{% endif %}
|
||
{% else %}
|
||
<div class="empty"><h2>{% if cancelled %}Noch keine Stornierungen{% else %}Noch keine Übergaben{% endif %}</h2><a class="button secondary" href="{% url 'orders' %}">Zur Sammelbestellung</a></div>
|
||
{% endif %}
|
||
</section>
|
||
{% endblock %}
|