{% extends "base.html" %} {% from "_macros.html" import money %} {% block title %}{{ po.po_no }}{% endblock %} {% block breadcrumb %}

Bestellungen / {{ po.po_no }}

{% endblock %} {% block heading %}{{ po.po_no }} · {{ po.vendor_name or '—' }}{% endblock %} {% block content %}

Bestellung

{{ po.order_date or '—' }}{% if po.expected_date %} · Eingang erwartet: {{ po.expected_date }}{% endif %}

{% set status_color = {'draft':'neutral','sent':'blue','partial':'amber','received':'emerald','cancelled':'red'} %} {% set status_label = {'draft':'Entwurf','sent':'Versendet','partial':'Teilweise','received':'Erhalten','cancelled':'Storniert'} %} {{ status_label.get(po.status, po.status) }} {% if po.approval_status == 'pending' %} ⚠ Genehmigung erforderlich {% elif po.approval_status == 'approved' %} ✓ Genehmigt {% elif po.approval_status == 'rejected' %} ✗ Abgelehnt {% endif %} {% if po.confirmed_at %} ✓ Bestätigt {% elif po.status in ('sent','partial') %} Bestätigung offen {% endif %} PDF {% if po.status == 'draft' and po.approval_status != 'pending' %} {% endif %}
{% for ln in lines %} {% else %} {% endfor %} {% if lines %} {% endif %}
# Beschreibung Bestellt Erhalten Einh. Einzelpr. Summe
{{ loop.index }}
{{ ln.description }}
{% if ln.material_name %}
{{ ln.material_name }}
{% endif %}
{{ '%.2f'|format(ln.qty_ordered) }} {% set pct = (ln.qty_received / ln.qty_ordered * 100) if ln.qty_ordered else 0 %} {% if ln.qty_received >= ln.qty_ordered %} {{ '%.2f'|format(ln.qty_received) }} ✓ {% elif ln.qty_received > 0 %} {{ '%.2f'|format(ln.qty_received) }} ({{ '%.0f'|format(pct) }}%) {% else %} 0 {% endif %} {{ ln.unit }} {{ '%.2f'|format(ln.unit_price) }} € {{ '%.2f'|format(ln.line_total) }} €
Noch keine Positionen
Summe netto: {{ money(po.total_net) }} {{ po.currency }}
{# Add line form #}

Position hinzufügen

{# v1.8.2 #3 — Genehmigungs-Workflow #} {% if po.approval_required %}

Genehmigung

{% if po.approval_status == 'pending' %} Diese Bestellung übersteigt die Genehmigungs-Schwelle und braucht GF-Freigabe vor Versand. {% elif po.approval_status == 'approved' %} Genehmigt am {{ po.approved_at[:16] if po.approved_at else '' }} {% elif po.approval_status == 'rejected' %} Abgelehnt am {{ po.approved_at[:16] if po.approved_at else '' }} {% endif %}

{% if po.approval_status == 'pending' %}
{% elif po.approval_note %}

Notiz: {{ po.approval_note }}

{% endif %}
{% endif %} {# Auftragsbestätigung des Lieferanten #} {% if po.status in ('sent', 'partial') %}

Auftragsbestätigung Lieferant

{% if po.confirmed_at %}Bestätigt am {{ po.confirmed_at[:16] }}{% else %}Wenn die AB vom Lieferanten kommt, hier eintragen — der bestätigte Liefertermin überschreibt das ursprüngliche Wunschdatum.{% endif %}

{% if po.confirmed_at %} {% endif %}
{% endif %} {# Wareneingang #} {% if po.status in ('sent', 'partial') %}

Wareneingang buchen

Trage die jeweils empfangenen Mengen ein

{% for ln in lines %} {% set rest = (ln.qty_ordered or 0) - (ln.qty_received or 0) %} {% endfor %}
#BeschreibungBestelltErhalten bisher+ Eingang jetzt
{{ loop.index }} {{ ln.description }} {{ '%.2f'|format(ln.qty_ordered) }} {{ ln.unit }} {{ '%.2f'|format(ln.qty_received or 0) }}
{% endif %}
{% endblock %}