Skip to content

Detect reverse charge

A custom AI action asks, with the answer shape Yes or no, whether an invoice is a reverse-charge invoice. On yes, accounting reviews its tax before the cost center’s responsible person approves; on no, it goes straight to the approval. If the AI can’t answer, for example without credits or on a confidential document, the invoice goes straight to the approval too. The AI approves nothing.

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: 5
sdk: '1.0.0'
key: reverse-charge
name: Reverse-Charge erkennen
template: custom
trigger:
documentType: incoming-invoice
fields: []
start: ask
steps:
- kind: aiCustom
name: ask
label: Reverse-Charge?
instruction: Ist das eine Reverse-Charge-Rechnung? Antworte mit Ja, wenn die Rechnung keine Umsatzsteuer ausweist und auf die Steuerschuldnerschaft des Leistungsempfängers hinweist.
fields:
- vendorName
- totalGross
readText: true
answer: yesNo
choices: []
next: route
onSkipped: approval
- kind: condition
name: route
label: Reverse-Charge-Rechnung?
branches:
- when:
kind: compare
output:
step: ask
key: answer
operator: equalTo
constants:
- 'true'
next: taxReview
default: approval
- kind: humanTask
name: taxReview
label: Steuerliche Prüfung
taskKind: review
assignees: []
fallback:
kind: role
role: Buchhaltung
options:
excludeRequester: false
excludeActorsOfSteps: []
pickFile: false
next: approval
onRejected: rejected
- kind: humanTask
name: approval
label: Freigabe Kostenstelle
taskKind: approve
assignees:
- when: null
assignee:
kind: costCenterResponsible
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