Track reusable Bambu Lab spools in personal inventory

This commit is contained in:
Mikei386 committed 2026-11-14 17:57:24 +01:00
1 parent 0287643b97
commit 47efe317bf
17 files changed
+560 -32

No files matched your search

+1
View File
@@ -1,4 +1,5 @@
<p>Aktueller Bestand: <strong data-consume-count>{{ item.quantity }}</strong>. Eine Rolle wird abgezogen.</p>
<p data-return-spool-note{% if not item.bambu_spool %} hidden{% endif %}>Eine Bambu-Lab-Leerrolle wird zurückgebucht.</p>
<form method="post" data-consume-form>
{% csrf_token %}
<input type="hidden" name="quantity" value="{{ item.quantity|default:'' }}">
+19
View File
@@ -0,0 +1,19 @@
{% extends "base.html" %}
{% block title %}Leerrollen · Fil-A-Management{% endblock %}
{% block content %}
<div class="page-heading">
<div><h1>Mein Bestand</h1></div>
</div>
{% include "filament/inventory_tabs.html" with active="spools" empty_count=quantity only %}
<section class="panel form-panel">
<h2>Bambu-Lab-Leerrollen</h2>
<p class="muted">Trag deine vorhandenen Leerrollen ein. Beim Aufziehen und Verbrauchen passt sich die Stückzahl automatisch an.</p>
<form method="post" class="empty-spool-form">
{% csrf_token %}{{ form.non_field_errors }}{{ form.expected_quantity }}{{ form.expected_quantity.errors }}
<div class="field">
{{ form.quantity.label_tag }}{{ form.quantity }}{{ form.quantity.errors }}
</div>
<button class="button" type="submit">Bestand speichern</button>
</form>
</section>
{% endblock %}
+2 -1
View File
@@ -12,7 +12,8 @@
<section class="panel form-panel">
<form method="post">
{% csrf_token %}{{ form.non_field_errors }}
{% for field in form %}
{% for field in form.hidden_fields %}{{ field }}{{ field.errors }}{% endfor %}
{% for field in form.visible_fields %}
<div class="field">
{{ field.label_tag }}{{ field }}{{ field.errors }}
{% if field.help_text %}<div class="helptext" id="{{ field.auto_id }}_helptext">{{ field.help_text }}</div>{% endif %}
+2 -1
View File
@@ -1,5 +1,6 @@
{% extends "base.html" %}{% block title %}Mein Bestand · Fil-A-Management{% endblock %}
{% block content %}<div class="page-heading"><div><p class="eyebrow">DEINE WERKSTATT</p><h1>Mein Filamentbestand</h1><p class="muted">Alles, was für dein nächstes Projekt bereitliegt.</p></div><a class="button" href="{% url 'inventory_add' %}">+ Filament hinzufügen</a></div>
{% block content %}<div class="page-heading"><div><h1>Mein Bestand</h1></div><a class="button" href="{% url 'inventory_add' %}">+ Filament hinzufügen</a></div>
{% include "filament/inventory_tabs.html" with active="filament" empty_count=empty_count only %}
<div class="stats">
<section class="stat">
<span>Rollen im Bestand</span><strong>{{ total }}</strong><small>dein persönlicher Vorrat</small>
+4
View File
@@ -0,0 +1,4 @@
<nav class="inventory-tabs" aria-label="Bestandsbereiche">
<a href="{% url 'inventory' %}"{% if active == "filament" %} aria-current="page"{% endif %}>Filamente</a>
<a href="{% url 'empty_spools' %}"{% if active == "spools" %} aria-current="page"{% endif %}>Leerrollen <span class="badge">{{ empty_count }}</span></a>
</nav>
+21
View File
@@ -0,0 +1,21 @@
{% extends "base.html" %}
{% block title %}Auf Leerrolle aufziehen · Fil-A-Management{% endblock %}
{% block content %}
<a class="back-link" href="{% url 'inventory' %}">← Zurück zum Bestand</a>
<div class="page-heading">
<div><h1>Auf Leerrolle aufziehen</h1><p class="muted">{{ item.stock_description }}</p></div>
</div>
<section class="panel form-panel">
<p>Eine Bambu-Lab-Leerrolle wird abgebucht. Das Filament erscheint anschließend im Bestand <strong>Mit Spule</strong>.</p>
<p>Verfügbare Leerrollen <strong>{{ empty_count }}</strong></p>
<form method="post" class="form-actions">
{% csrf_token %}{{ form.quantity }}{{ form.quantity.errors }}{{ form.non_field_errors }}
{% if empty_count %}
<button class="button" type="submit">Eine Rolle aufziehen</button>
{% else %}
<a class="button" href="{% url 'empty_spools' %}">Leerrollen erfassen</a>
{% endif %}
<a class="button secondary" href="{% url 'inventory' %}">Abbrechen</a>
</form>
</section>
{% endblock %}
+4 -3
View File
@@ -24,14 +24,15 @@
<td rowspan="{{ group|length }}">{{ item.variant.product_type.name }}</td>
<th class="stock-color" scope="rowgroup" rowspan="{{ group|length }}"><div class="variant-preview">{% include "filament/variant_thumbnail.html" with variant=item.variant only %}<strong>{{ item.variant.color }}</strong></div></th>
{% endif %}
<td><span class="badge">{{ item.get_spool_type_display }}</span>{% if not item.variant.is_active %}<small class="warning">Deaktiviert</small>{% endif %}</td>
<td><span class="badge">{{ item.get_spool_type_display }}</span>{% if editable and item.bambu_spool %}<small class="stock-spool-brand">Bambu Lab</small>{% endif %}{% if not item.variant.is_active %}<small class="warning">Deaktiviert</small>{% endif %}</td>
<td class="article-number">{{ item.variant.manufacturer_color_code|default:"–" }}</td>
<td class="quantity">{{ item.quantity }}</td>
{% if editable %}
<td class="actions">
<a class="button secondary consume-button" href="{% url 'inventory_consume' item.pk %}"
data-consume data-variant="{{ item.stock_description }}" data-quantity="{{ item.quantity }}" data-reorder-note="{{ item.reorder_spool_note }}"{% if not item.variant.is_active %} data-inactive{% endif %}>Spule verbraucht</a>
<a href="{% url 'inventory_edit' item.pk %}">Stückzahl ändern</a>
data-consume data-variant="{{ item.stock_description }}" data-quantity="{{ item.quantity }}" data-reorder-note="{{ item.reorder_spool_note }}"{% if item.bambu_spool %} data-return-spool{% endif %}{% if not item.variant.is_active %} data-inactive{% endif %}>Spule verbraucht</a>
{% if item.spool_type == "refill" %}<a href="{% url 'inventory_mount' item.pk %}">Auf Leerrolle aufziehen</a>{% endif %}
<a href="{% url 'inventory_edit' item.pk %}">Bearbeiten</a>
</td>
{% endif %}
</tr>