Files
Fil-A-Management/templates/filament/orders.html
T

112 lines
7.3 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
{% extends "base.html" %}
{% load static %}
{% block title %}Sammelbestellung · Fil-A-Management{% endblock %}
{% block content %}
<div class="page-heading">
<div><h1>Sammelbestellung</h1><p class="muted">Bestellwünsche und Lieferstatus pro Person.</p></div>
<div class="order-page-actions">
<a class="button secondary" href="{% url 'order_shopping_list' %}">Konsolidierte Bestellliste</a>
<a class="button" href="{% url 'order_add' %}">+ Bestellwunsch hinzufügen</a>
</div>
</div>
<div class="stats">
<section class="stat"><span>Rollen insgesamt</span><strong>{{ total }}</strong></section>
<section class="stat"><span>Verschiedene Varianten</span><strong>{{ variant_count }}</strong></section>
<section class="stat"><span>Personen mit Bestellwünschen</span><strong>{{ groups|length }}</strong></section>
</div>
{% for username, entries, roll_count, snapshot in groups %}
<section class="panel">
<div class="panel-heading order-person-heading">
<h2 id="order-person-{{ forloop.counter }}">Bestellwunsch · {{ username }} · ×{{ roll_count }}</h2>
<form class="order-status-form person-order-status-form" method="post" action="{% url 'person_order_status' entries.0.owner_id %}">
{% csrf_token %}
<input type="hidden" name="snapshot" value="{{ snapshot }}">
<label class="sr-only" for="person-order-status-{{ entries.0.owner_id }}">Status gesammelt ändern für {{ username }}</label>
<select id="person-order-status-{{ entries.0.owner_id }}" name="status" required>
<option value="">Status gesammelt ändern</option>
{% for status in bulk_statuses %}<option value="{{ status }}">{{ status.label }}</option>{% endfor %}
</select>
<button class="button secondary" type="submit">Positionen auswählen</button>
</form>
</div>
<div class="table-wrap">
<table class="order-table" aria-labelledby="order-person-{{ forloop.counter }}">
<thead>
<tr><th>Stück</th><th>Produktart</th><th>Farbe</th><th title="Hersteller-Farbcode">Artikelnr.</th><th>Spulenausführung</th><th>Status</th><th><span class="sr-only">Aktionen</span></th></tr>
</thead>
<tbody>
{% for entry in entries %}
{% with catalog=entry.catalog_details purchase=entry.default_order_variant %}
<tr class="order-row order-row--{{ entry.status }}">
<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">
{% if entry.is_pending %}
{% include "filament/order_article_number.html" with article=purchase.manufacturer_color_code.strip icon_only=True only %}
{% else %}
{% include "filament/order_article_number.html" with article=catalog.article_number.strip icon_only=True only %}
{% endif %}
</td>
<td>
<span class="badge">{% if entry.is_pending %}{{ entry.requested_spool_label }}{% else %}{{ catalog.spool }}{% endif %}</span>
<small>{% if entry.allow_alternative_spool %}Alternative erlaubt{% else %}Verbindlich{% endif %}</small>
{% if entry.is_pending and not purchase %}
<small class="warning">Keine zulässige Ausführung im Katalog</small>
{% elif entry.is_pending and purchase.spool_type != entry.requested_spool_type %}
<small>Verfügbare Alternative: {{ purchase.get_spool_type_display }}</small>
{% elif not entry.is_pending and entry.variant.spool_type != entry.requested_spool_type %}
<small>Gewünscht: {{ entry.requested_spool_label }}</small>
{% endif %}
{% if not entry.variant.is_active and not purchase %}<small class="warning">Deaktiviert · Katalogvariante</small>{% endif %}
</td>
<td>
<form class="order-status-form" method="post" action="{% url 'order_status' entry.pk %}">
{% csrf_token %}
<input type="hidden" name="expected_status" value="{{ entry.status }}">
<input type="hidden" name="expected_quantity" value="{{ entry.quantity }}">
<input type="hidden" name="expected_revision" value="{{ entry.revision }}">
<label class="sr-only" for="order-status-{{ entry.pk }}">Status für {{ username }} · {{ entry.variant }}</label>
<select id="order-status-{{ entry.pk }}" name="status">
{% for value, label in entry.available_status_choices %}
<option value="{{ value }}"{% if value == entry.status %} selected{% endif %}>{% if value == "handed_over" %}Übergeben und einbuchen{% else %}{{ label }}{% endif %}</option>
{% endfor %}
</select>
{% if entry.status == "open" %}
{% include "filament/order_spool_choice.html" with entry=entry only %}
{% endif %}
<button class="button secondary" type="submit">Speichern</button>
</form>
</td>
<td class="actions">
{% if entry.owner_id == user.pk and entry.is_pending %}
<a href="{% url 'order_edit' entry.pk %}">Ändern</a>
{% if not entry.adjustments.all %}
<a class="danger-link" href="{% url 'order_delete' entry.pk %}">Entfernen</a>
{% endif %}
{% endif %}
{% if entry.adjustment_choices %}
<a href="{% url 'order_adjustment' entry.pk %}">{% if entry.is_pending %}Stornieren{% else %}Korrigieren oder stornieren{% endif %}</a>
{% elif entry.adjustments.all %}
<a href="{% url 'order_adjustment' entry.pk %}">Verlauf</a>
{% endif %}
{% if entry.status == "ordered" and entry.quantity > 1 %}
<a href="{% url 'order_arrival' entry.pk %}">Teillieferung erfassen</a>
{% endif %}
</td>
</tr>
{% endwith %}
{% endfor %}
</tbody>
</table>
</div>
</section>
{% empty %}
<section class="panel"><div class="empty"><h2>Keine laufenden Bestellwünsche</h2><p>Neue Wünsche erscheinen hier nach Person sortiert.</p><a class="button" href="{% url 'order_add' %}">Bestellwunsch hinzufügen</a></div></section>
{% endfor %}
{% if groups %}
<p class="sr-only" role="status" data-copy-status></p>
<script src="{% static 'filament/order_article_copy.js' %}" defer></script>
{% endif %}
{% endblock %}