{% extends "base.html" %} {% from "_macros.html" import money %} {% block title %}{{ sess.session_no }} — {{ sess.title }}{% endblock %} {% block breadcrumb %}

Inventur / {{ sess.session_no }}

{% endblock %} {% block heading %}{{ sess.session_no }} · {{ sess.title }}{% endblock %} {% block topbar_actions %} {% set diff_count = lines|selectattr('qty_count','ne', None)|rejectattr('qty_count','equalto', None)|list|length %} {% if sess.status == 'closed' %}Abgeschlossen{% else %}Im Zählen{% endif %} Zähl-Liste drucken {% if sess.status != 'closed' %}
{% endif %} {% endblock %} {% block content %} {% if request.query_params.get('closed') %}

✓ Inventur abgeschlossen

{{ request.query_params.get('adjusted', 0) }} Bestände korrigiert · {{ request.query_params.get('matched', 0) }} übereinstimmend · {{ request.query_params.get('uncounted', 0) }} nicht gezählt

{% endif %} {# Filter-Tabs #}
Alle ({{ lines|length }}) Offen Differenzen
{% if lines %} {% for ln in lines %} {% set diff = (ln.qty_count - ln.qty_book) if ln.qty_count is not none else None %} {% endfor %} {% set total_book = lines|sum(attribute='qty_book') %} {% set total_value = lines|sum(attribute='qty_book') %} {% set v_total = 0 %} {% for ln in lines %}{% set v_total = v_total + (ln.qty_book * (ln.unit_price or 0)) %}{% endfor %}
Artikel-Nr Bezeichnung Typ Lagerort Soll Ist (gezählt) Notiz Differenz
{{ ln.ident_snap }} {{ ln.description_snap or '—' }} {{ ITEM_TYPES.get(ln.item_type, ln.item_type or '—') }} {{ ln.location_snap or '—' }} {{ "%.0f"|format(ln.qty_book) if ln.qty_book == ln.qty_book|int else "%.2f"|format(ln.qty_book) }} {{ ln.unit }} {% if sess.status == 'closed' %} {% if ln.qty_count is not none %}{{ "%.0f"|format(ln.qty_count) if ln.qty_count == ln.qty_count|int else "%.2f"|format(ln.qty_count) }}{% else %}—{% endif %} {% else %}
{% endif %}
{{ ln.note or '' }} {% if diff is not none %} {% if diff > 0 %}+{{ "%.0f"|format(diff) if diff == diff|int else "%.2f"|format(diff) }} {% elif diff < 0 %}{{ "%.0f"|format(diff) if diff == diff|int else "%.2f"|format(diff) }} {% else %}0{% endif %} {% else %}{% endif %} {{ money(ln.qty_book * (ln.unit_price or 0)) }}
Lagerwert (Soll-Bestand) {{ "%.2f"|format(v_total)|replace('.', ',') }} €
{% else %}
Keine Positionen passen zum Filter.
{% endif %}
{% endblock %}