> ## Documentation Index
> Fetch the complete documentation index at: https://docs.useglimps.com/llms.txt
> Use this file to discover all available pages before exploring further.

# How Glimps reads an invoice

> What Glimps takes off the document, how it checks itself, and what it does with awkward documents.

Glimps reads the whole document, not just the total. Header fields, every line, the VAT split, and the payment details.

## What it takes off the document

| Field | Notes |
| - | - |
| Supplier | Matched to a relation in Exact Online |
| Invoice number | The supplier's number, used for the duplicate check |
| Invoice date | Normalised to a real date, whatever format the supplier used |
| Due date | By default derived from the invoice date and the payment condition. Your company can choose the printed due date instead |
| Amounts | Net, VAT, and gross, per VAT rate |
| Lines | Description, quantity, unit price, and line total |
| Payment reference | The structured reference if the invoice carries one |
| Purchase order numbers | Per invoice and per line, when they are on the document |
| Cost center | Only when the document or your instruction says so, never from history |

<Note>
  By default the due date is derived on purpose. Suppliers print all sorts of things in a due date field. Your payment condition is the agreement, so Glimps uses that. To use the date printed on the invoice instead, see [Due date](/booking/defaults#due-date).
</Note>

## The math check

Glimps adds the lines up and holds the result against the totals on the document. If it does not add up, the invoice says so and waits.

Usually the reading is at fault, not the invoice. Glimps reads the document again at a closer level before it bothers you.

Two kinds of lines are handled on their own:

* **Deposits**, such as crate or bottle deposits, are read as lines of their own, so they count in the sum.
* **Freight or shipping costs** that only appear in the totals block are added to the lines, so the lines add up to the total.

If a real difference is left, correct the lines so they add up. See [Checks](/invoices/checks#math).

## Credit notes

A credit note is recognised as its own kind of document. The amounts are stored positive, with the type marking it as credit. Glimps takes care of the signs when it books.

<Tip>
  A credit note that refuses to send usually points at a line that is negative where the header is not, or the other way around. Open the lines and check that the whole document points the same way.
</Tip>

## Group headers and subtotals

Long invoices often repeat their totals in group headers. Glimps notices when a header row was counted as a line, folds it back, and checks the sum again.

<h2 id="several-invoices-in-one-file">
  Several invoices in one file
</h2>

If a PDF looks like it holds more than one invoice, Glimps says so instead of guessing. You choose: split it, or keep it as one.

The same happens the other way. If a file looks like an attachment to an invoice in the same mail, Glimps asks whether to merge them. Nothing is booked while the question is open.

Pages with a supplier's terms and conditions are never merged into the invoice.

## Protected PDFs

A PDF that is protected against printing, copying or editing is read like any other PDF.

## Long documents

There is no page limit and no shortcut for long documents. A forty page invoice goes through the same line by line reading as a one page invoice. Glimps reads a long document in parts and puts the lines back together, so the math check runs over the whole invoice.

## When the reading is wrong

Correct the field on the invoice and save. Two things happen:

1. The invoice moves on with your value.
2. Glimps learns. Coding you correct becomes the better guess for the next invoice from that supplier.

If the whole document was read badly, use **Reprocess** to read it again from scratch. See [Reprocessing](/invoices/reprocessing).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.