Revert Bambu Lab cart and price allocation changes
This commit is contained in:
1 parent
8806fc85e5
commit
9f07b07bb7
12 files changed
+7
-1090
No files matched your search
@@ -1,46 +0,0 @@
|
||||
{% extends "base.html" %}
|
||||
{% block title %}Bambu-Lab-Warenkorb · Fil-A-Management{% endblock %}
|
||||
{% block content %}
|
||||
<a class="back-link" href="{% url 'orders' %}">← Zur Sammelbestellung</a>
|
||||
<div class="page-heading">
|
||||
<div><h1>Bambu-Lab-Warenkorb</h1><p class="muted">Lege die aufgeführten Varianten und Mengen im EU-Shop in den Warenkorb.</p></div>
|
||||
<a class="button secondary" href="{{ cart_url }}" target="_blank" rel="noreferrer">Warenkorb im EU-Shop ansehen ↗</a>
|
||||
</div>
|
||||
{% if rows %}
|
||||
<form method="post">
|
||||
{% csrf_token %}
|
||||
{{ form.signature }}
|
||||
{{ form.signature.errors }}
|
||||
{{ form.non_field_errors }}
|
||||
<section class="panel">
|
||||
<div class="panel-heading"><h2>Offene Bambu-Lab-Wünsche</h2></div>
|
||||
<div class="table-wrap">
|
||||
<table>
|
||||
<thead><tr><th scope="col">Stück</th><th scope="col">Filament</th><th scope="col">Artikelnr.</th><th scope="col">Produktseite</th><th scope="col">Betrag für die Position (€)</th></tr></thead>
|
||||
<tbody>
|
||||
{% for line, price in rows %}
|
||||
<tr>
|
||||
<td class="quantity">{{ line.quantity }}</td>
|
||||
<td>{{ line.variant.product_type.name }} · {{ line.variant.color_label }}<small>{{ line.variant.get_spool_type_display }}</small></td>
|
||||
<td>{{ line.variant.manufacturer_color_code|default:"–" }}</td>
|
||||
<td>{% if line.product_url %}<a href="{{ line.product_url }}" target="_blank" rel="noreferrer">{% if line.exact_link %}Variante öffnen ↗{% else %}Produkt öffnen ↗{% endif %}</a>{% else %}<a href="https://eu.store.bambulab.com/collections/bambu-lab-3d-printer-filament" target="_blank" rel="noreferrer">Im Shop suchen ↗</a>{% endif %}{% if not line.exact_link %}<small>Ausführung im Shop prüfen</small>{% endif %}</td>
|
||||
<td><div class="field order-cart-price"><label class="sr-only" for="{{ price.id_for_label }}">{{ price.label }}</label>{{ price }}{{ price.errors }}</div></td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</section>
|
||||
<section class="panel form-panel">
|
||||
<h2>Beträge aus dem gefüllten Warenkorb übernehmen</h2>
|
||||
<p class="hint">Trage oben die Beträge für die angezeigten Stückzahlen ein. Übernimm unten die Warenzwischensumme für diese Filamente nach Rabatt. Versand und andere Artikel bleiben außen vor.</p>
|
||||
<div class="field">
|
||||
{{ form.cart_total.label_tag }}{{ form.cart_total }}{{ form.cart_total.errors }}
|
||||
</div>
|
||||
<button class="button" type="submit">Warenkorbbeträge übernehmen</button>
|
||||
</section>
|
||||
</form>
|
||||
{% else %}
|
||||
<section class="panel"><div class="empty"><p>Es gibt keine offenen Bambu-Lab-Wünsche für den Warenkorb.</p></div></section>
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
@@ -5,26 +5,18 @@
|
||||
<div><h1>Sammelbestellung</h1><p class="muted">Bestellwünsche und Lieferstatus pro Person.</p></div>
|
||||
<a class="button" href="{% url 'order_add' %}">+ Bestellwunsch hinzufügen</a>
|
||||
</div>
|
||||
{% if has_bambu_cart %}
|
||||
<section class="panel form-panel" aria-label="Bambu-Lab-Warenkorb">
|
||||
<a class="button" href="{% url 'bambu_order_cart' %}">Bambu-Lab-Warenkorb vorbereiten</a>
|
||||
<p class="hint">Öffne die passenden Varianten im EU-Shop und übernimm anschließend die rabattierte Warensumme.</p>
|
||||
</section>
|
||||
{% endif %}
|
||||
<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>
|
||||
{% if has_bambu_prices %}<p class="hint">Die Beträge stammen aus den übernommenen Warenkorbpreisen. Der Rollenpreis ist der gerundete Durchschnitt je Position. Versand und Preisänderungen beim Bezahlen können den Endbetrag verändern.</p>{% endif %}
|
||||
{% for group in groups %}
|
||||
{% with username=group.username entries=group.entries %}
|
||||
{% for username, entries in groups %}
|
||||
<section class="panel">
|
||||
<div class="panel-heading"><h2 id="order-person-{{ forloop.counter }}">Bestellwunsch · {{ username }}</h2></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>{% if has_bambu_prices %}<th>Pro Rolle</th><th>Position gesamt</th>{% endif %}<th>Status</th>{% if entries.0.owner_id == user.pk %}<th><span class="sr-only">Aktionen</span></th>{% endif %}</tr>
|
||||
<tr><th>Stück</th><th>Produktart</th><th>Farbe</th><th title="Hersteller-Farbcode">Artikelnr.</th><th>Spulenausführung</th><th>Status</th>{% if entries.0.owner_id == user.pk %}<th><span class="sr-only">Aktionen</span></th>{% endif %}</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for entry in entries %}
|
||||
@@ -34,10 +26,6 @@
|
||||
<td><div class="variant-preview">{% include "filament/variant_thumbnail.html" with variant=entry.variant only %}<strong>{{ entry.variant.color_label }}</strong></div></td>
|
||||
<td class="article-number">{{ entry.variant.manufacturer_color_code|default:"–" }}</td>
|
||||
<td><span class="badge">{{ entry.variant.get_spool_type_display }}</span>{% if not entry.variant.is_active %}<small class="warning">Deaktiviert · Katalogvariante</small>{% endif %}</td>
|
||||
{% if has_bambu_prices %}
|
||||
<td>{% if entry.bambu_unit_price is not None %}{{ entry.bambu_unit_price|floatformat:2 }} €{% else %}–{% endif %}</td>
|
||||
<td>{% if entry.bambu_line_total is not None %}<strong>{{ entry.bambu_line_total|floatformat:2 }} €</strong><small>{{ entry.bambu_quoted_at|date:"d.m.Y H:i" }}</small>{% if entry.bambu_quote_stale %}<small class="warning">Bestellliste geändert</small>{% endif %}{% else %}–{% endif %}</td>
|
||||
{% endif %}
|
||||
<td>
|
||||
<form class="order-status-form" method="post" action="{% url 'order_status' entry.pk %}">
|
||||
{% csrf_token %}
|
||||
@@ -65,23 +53,7 @@
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div class="order-person-total">
|
||||
{% if group.amount is not None %}
|
||||
<div><span>{% if group.missing_prices %}Zwischensumme{% else %}Gesamtbetrag{% endif %}</span> <strong>{{ group.amount|floatformat:2 }} €</strong></div>
|
||||
{% elif group.payable_count %}
|
||||
<strong>Gesamtbetrag offen</strong>
|
||||
{% else %}
|
||||
<span>Keine verfügbaren Positionen</span>
|
||||
{% endif %}
|
||||
{% if group.missing_prices or group.stale_prices %}
|
||||
<div class="muted">
|
||||
{% if group.missing_prices == 1 %}Für 1 Position fehlt der Preis.{% elif group.missing_prices %}Für {{ group.missing_prices }} Positionen fehlen die Preise.{% endif %}
|
||||
{% if group.stale_prices %}Preise vor der letzten Listenänderung.{% endif %}
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
</section>
|
||||
{% endwith %}
|
||||
{% 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 %}
|
||||
|
||||
Reference in new issue
Block a user