Oeffne den Leser aus der Anlagenliste und zeige einen Beleg mit seinem Datum, damit der Drop an der Markierung ankommt und kein Nachweis als undatierter Versand erscheint.
Deploy Development / deploy (push) Successful in 26s
Test Suite / pytest-backend (push) Successful in 1m36s
Test Suite / smoke-dev (push) Successful in 0s
Test Suite / frontend-build (push) Successful in 9s

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
LarsandCursor committed 2026-10-18 12:24:14 +02:00
1 parent 7846830765
commit 7e8a3e865e
4 files changed
+74 -29

No files matched your search

+25 -2
View File
@@ -503,12 +503,26 @@ def export_children(conn, actor: UUID, binding: dict, page: Ctx) -> list[dict]:
)
if not children:
continue
sent = dump_date(dispatch["sent_on"]) or "undatiert"
item_rows = _item_rows(conn, dispatch["id"])
sent = dump_date(dispatch["sent_on"])
if item_rows:
title = f"Versand {sent or 'undatiert'} · {CHANNELS[dispatch['channel']]}"
label = "Versand"
else:
if not sent:
for proof in _evidence_rows(conn, dispatch["id"]):
dates = _dates(conn, proof["element_id"])
sent = dump_date(dates["document_on"]) or dump_date(dates["sent_on"])
if sent:
break
title = sent or "Beleg"
label = "Beleg"
nodes.append(
{
"id": f"dispatch:{dispatch['id']}",
"kind": "dispatch",
"title": f"Versand {sent} · {CHANNELS[dispatch['channel']]}",
"title": title,
"label": label,
"children": children,
"completeness": dispatch["completeness"],
"provenance": dispatch["provenance"],
@@ -1030,6 +1044,14 @@ def _public_dispatch(conn, actor: UUID, dispatch, page: Ctx) -> dict:
}
def _evidence_source(conn, element_id: UUID) -> str | None:
row = conn.execute(
"SELECT source FROM external_references WHERE element_id = %s",
(element_id,),
).fetchone()
return row["source"] if row else None
def _public_evidence(conn, proof, element, page: Ctx) -> dict:
del page
return {
@@ -1037,6 +1059,7 @@ def _public_evidence(conn, proof, element, page: Ctx) -> dict:
"element_id": str(element["id"]),
"title": element["title"],
"kind": element["kind"],
"source": _evidence_source(conn, element["id"]),
"role": proof["role"],
"role_label": EVIDENCE_ROLES[proof["role"]],
"source_state": proof["source_state"],
+1 -1
View File
@@ -392,7 +392,7 @@ def _spec_node(spec: dict) -> ExportNode:
reason=None,
content_kind=None,
children=[_spec_node(child) for child in spec["children"]],
label="Versand",
label=spec.get("label") or "Versand",
)
element = spec.get("element")
if spec["kind"] == "dispatch_item":