Skip to main content

Accountant Tasks

The accountant work queue: tasks and their assignment, completion, grouping per purchase order, and the queue's column preferences.

📄️List accountant tasks grouped by purchase order

Retrieve accountant tasks grouped by purchase order, paginated at the PO level. Each group contains all non-deleted tasks of its PO (any status); the filter only selects which POs appear. Tasks without a PO are returned as single-task groups. Filters AND together on top of the role scope and the `filter` bucket, and select which POs appear rather than which tasks a group contains. Every filter is whole-list SQL, so pagination.total always describes the filtered list, not the page. Multi-select params are repeated (suppliers=1&suppliers=2); the [] alias is accepted, CSV is not. An unparseable value is a 400.

📄️Bulk-assign accountant tasks

Assign many accountant tasks to a single user in one request. Assigning to anybody other than yourself requires the accountant-tasks.assign-to-others permission, checked once for the whole request, so a caller without it is refused outright rather than per task. If the named assignee is on vacation the whole batch is redirected to their active stand-in, resolved once for the request; `redirected` and `effective_assignee_code` report who the tasks actually landed on. Each task is then assigned independently: tasks blocked by the four-eyes rule (the effective assignee is the requester or buyer of the purchase) or otherwise un-assignable are skipped and reported per task, so a single bad task never aborts the batch. A code outside the caller's legal-entity scope is skipped the same way an unknown code is. Returns the per-task outcome.

📄️Cancel an accountant task

Cancel an accountant task (must be in NEW or IN_PROGRESS status). A workflow lifecycle task (accountant_check_invoice, preparation_data_export, transmit_to_fi_tool, transmitted_to_fi_tool_but_no_goods_receipt) cannot be canceled here at all: it follows its invoice through the accounting workflow and is retired by moving the invoice. Restricted to the legal entities the caller reaches through their organizational units: a task belonging to any other entity, and a task belonging to none, answers 404 exactly like an unknown code. ADMIN is unrestricted.

📄️Mark an accountant task as done

Transition an accountant task to the DONE status. For an invoice_without_po task, send resolution_reason (resolved_externally, not_an_invoice, duplicate) to record the resolution path on the task. Omit it for a plain completion. assigned_to_po is not accepted: the match flow closes the task server-side and records that path itself. Restricted to the legal entities the caller reaches through their organizational units: a task belonging to any other entity, and a task belonging to none, answers 404 exactly like an unknown code. ADMIN is unrestricted. Two rules gate an active task on top of that scope: the four-eyes rule refuses the requester or buyer of the purchase, and a task assigned to somebody else must be claimed before it can be completed. Neither applies to a task already in a terminal status, so completing an already-DONE task stays an idempotent no-op.