Skip to main content

Approval flow and ERP export

Approval and export are the point where recognized data becomes a financial transaction. This layer must be strict, auditable, and recoverable.

Approval types

Document-level approval

Used when the whole invoice must be approved by one or more people.

Examples:

  • total amount above 1,000 EUR;
  • new supplier;
  • low OCR confidence;
  • finance director approval for high risk;
  • duplicate suspicion.

Line-level approval

Used when invoice lines belong to different departments, projects, cost centers, or responsible users.

Example:

  • IT service line approved by IT manager;
  • transport line approved by logistics;
  • material line approved by warehouse manager.

Line approval is essential when one invoice contains several responsibility areas. A 4,000 EUR invoice might not need a single manager to approve the whole document if each line already has a clear owner. Conversely, a small invoice can still require approval if one line maps to a restricted project, VIP cost center, or sensitive category.

Approval rules

Rules can use:

  • amount threshold;
  • supplier;
  • buyer company;
  • cost center;
  • project;
  • document type;
  • currency;
  • VAT mismatch;
  • confidence score;
  • duplicate reason;
  • source channel;
  • user delegation.

Rules can be evaluated at two scopes:

ScopeExample ruleResult
DocumentTotal amount is above 1,000 EUR.Create a document approval task for a manager or finance director.
DocumentSupplier is new or bank account changed.Require accountant review and finance approval before export.
LineLine amount is above a cost-center threshold.Assign that line to the cost-center owner.
LineProject code starts with CAPEX.Assign project manager approval only for affected lines.
LineTransport, legal, IT, or warehouse category detected.Route the line to the functional owner.

The document cannot be exported until all blocking document-level approvals and all blocking line-level approvals are completed. Non-blocking recommendations can remain as warnings in audit history.

Approval workbench behavior

Approvers should see the smallest useful view:

  • documents or lines assigned to them;
  • amount, supplier, client, due date, and risk reason;
  • previous AI and verifier comments;
  • the relevant document page or line evidence;
  • approve, reject, delegate, or request correction;
  • SLA and substitution information.

They should not need to open the full OCR operations console unless their role explicitly allows it.

Delegations

Delegations allow another user to approve during absence. A delegation should have:

  • from user;
  • to user;
  • start date;
  • end date;
  • scope;
  • reason;
  • audit event.

ERP export lifecycle

stateDiagram-v2
[*] --> ReadyForExport
ReadyForExport --> DryRun
DryRun --> ExportQueued
DryRun --> ExportBlocked
ExportQueued --> Exported
ExportQueued --> ExportFailed
ExportFailed --> Retry
Retry --> ExportQueued

Dry-run

Dry-run validates export without posting to ERP. It should check:

  • required fields;
  • supplier mapping;
  • account mapping;
  • VAT logic;
  • currency;
  • dimensions;
  • line totals;
  • duplicate ERP reference;
  • API connectivity.

Mapping UI

ERP mapping should be configurable in UI:

  • document field to ERP field;
  • line field to ERP line field;
  • fixed values;
  • lookup values;
  • conditional mappings;
  • supplier code mapping;
  • cost center and project mapping;
  • fallback behavior.

Rivile priority

For Lithuanian accounting workflows, Rivile should be the first certified ERP path:

  • supplier lookup;
  • invoice header mapping;
  • line mapping;
  • VAT mapping;
  • dry-run;
  • error explanation;
  • retry;
  • payload audit;
  • customer-specific configuration.

Export error screen

A useful export error screen should show:

  • failed document;
  • failed profile;
  • ERP endpoint;
  • mapped payload preview;
  • exact error;
  • suggested fix;
  • retry button;
  • mark as resolved;
  • audit history.

Batch export

Batch export is useful only after validation. The UI should show:

  • selected count;
  • ready count;
  • blocked count;
  • dry-run summary;
  • export progress;
  • partial failures;
  • retry failed only.