An invoice line audit trail links every spreadsheet row to the exact invoice, retained file version, PDF page and item position it came from, using a source key stored in columns rather than the row’s position in the sheet. Build that key before you sort, filter, correct or allocate anything, then test it by locating three sorted rows in the original PDF.
What is an invoice line audit trail in a spreadsheet?
It is the set of columns that lets a reviewer answer “where does this number come from?” for any row, at any time. Spreadsheet row 14 is not an answer: after a sort by item code, a filter on one vendor or a join with purchase orders, row 14 holds something else. The trail has to travel with the row.
A useful trail answers four questions:
- Which document? Vendor and invoice number.
- Which copy of it? The retained file and its version, because a replacement PDF can carry the same file name.
- Where in it? The physical page and the item position on that page.
- What happened since? Corrections, derived values and allocations, each with its own record.
Structured e-invoices already identify each line: the Peppol invoice line carries an identifier that is unique within its invoice. A PDF gives you a page and a visual position instead, so page and source-file information are review metadata you add; no invoice syntax supplies them for you.
InvoiceLineLab extracts invoice line items from PDF to Excel or CSV and keeps the PDF page and the invoice context beside each row. The source page is already a column when the table reaches your workbook, so sorting and filtering do not cut a row off from its evidence.
Which columns make a source key that survives sorting?
Keep a small document register and an item table linked to it. The values below extend a fictitious invoice INV-204 from vendor S; they are suggested worksheet fields for your own register, not an InvoiceLineLab export specification.
| Field | Synthetic value | What it prevents |
|---|---|---|
| Invoice key | S / INV-204 | Confusing another vendor’s invoice with the same number |
| Retained-copy key | DOC-07-v1 | Opening a replacement PDF stored under the old file name |
| Physical page / printed page number | 3 / 2 | Opening the second page when the item is on the third |
| PDF viewer page label | For example, “02” if displayed | Mistaking a viewer label for the printed number |
| Vendor line position / review record | 27 / R-00027 | Treating the current spreadsheet row as an original identifier |
| Source coverage | Physical pages 3–4 | Losing the continuation of a split description |
The same key is what makes duplicate invoice detection in a batch reliable: two rows with the same invoice key and the same page position point to one item, while two rows from different retained copies point to a repeated document. Assign the review-record identifier once and never renumber it when you sort.
How do you count PDF pages: physical page, printed number or viewer label?
Three numbers can describe the same page. The physical page is its one-based position in the file. The printed number is what the vendor printed on the page. The viewer label is what a PDF viewer shows in its page box, which can follow the document’s own numbering when the file defines page labels. W3C technique PDF17 explains that the main content numbered “1” can actually be the fifth or sixth page of the file.
Use the physical page as the key, because it is the only one that always exists and is unambiguous. Record the printed number separately when it differs: in INV-204, a cover page makes the page printed “2” the third physical page.
What if the invoice has no printed line numbers?
Assign a review locator, for example P3-I04 for the fourth item on physical page 3, and label it as an internal locator. Count items rather than every visual text row, and record a short anchor such as “blue gasket, 4 pieces, 50.00”. If two items share that anchor, add the preceding item or a location note.
Do not put this invented locator into the vendor’s printed-line field. Peppol’s line identifier (BT-126) is unique within an invoice; it does not give an unnumbered PDF a printed identifier, and a reviewer must be able to tell which values were printed and which you assigned.
Keep the retained source version fixed in the document register. A renamed file can still be the same source; a replacement with the same file name can contain different pages. When the source changes, create a new version entry instead of silently reusing the old reference.
Worked example: one invoice line from the PDF to the report
All values are fictitious and in US dollars, before tax. Position 27 of INV-204 reads “blue gasket”, 4 pieces, line net $50.00, on physical page 3 (printed page 2) of DOC-07-v1.
1. Correction. The extraction returned $500.00. The reviewer reads $50.00 on the page, keeps both values, and records reason “decimal misread” and review record R-00027. Dependent cells are recalculated from $50.00.
2. Derived value. An analyst needs a price per piece: $50.00 ÷ 4 = $12.50. The cell is marked “derived”, with its inputs (line net, quantity) and formula. The link to position 27 supports the inputs; it does not mean $12.50 was printed on the invoice.
3. Allocation. The cost is split between department A ($30.00) and department B ($20.00). Both analytical rows keep source key S / INV-204 / DOC-07-v1 / p3 / 27 and add allocation identifiers A-1 and A-2. Check: $30.00 + $20.00 = $50.00, one purchase, not two purchases of $50.00.
4. Totals. The item table still holds one row of $50.00 for position 27. The allocation table holds two rows totaling $50.00. Because the tables are separate, summing the item table cannot double the source amount.
5. Split description. Position 28 starts at the bottom of physical page 3 and continues at the top of page 4. Its row records coverage “pages 3–4”, so a reviewer opens both pages and does not count the continuation as a separate item.
How do you keep corrections and derived values traceable?
- Keep the original extracted value beside the corrected one, with the reason, reviewer and date.
- Record for each value whether it is printed, derived or unresolved. A single confidence score does not explain where a value came from.
- Store formulas or their inputs for derived cells; a pasted value has lost its trail.
- After a correction, recompute dependent cells, then reopen the retained page from the sorted table. If the correction is right but the pointer opens a different file version, the row is still unresolved.
How do you test the trail before handoff?
- Sort the table by a column unrelated to the source, such as item code.
- Pick three rows at random, including one corrected and one allocated row.
- For each, open the retained copy at the recorded physical page and find the item from the position or anchor.
- Confirm the amount, quantity and description, and that any allocation adds back to the line net.
- If a row cannot be located, improve the key before sharing the table.
Then send a colleague only a sorted analytical row and its register entry. The expected result is the correct retained document, page and item, with any allocation explained. A clickable file name alone does not pass this test.
What a source key does not prove
Page links and source keys make rows reviewable; they do not establish a certified audit trail, prove who issued the invoice or grant access to the file. A checksum of the retained file can detect changed bytes when your workflow already supports it, but it does not locate an item. Keep access to originals controlled and define retention separately. For a handful of invoices, a manual source register gives the same evidence.
FAQ
Why not use the spreadsheet row number as a reference?
Because it changes with every sort, filter, insertion or join. Store invoice key, retained file, physical page and item position in their own columns so the reference moves with the row.
Which page number should I record for an invoice line?
The physical page, counted from one in the retained file. Add the printed page number or viewer label in a separate column when it differs.
How do I reference an invoice line that has no line number?
Use an internal locator such as P3-I04 (page 3, fourth item) plus a short text anchor, and label it as yours, not the vendor’s.
Does a page reference make the spreadsheet audit-proof?
No. It makes each value checkable against its source. Authenticity of the invoice, access control and retention are separate controls.
Continue the checks
Item codes used in the key must stay exact: keep leading zeros in vendor item codes when the table is opened in Excel. When a table crosses pages, remove carried subtotals and repeated headers before keying the rows. For the structure itself, see how line items differ from invoice header fields.
The synthetic invoice table on the home page shows a PDF page column beside every row, and the line-by-line validation checks start from that page reference.