Check the addresses in e-invoicing documents

E-invoicing makes the parties' addresses structured data, and a wrong one is now a validation problem or a returned delivery. An accounts team wants to know, before sending or booking, which addresses the map does not know.

New Pro Mail and payments Command line Public sector Retail, e-commerce

What you have

Billing documents as XML: UBL 2.1 (Peppol BIS Billing 3, XRechnung UBL), UN/CEFACT CII (XRechnung CII, Factur-X), FatturaPA or KSeF FA, and the country file. The format is read from the root element. The example document bill.xml is in UBL, with a seller in Paris, a buyer in Lyon and a delivery address in Berlin.

Steps

1. Check the files and write a CSV report:

terminalCLI
$ gridpin-pro billing-check france.bin bill.xml --csv report.csv
bill.xml: ubl, 3 addresses
  seller 1 (FR): 10 rue de la Paix, 75002 Paris — yes house_found
  buyer 1 (FR): 12 rue Inventée, 69002 Lyon — no empty
  delivery 1 (DE): Unter den Linden 77, 10117 Berlin — not_checked no_sheet_for_DE

2. Read the report:

terminalCLI
$ cat report.csv

What you get

rolecountrylineexistsreason
sellerFR10 rue de la Paix, 75002 Parisyeshouse_found
buyerFR12 rue Inventée, 69002 Lyonnoempty
deliveryDEUnter den Linden 77, 10117 Berlinnot_checkedno_sheet_for_DE

yes: the file knows the house. no: nothing like it. not_checked: an address of another country than the file's.

Why it works

Each address is found by the element that holds it and the party above it, its parts are joined the way the format writes them, and the line is judged on the country file.

Limits

  • The judgement is the map's: a new building can be missing, and a weak answer gives maybe, never yes.
  • One country file per run.
  • XML signatures are not checked, and the document is never written.

The function and all its keys: billing-check. Part of gridpin-pro, which comes with a Starter or Pro subscription: Free, Starter and Pro.