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.
List accountant tasks
Retrieve a list of accountant tasks with pagination and filters. Use the `filter` param to select a sidebar menu item. Filters AND together on top of the role scope and the `filter` bucket. 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.
Create a new accountant task
Create a new accountant task linked to a purchase order.
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.
Create a new inquiry_needed task
Create a new inquiry_needed accountant task for invoice_verification, po_matching, invoice_missing, or delivery.
Delete an accountant task
Soft delete an accountant task (must be in NEW status). 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.
Get an accountant task by code
Retrieve a specific accountant task with enriched requester, assignee, PO, and comments. 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.
Assign an accountant task
Assign an accountant task to a specific user code. This changes the task status to IN_PROGRESS. Assigning to anybody other than yourself requires the accountant-tasks.assign-to-others permission; claiming a task for yourself does not. 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.
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.
Add a comment to an accountant task
Create a new comment for a specific accountant task. 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.
Unassign an accountant task
Remove the assignee from an accountant task. 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.