1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35
{% extends 'base.html' %} {% from 'macros.html' import icon with context %} {% block title %}Lager{% endblock %} {% block content %} <div class="page-head"><h1>Lager</h1> <div class="actions"><a class="btn" href="/lager/bestellliste">Bestellliste</a>{% if is_leitung %}<a class="btn primary" href="/lager/neu">+ Artikel</a>{% endif %}</div></div> <form class="filters" method="get"> <div class="field" style="flex:1;min-width:220px"><label>Suchen oder Barcode scannen</label> <div class="input-with-btn"><input type="search" name="q" value="{{ search }}" placeholder="Name, Art.-Nr., Barcode, Lieferant" autofocus> <button type="button" class="btn scan-btn" data-scan-go title="Barcode scannen" aria-label="Barcode scannen">{{ icon('camera') }}</button></div></div> <div class="field"><label>Kategorie</label><select name="kat" onchange="this.form.submit()"><option value="">alle</option> {% for c in categories %}<option {{ 'selected' if cat == c }}>{{ c }}</option>{% endfor %}</select></div> <button>Suchen</button> </form> <div class="panel flush table-wrap"> {% if articles %} <table> <thead><tr><th>Artikel</th><th>Kategorie</th><th>Lagerort</th><th class="num">Bestand</th><th class="num">Min.</th><th>Hinweis</th></tr></thead> <tbody> {% for a in articles %} <tr> <td><a href="/lager/{{ a.id }}"><b>{{ a.name }}</b></a><br><small>{{ [a.article_no, a.supplier]|select|join(' · ') }}</small></td> <td>{{ a.category or '–' }}</td> <td>{{ a.location or '–' }}</td> <td class="num"><b class="{{ 'cell-overdue' if a.id in low_ids and a.stock <= 0 else ('cell-soon' if a.id in low_ids) }}">{{ a.stock|num }}</b> {{ a.unit }}</td> <td class="num">{{ a.min_stock|num }}</td> <td>{% if a.id in low_ids %}<span class="badge {{ 'brand' if a.ordered_on else 'warn' }}">{{ 'bestellt' if a.ordered_on else 'nachbestellen' }}</span>{% endif %} {% if a.id in exp_ids %}<span class="badge bad">Verfall</span>{% endif %}</td> </tr> {% endfor %} </tbody> </table> {% else %}<div class="empty">{{ 'Nichts gefunden.' if search else 'Noch keine Artikel angelegt.' }}</div>{% endif %} </div> {% endblock %}