Check invoice against contract
Before the approval, the card “Check invoice” with “Check invoice against contract” checks an incoming invoice against its vendor’s contract, with no script and no AI: among the contracts of the type “Contract” it looks for the one whose “Counterparty file” is the file of the invoice’s confirmed vendor, wherever the contract is filed, and checks its status, its term on the invoice date and the gross total against the “Contract value” per period (“Value per”) with a 5 % tolerance. When the invoice matches (“Matches”), it goes to approval. When it deviates (“Deviation”), for example because the contract is terminated, the term doesn’t fit or the amount is above it, accounting clears it up first; the hint names the reason, never the contract value. Without a vendor file or a contract (“No contract”), the invoice goes to approval as usual. “Matches” approves nothing: a person still approves. The contract shows on the workflow only to people who may open it. Needs the workflow designer.
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: 9sdk: '1.0.0'key: invoice-contract-checkname: Rechnung gegen Vertrag prüfentemplate: customtrigger: documentType: incoming-invoicefields: []start: matchsteps: - kind: invoiceCheck name: match label: Rechnung gegen Vertrag prüfen check: contractMatch next: approval onDeviation: clarify onNotFound: approval contract: contractType: contract tolerancePercent: 5 - kind: humanTask name: clarify label: Abweichung vom Vertrag klären taskKind: review assignees: [] fallback: kind: role role: Buchhaltung options: excludeRequester: false excludeActorsOfSteps: [] pickFile: false next: approval onRejected: rejected - kind: humanTask name: approval label: Freigabe taskKind: approve assignees: [] 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