File into the vendor's file
Every incoming invoice lands in its vendor’s file: the Filing step with “By field” looks for the file of the file type vendor whose unique key field vendorName holds the invoice’s vendor, with no script. When there is none, it creates one with the number series’ next number and the vendor’s name (“Created and filed”), only one even when two invoices of a new vendor arrive at once. It never creates a file for a confidential document. Then the invoice goes to approval.
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: file-by-vendorname: In die Lieferantenakte ablegentemplate: customtrigger: documentType: incoming-invoicefields: []start: filesteps: - kind: filing name: file label: In Lieferantenakte ablegen tags: [] byField: fileType: vendor keyField: vendorName documentField: vendorName create: true nameField: vendorName next: approval onCreated: approval onNoFile: approval - 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