Prototypes VoucherP20 · Invoices read by AI

Inbox

Drop invoices, credit notes or receiptsPDF, a scan or a photo (JPEG or PNG), or an e-invoice in UBL XML. Several at once.

How Voucher is built
  1. A PDF’s words come from its own text with pdf.js, each with its place on the page. A scan or a photo is made at most 2,000 pixels wide and read with Tesseract.js in this browser, in Danish, English and German, and each word keeps the OCR’s confidence. An e-invoice in UBL is read element by element, with no model.
  2. The words go to two models at once, each word with a number. A model answers with the numbers of the words that hold each field, and never with a value. The code reads the value from those words: an amount with the decimal mark the document shows, a date in any of the three languages, a VAT number, an IBAN, a FIK code. The code drops a number that names no word on the page, and the reading lists it.
  3. When a person has approved an invoice from a supplier, the words in front of each value are kept for that supplier. The next document from the supplier is read with them too, as a third reader with no model.
  4. A field is sure when at least two readers read the same value, the value is on the page, no rule on it fails, and on a scan the OCR gave each of its words a confidence of at least 70 out of 100. The rules are the sums of EN 16931 (BR-CO-10, 13, 14, 15 and 17), the check digits of the CVR number (modulus 11), the IBAN (modulus 97) and the FIK code (modulus 10), the order of the dates, and an invoice number already approved for the supplier.
  5. A field that is not sure is shown with its reasons and with its words marked on the page. A click on a word of the page fills the field the person is on. The server runs the rules again on an approval and refuses an invoice number approved before.
  6. An approved invoice is written as Peppol BIS Billing 3.0, the e-invoice format of the European standard, as an Invoice or a CreditNote with its VAT per rate and its lines.
  7. Claude reads when ANTHROPIC_API_KEY is set. Without it, both readers are models on Cloudflare Workers AI.