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.
- 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.
- Registration
The invoice arrives via KSeF or as a PDF or XML file.
the agent works here
Business reviewToday: the first match to the receipt is made manually outside the systems.
the agent works here
Formal verificationToday: the invoice is re-entered in ERP and matched a second time.
- Approval
An authorised person approves the invoice. This stage stays the same.
- 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.
Invoice selection
Inventory invoices awaiting business review or verification that are still absent from ERP.
Supplier
The tax ID on the invoice is mapped to the supplier code in ERP. The employee’s choice is saved.
Purchase order number
Rules, verification in ERP and a language model for unusual formats.
Candidate receipts
Unchecked receipt lines for the order. The invoice waits if there is no receipt.
Value allocation
Items are matched to receipt lines by quantity and value. The name dictionary breaks ties.
Assessment
Totals match within tolerance, or discrepancies in quantity, price or across several receipts are described.
Approval
The employee approves, corrects or puts each settlement on hold.
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.
Invoices from the document workflow · receipts from ERP
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”
| Invoice item (supplier name) | Quantity | Value | Receipt line in ERP | Reason |
|---|---|---|---|---|
| Cardboard core 76x3 mm | 1339 pcs | 3,213.60 | TUL076 · 900 pcs · 2,160.00 TUL076 · 400 pcs · 960.00 | the item spans 2 receipt lines |
Proposal: settle 1300 pcs from the goods receipt (3,120.00) and leave 39 pcs (93.60) unsettled pending a correction or return.
Goods receipts from ERP with unchecked values and no invoice in the queue. The agent searches for an invoice starting from the receipt, using the same supplier, order or delivery document number, and a similar value.
| Item code | Name in ERP | Quantity | Unchecked value |
|---|---|---|---|
| FOL-PP80-120 | White PP film 80 µm 120 mm | 4000 lm | 5,211.24 |
| FOL-TH200 | Thermal film 200 FSC | 4000 lm | 6,490.88 |
same supplier · delivery document number on the invoice · matching value · no purchase order number on the invoice
No matching invoice in the document workflow (searched by supplier, ZZ 7815, delivery document and a value of about 20,409.99).
Old unchecked receipt. Decide whether to exclude it with a date filter.
“Supplier name → ERP item code” pairs. The agent suggests them as confirmed matches on later invoices from that supplier.
| Supplier | Supplier item name | ERP item code | Source |
|---|---|---|---|
| Supplier A | White PP film 80 µm 1000 mm | FOL-PP80-1000 | from settlement history |
| Supplier B | Cardboard core 76x3 mm | TUL076 | from settlement history |
| Supplier C | Acrylic adhesive 5 l | KLJ-AKR5 | confirmed manually, 12.11.2026 |
Who approved what and when, and the status of each of the three updates.
| Time | Invoice | Decision | Updates |
|---|---|---|---|
| 16.11 09:12 | FZ/0138/11/2026 | approved | ERP ✓ · receipt in workflow ✓ · status ✓ |
| 16.11 09:20 | FZ/0141/11/2026 | approved | ERP ✓ · receipt in workflow ✓ · status: error → retried at 09:23 ✓ |
| 16.11 09:31 | FZ/0158/11/2026 | on hold | checking with the warehouse |
User: procurement specialist (company account).
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.
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.
| Data | Source | Where it is processed | What goes to the language model |
|---|---|---|---|
| Purchase invoices: header, items, description | Document workflow, REST API over HTTPS | Lakehouse in the client’s Microsoft Fabric environment | Only the invoice description when the purchase order number uses an unusual format |
| Orders, receipts, returns | ERP database via the data gateway | Lakehouse in the client’s Microsoft Fabric environment | Only item names when comparing them to item codes |
| Decisions and activity log | Approval screen | Client’s Microsoft Fabric environment | Nothing |
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.
