AI agents · manufacturing

An AI agent settles deliveries of raw materials for production

Every delivery of raw materials and production supplies must be settled by matching the supplier invoice to the purchase order and goods receipt (PZ). The agent retrieves the invoice from the document workflow system and the receipts from ERP, proposes a settlement, and records the result in both systems after a person approves it.

Raw material delivery settlementDiscrepanciesMatchedSettledQueue: awaiting approvalFZ/0146/11/2026Supplier A · quantity discrepancyFZ/0205/11/2026Supplier B · missing order numberFZ/0218/11/2026Supplier C · order number lacks prefixFZ/0165/11/2026Supplier D · confirm order numberInvoice FV 1187/11/26 · Supplier BNet PLN 3,213.60 · VAT 739.13 · issued 10.11.2026Description: “Cardboard core 255x155x9 zz7851” → extracted ZZ 7851Invoice item: Cardboard core 255x155x9 · 1,339 pcs × 2.40Receipt (ZZ 7851)ItemQtyReceipt priceInvoice valueReceipt, line 1TT2551559002.402,160.00Receipt, line 2TT2551554002.40960.00Total settled1,3003,120.00PLN 93.60 difference: 1,339 pcs invoiced, 1,300 pcs received.Proposal: settle 1,300 pcs, leave 39 pcs pending correction or returnApprove settlementChange allocationReject
Illustrative mockup of the approval screen using sample data.
In place of two applications
one settlement screen
In place of two rounds of matching
one proposal from the agent
Decision
always made by a person
Volume
about 150 invoices per month

The same delivery was settled twice

A raw materials invoice passes through five stages in the document workflow. At stages two and three, the same person matches it to the goods receipt twice: manually outside the systems, then again in ERP. The match established the first time is never saved.

  1. Registration

    The invoice arrives via KSeF or as a PDF or XML file.

  2. the agent works here

    Business review

    Today: the first match to the receipt is made manually outside the systems.

  3. the agent works here

    Formal verification

    Today: the invoice is re-entered in ERP and matched a second time.

  4. Approval

    An authorised person approves the invoice. This stage stays the same.

  5. Accounting verification

    Posting stays the same.

With the agent: one matching step, one decision and automatic recording in both systems

Two applications

Each invoice requires switching between the document workflow and ERP.

Complex exceptions

Currencies, imports, corrections and incorrect receipts required separate user instructions.

Errors in manual work

Creating documents and moving files between systems by hand leads to errors.

Difficult handover

Training another person to run the settlement process takes time.

The purchase order number is the key to finding the receipt. It appears as free text in the invoice description and has at least five formats. Raw materials are received in linear metres, while suppliers invoice by the square metre, so values cannot be converted directly. Some deliveries come from abroad in a foreign currency and with additional costs.

How the agent prepares the settlement

The agent does the work that the employee settling deliveries does today, once, and records every decision. The supplier, order number, quantities and values drive the match. Item names provide additional evidence.

1

Invoice selection

Inventory invoices awaiting business review or verification that are still absent from ERP.

2

Supplier

The tax ID on the invoice is mapped to the supplier code in ERP. The employee’s choice is saved.

3

Purchase order number

Rules, verification in ERP and a language model for unusual formats.

4

Candidate receipts

Unchecked receipt lines for the order. The invoice waits if there is no receipt.

5

Value allocation

Items are matched to receipt lines by quantity and value. The name dictionary breaks ties.

6

Assessment

Totals match within tolerance, or discrepancies in quantity, price or across several receipts are described.

7

Approval

The employee approves, corrects or puts each settlement on hold.

8

Learning from history

Past settlements and decisions improve future proposals.

Two ways to start the same work

In the invoice queue, the agent looks for receipts for an invoice. In the list of deliveries received without an invoice, it suggests matching supplier invoices using the same purchase order number, delivery document number and a similar value.

Item name dictionary

Names on the supplier invoice differ from item codes in ERP. When an employee matches an item to a receipt line, the agent saves the “supplier name → item code” pair and proposes it as a confirmed match on the next invoice.

Corrections and special cases

  • Quantity difference: settle the quantity on the receipt and leave the remainder pending a correction or return.
  • Price difference: show the receipt price and invoice price side by side, with the supplier’s correction history.
  • Quantity correction: link to the return and the original invoice.
  • Price correction: link to the original invoice.
  • Additional costs: show as a discrepancy with an explanation.
  • Imports: flag and link to invoices for related costs, then settle manually.

Workflow demo

See how an employee works in the tool. Click an invoice in the queue, confirm a pair in the dictionary or start from a goods receipt without an invoice. The demo uses sample data.

Raw material delivery settlement

Invoices from the document workflow · receipts from ERP

Demo · sample data

Invoice from the document workflow · stage: business review

FV 1187/11/26 · Supplier B

FZ/0146/11/2026 · issued 13.11.2026

Net

3,213.60 PLN

