The software company that created FT Mercati Go to ftmercati.com

Case study

E-invoicing with AI reading of customer notes

The program we issue our e-invoices with: AI reads orders, CIG codes and declarations of intent from the notes, and a person confirms every invoice.

In production Administration (accounts): e-invoicing from contracts, orders and notes Updated on

  • 3AI readings from each customer's notes: purchase order, CIG, declaration of intent
  • 3invoicing modules, all on the same validated XML generator
  • 1human confirmation for every invoice: issuing is a single operation, all or nothing
  • 2programs that talk to each other: the CRM writes the notes in a canonical form, this one reads them back

In brief

This is the program the accounts department of FT Mercati and FT Support uses every month to issue e-invoices for the contracts recorded in the CRM. Artificial intelligence (AI) does just one thing, tedious and delicate: it reads the administrative notes written by people and extracts the purchase order, the CIG code and the declaration of intent. Every failed reading is counted and flagged; every invoice is ticked and confirmed by a person.

The starting point

Every month the accounts department issues the invoices for the contracts in force. Many of them have to carry information that sits outside the contract: the number and date of the customer’s purchase order, the CIG code (Italy’s identification code for public contracts) for public bodies and for the companies that ask for it, the details of the declaration of intent (in Italian, dichiarazione d’intento) of customers who buy without VAT, the agreed fee increases. A missing or wrong item means a disputed invoice and a payment that slips.

This information sits in the customer’s administrative notes, in the CRM: free text, written by different people in different years, or written by the CRM itself in a canonical form when an order is confirmed. Copying it by hand into many invoices, every month, is the kind of work in which mistakes are made precisely because it is easy.

What we built

A Windows program, for internal use, that reads the contracts from the CRM, prepares the list of the month’s invoices, generates the XML file in the format of the Agenzia delle Entrate (Italy’s revenue agency) and the PDF, validates them and records invoices, invoice lines and instalments. It has three modules, for invoices from contracts, for recurring invoices on fixed terms and for free-form invoices, and all three go through the same XML generator: a single rule for the special VAT cases (split payment, reverse charge, exempt transactions), a single validation.

Where the AI works

The language model reads each customer’s notes and returns structured fields, not text:

  • the number and date of the purchase order;
  • the CIG code;
  • the details of the declaration of intent, even when the note is the Agenzia’s electronic receipt pasted in as it is.

Fee increases, which the CRM records in a fixed form, are read by a rule, without AI.

For the declaration of intent, the number returned is compared with the digits present in the note: if the model “sees” a number that is not in the text, the reading is discarded. For the order and the CIG, the model must return “no data” when the label is missing from the note, and the person always has the original note to hand. The model is chosen from a menu, with the list kept up to date from the provider, and at start-up the program checks that it is still on offer.

How we keep the AI under control

  1. Failed readings are counted. An API error, no network, an answer without the expected format: the row is marked and excluded from “Select all”, a button shows the original note, and the final warning gives the count and the customers affected.
  2. The person decides. The operator ticks and confirms every invoice; the AI issues nothing.
  3. Atomic issuing. For each invoice, the XML, the PDF and the records are written in a single operation: all or nothing. Before issuing, the program re-reads the customer’s notes; if they have changed since the reading, the row stops and the values from the outdated note are removed, while those entered by hand stay.
  4. Coordination with the CRM. When an order is confirmed in the CRM, the CRM writes the notes in a canonical form that this program reads back; an order without a CIG, while an earlier CIG is still in use, lights up a red row, “CIG pending”, until someone decides.
  5. Tests before release. The latest changes went through a test bench on a local copy of the data: notes changed between generation and issuing, API errors counted, a complete generation with no unwanted writes.

Declared limits

  • a note changed in the instant between the re-reading and the recording is not seen;
  • an order in Word format cannot be read by the AI: the data is entered by hand;
  • it is an internal program, not a product: it is the method that transfers, not the software.

What it means for your company

It is the simplest use of AI in administration: a repetitive task, free text to be turned into fields, a check that is never skipped. It applies to orders and CIG codes, but also to order confirmations, delivery notes, customers’ emails and salespeople’s notes. The rules are those of our agents that write to the ERP (the company’s management software): the AI reads and proposes, the code verifies, the person confirms, and every missed reading is visible.

To find out more: the guide on the AI assistant on company documents and the one on how to connect an agent to the ERP. If you have an administrative step that lives on copy and paste, let’s talk.

Frequently asked questions

Invoicing with AI reading: questions and answers

Why use AI to read administrative notes?

Because the notes are free text, written by different people in different years: "Purchase order 4521 of 3 March", "PO no. 4521/2026", the electronic receipt of the declaration of intent pasted in as it is. A fixed rule gets them wrong; a language model reads them and returns the fields in a structured format, which the program checks before using them.

What happens if an AI reading fails?

The row is marked and excluded from bulk selection, with a button that shows the original note so that the data can be copied by hand; at the end of the list a warning says how many readings failed and for which customers. The program no longer leaves a field empty in silence: that is the lesson learned when a model retired by its provider was returning empty fields, identical to a note with no data.

Can the AI issue an invoice on its own?

No. The AI fills in the fields; the person ticks and confirms. Issuing each invoice is a single operation: before writing the XML, the PDF and the records, the program re-reads the customer's notes and, if they have changed, stops the row and removes the values read from the outdated note; those entered by hand stay.

Can the same be done with another ERP?

Yes, if the notes or the documents can be read by the program. The real work is not the call to the model: it is deciding what to read, how to verify it, what to do when the reading fails and how to coordinate with whoever writes the notes. Those are the four things this program does.

Other case studies

Do you have a process you would like to see working better?

Tell us about it in a first conversation, with no obligation: together we work out whether and where AI brings a measurable benefit, and which step to start with.