Lege Anlagen und Versandbelege direkt am Schriftstueck ab, damit die Zuordnung aus dem Vorgang gezogen werden kann und mehrere Belege an einem Versand bleiben.
Deploy Development / deploy (push) Successful in 26s
Test Suite / pytest-backend (push) Successful in 1m35s
Test Suite / smoke-dev (push) Successful in 0s
Test Suite / frontend-build (push) Successful in 8s

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
LarsandCursor committed 2026-10-18 10:35:32 +02:00
1 parent c138df5e68
commit c774fb7206
9 files changed
+663 -200

No files matched your search

+39
View File
@@ -291,6 +291,33 @@ def add_dispatch_evidence(
return row
def detach_dispatch_evidence(
conn,
actor: UUID,
dispatch_id: UUID,
element_id: UUID,
expected: int,
context: Ctx,
placement: Ctx | None,
) -> None:
container_row, page, scope = open_container(conn, actor, context, placement, "edit")
dispatch = _dispatch_in(conn, dispatch_id, scope)
_bump_dispatch(conn, dispatch_id, expected)
deleted = conn.execute(
"""
DELETE FROM dispatch_evidence
WHERE dispatch_id = %s AND element_id = %s
RETURNING id
""",
(dispatch_id, element_id),
).fetchone()
if deleted is None:
raise not_found()
_clear_evidence_fold(conn, scope, element_id)
_log(conn, dispatch_id, actor, "Nachweis aus diesem Versand gelöst")
audit(conn, actor, container_row["home_scope_id"], "dispatch_evidence_detached", "element", dispatch["host_element_id"], page)
def correct_dispatch(
conn,
actor: UUID,
@@ -1254,6 +1281,18 @@ def _set_binding_fold(conn, scope: Ctx, element_id: UUID, fold: str) -> None:
)
def _clear_evidence_fold(conn, scope: Ctx, element_id: UUID) -> None:
if _is_evidence(conn, scope, element_id):
return
conn.execute(
"""
UPDATE bindings SET list_fold = NULL
WHERE element_id = %s AND context_kind = %s AND context_id = %s AND list_fold = 'evidence'
""",
(element_id, scope.kind, scope.id),
)
def _clear_attachment_fold(conn, scope: Ctx, element_id: UUID) -> None:
if _is_attachment(conn, scope, element_id):
return