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
Section titled “The workflow”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: 1schemaVersion: 7sdk: '1.0.0'key: approval-limitname: Freigabe nach Freigabematrixtemplate: customtrigger: documentType: incoming-invoicefields: []start: approvalsteps: - 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