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.
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
1 parent
7846830765
commit
7e8a3e865e
4 files changed
+74
-29
No files matched your search
@@ -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"],
|
||||
|
||||
@@ -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":
|
||||
|
||||
Reference in new issue
Block a user