Skip to content

Approval by an approval matrix

Who approves an incoming invoice is in the data table freigabematrix: each row names a stufe (level), a freigeber (a role or a member’s email address), a limit and optionally a kostenstelle (cost center). The approval with “Approval limit from a data table” goes to the first level whose limit covers the gross total, with no script: an invoice of €12,000, say, passes the head of department’s €5,000 and lands with the management. When no row covers the amount, the management takes the task as the fallback. A change of the table applies from the next task on.

The workflow starts for every document of the type incoming-invoice. Its file workflow.yaml:

$schema: 'https://docs.acriva.de/schemas/workflow.schema.json'
format: 1
schemaVersion: 7
sdk: '1.0.0'
key: approval-limit
name: Freigabe nach Freigabematrix
template: custom
trigger:
documentType: incoming-invoice
fields: []
start: approval
steps:
- kind: humanTask
name: approval
label: Freigabe nach Freigabelimit
taskKind: approve
assignees:
- when: null
assignee:
kind: approvalLimit
table: freigabematrix
fallback:
kind: role
role: Geschäftsführung
options:
excludeRequester: true
excludeActorsOfSteps: []
pickFile: false
next: approved
onRejected: rejected
- kind: end
name: approved
label: Freigegeben
outcome: approved
- kind: end
name: rejected
label: Zurückgewiesen
outcome: rejected