Supplier in ERP
Supplier B (matched by tax ID)
Purchase order number
ZZ 7851 – extracted from the description
Invoice description
“Cardboard core 76x3 zz7851”
Match invoice items to goods receipt lines
Invoice item (supplier name)QuantityValueReceipt line in ERPReason
Cardboard core 76x3 mm1339 pcs3,213.60
TUL076 · 900 pcs · 2,160.00
TUL076 · 400 pcs · 960.00
the item spans 2 receipt lines
Net invoice amount: 3,213.60 PLNReceipt line total: 3,120.00 PLNDifference: 93.60 PLN
Quantity difference: 1339 pcs invoiced, 1300 pcs received
Proposal: settle 1300 pcs from the goods receipt (3,120.00) and leave 39 pcs (93.60) unsettled pending a correction or return.

Target workflow

Data from both systems goes into Microsoft Fabric, where the engine prepares proposals. Both matches and discrepancies appear on the same approval screen. The agent records the results in the systems once a person approves them.

  • The document workflow runs in the cloud, with reads and writes through a REST API.
  • The ERP system runs on a local SQL database, with reads through a data gateway.
  • Settlement history and employee decisions improve future proposals.
Data sourcesDocument workflowinvoices, items, PO in descriptioncloud, API reads and writesERP systemorders, goods receipt linesSQL database, data gatewayMicrosoft FabricExtract purchase order numberrules, verification in ERPlanguage modelMatch goods receiptsunchecked receipt linesallocate invoice valuesAssess the proposalmatching, orwith discrepancies explainedApproval screenthe employee approveseach settlement and cancorrect it orput it on holddecisions informfuture proposalsAfter approvalSettlement in ERPinvoice registration,receipt lines, statusReceipt on the invoiceprintout, summary or receiptin the document workflowInvoice statusforward for approval,ERP document numberDashed line: the write depends on the document workflow API or ERP database write access (an RPA bot is an option).

When you click “Approve”, the agent makes three updates

ERP

Registration and settlement

A batch and invoice document with the same fields the employee enters today, values allocated to receipt lines and a “checked” status.

Document workflow

Receipt on the invoice

A receipt printout from ERP, a summary generated from receipt data, or a receipt registered in the document workflow and linked to the invoice.

Document workflow

Invoice status

Complete the business review and verification stages, forward the invoice for approval, and add the ERP document number to the invoice.

Each write has its own status (pending, completed or failed) and can be retried, so an error in one system does not lose the case. Checking the invoice number and supplier prevents duplicate registration.

Data security: the agent sees only what it needs

The agent works with invoices, prices, raw material supplier data and warehouse documents. We design it like any financial system: data stays with the client, permissions are kept to a minimum, and every action can be checked and explained.

Data stays with the client

Invoices, goods receipts and settlements go to a lakehouse in the client’s Microsoft Fabric environment. We keep all copies within that environment.

Least privilege

The document workflow and ERP use separate service accounts restricted to purchase invoices and receipts. Employees sign in with their company accounts.

A person approves every write

The agent changes data in either system only with employee approval, even when everything matches.

Every action can be explained

The log shows the agent’s proposal, its basis, the employee’s decision and the saved changes: who did what and when.

Secure connections

The document workflow uses a REST API over HTTPS. A data gateway connects to the ERP database without exposing it to the internet.

Aligned with security policy

AI usage rules, a risk register and NIS2 requirements are part of the implementation. We first test writes to ERP on a copy of the database.

Example data flow

This example comes from one implementation. The sources, connection method and scope of data passed to the language model are agreed separately for each client.

DataSourceWhere it is processedWhat goes to the language model
Purchase invoices: header, items, descriptionDocument workflow, REST API over HTTPSLakehouse in the client’s Microsoft Fabric environmentOnly the invoice description when the purchase order number uses an unusual format
Orders, receipts, returnsERP database via the data gatewayLakehouse in the client’s Microsoft Fabric environmentOnly item names when comparing them to item codes
Decisions and activity logApproval screenClient’s Microsoft Fabric environmentNothing

The language model runs through AI functions in Microsoft Fabric, within the client’s cloud services. Rules handle amounts, trading partner data and settlements without the language model.

Benefits for the team

The main benefit is a simpler, more reliable process that is easier to hand over. The number of hours saved is secondary.

  • Microsoft Fabric
  • Fabric Apps
  • Lakehouse
  • Fabric AI functions
  • Document workflow REST API
  • Data gateway
  • RPA (fallback)
  • One place to work. The invoice and receipts appear on one screen.
  • Less manual work. Match once instead of twice, skip re-entering the invoice header, and let the agent guide you through exceptions.
  • Fewer errors. Quantity and price discrepancies surface before registration, and the purchase order number and supplier are filled in without manual entry.
  • Faster invoice workflow. Less waiting before approval and a smoother month-end close.
  • Visibility into outstanding items. A list of deliveries received without an invoice and invoices without a goods receipt.
  • Audit trail. You can see who approved the settlement and when, and the goods receipt is attached to the invoice.
  • Less reliance on individuals. The tool keeps the sequence of steps, the name dictionary and supplier mappings.

contact

Let's talk
about your project

Reach out via this form, email, or phone. We will answer your questions, discuss the key challenges, and propose an initial approach tailored to your needs.