Skip to content
Open
Show file tree
Hide file tree
Changes from 67 commits
Commits
Show all changes
74 commits
Select commit Hold shift + click to select a range
17547a1
Add PINT AE tax combo rules
miguelalvarezd Nov 10, 2026
915b628
Add PINT AE payment and currency rules
miguelalvarezd Nov 10, 2026
09ada3e
Add the PINT AE out-of-scope document types
miguelalvarezd Nov 10, 2026
386a162
Add PINT AE invoice, line and address rules
miguelalvarezd Nov 11, 2026
dc8ed3d
Remove the IBR-136-AE type code TODO
miguelalvarezd Nov 11, 2026
80beb81
Add the Peppol PINT AE UBL format
miguelalvarezd Nov 11, 2026
ef403d4
Add the PINT AE line amounts and AED totals
miguelalvarezd Nov 11, 2026
351e199
Add the PINT AE identity rules and types
miguelalvarezd Nov 11, 2026
9bf2d93
Add the PINT AE transaction type
miguelalvarezd Nov 11, 2026
4855ee0
Add the PINT AE credit note reason
miguelalvarezd Nov 11, 2026
5e173e1
Add the PINT AE billing frequency
miguelalvarezd Nov 11, 2026
ca2a6f0
Add the PINT AE exemption reason codes
miguelalvarezd Nov 12, 2026
5dcc73d
Add the PINT AE goods type and GTIN
miguelalvarezd Nov 12, 2026
f7fd9e1
Add the PINT AE item type
miguelalvarezd Nov 12, 2026
3e99587
Add the PINT AE margin scheme category
miguelalvarezd Nov 12, 2026
5caf6f2
Add the PINT AE Incoterms
miguelalvarezd Nov 12, 2026
d718a05
Import the seller's legal form in the PINT AE parse fixtures
miguelalvarezd Nov 12, 2026
998b82f
Use the ICC Incoterms extensions for the PINT AE delivery terms
miguelalvarezd Nov 12, 2026
93b8241
Add the usage of the PINT AE extensions
miguelalvarezd Nov 12, 2026
e55a3a3
Align the PINT AE rules with the Schematron after review
miguelalvarezd Nov 12, 2026
8c8d3a9
Fix the PINT AE import and price discount, and add self-billing fixtures
miguelalvarezd Nov 12, 2026
7e047e4
Read the PINT AE delivery terms from the gobl.ubl slice
miguelalvarezd Nov 12, 2026
f205669
Fix the PINT AE import and rule gaps found in the final review
miguelalvarezd Nov 12, 2026
57fb47a
Use UAE tax numbers with a valid check digit in the PINT AE fixtures
miguelalvarezd Nov 12, 2026
47e06f0
Pin gobl and gobl.ubl to the PINT AE dependency PRs
miguelalvarezd Nov 16, 2026
b268e2e
Refactor the PINT AE rules after review
miguelalvarezd Nov 16, 2026
19d3ce1
Use the AE regime's identity types
miguelalvarezd Nov 16, 2026
c36bf19
Add the PINT AE extensions for the fields GOBL has no place for
miguelalvarezd Nov 16, 2026
e8269bf
Write and read the remaining PINT AE fields
miguelalvarezd Nov 16, 2026
08b568a
Cover the fields PINT AE shares with EN 16931 in a fixture
miguelalvarezd Nov 16, 2026
6a20e3a
Pin gobl and gobl.ubl to the latest PINT AE dependency PRs
miguelalvarezd Nov 16, 2026
37ff625
Pin gobl and gobl.ubl to the restacked PINT AE dependency PRs
miguelalvarezd Nov 16, 2026
ffbf486
Pin gobl and gobl.ubl to the Copilot review fixes
miguelalvarezd Nov 16, 2026
9a0ae65
Merge AE VAT breakdowns whose rates differ only in how they are written
miguelalvarezd Nov 16, 2026
fbab21f
Require a supplier TIN for a customer tax ID that isn't under VAT
miguelalvarezd Nov 16, 2026
7992b92
Use currency rounding on UAE invoices
miguelalvarezd Nov 16, 2026
00c518f
Write the Incoterms scheme on the AE delivery terms
miguelalvarezd Nov 17, 2026
ae425e8
Map the AE margin scheme from the regime tag and exempt lines
miguelalvarezd Nov 17, 2026
142249f
Leave the TRN format to the AE regime, checking only its 03 ending
miguelalvarezd Nov 17, 2026
6e84969
Pin gobl to the PR head without the all-zeros TIN check
miguelalvarezd Nov 17, 2026
96dcbfa
Keep exempt lines with a UAE exemption reason out of the margin scheme
miguelalvarezd Nov 17, 2026
30103fa
Check that each AE convert fixture survives an import round trip
miguelalvarezd Nov 17, 2026
b79e7b9
Pin phorm to 2.2.14 in CI
miguelalvarezd Nov 17, 2026
e171398
Drop BR-CO-25 under PINT AE in favour of its own payment rules
miguelalvarezd Nov 17, 2026
69e7d58
Join the notes into one on PINT AE documents and lines
miguelalvarezd Nov 17, 2026
af03135
Allow one buyer identifier on PINT AE documents
miguelalvarezd Nov 17, 2026
9b87df5
Pin gobl to the PR head that rejects informative charges again
miguelalvarezd Nov 17, 2026
79d6184
Prefix the PINT AE extension names with "PINT AE:"
miguelalvarezd Nov 17, 2026
bdd8cb0
Write the PINT AE line amounts in AED
miguelalvarezd Nov 17, 2026
989c633
Write the PINT AE delivery party ID (BTAE-23)
miguelalvarezd Nov 17, 2026
b0b2062
Pin gobl to the PR head updated from main
miguelalvarezd Nov 17, 2026
d807b5e
Check every party's tax schemes and the customer endpoint under PINT AE
miguelalvarezd Nov 17, 2026
3775a40
Pin gobl to the PR head restacked on the BR-37 PR
miguelalvarezd Nov 17, 2026
661a933
Pin gobl to the PR head without the extra charge test
miguelalvarezd Nov 17, 2026
6d45a8a
Reject the document types, currencies and email endpoints PINT AE fails
miguelalvarezd Nov 17, 2026
65dc96a
Stop writing the third address line
miguelalvarezd Nov 18, 2026
590fdf5
Update the PINT AE rules to 1.0.5
miguelalvarezd Nov 18, 2026
d497e77
Simplify the PINT AE addon
miguelalvarezd Nov 18, 2026
dd9d891
Apply the shared PINT rules to every regime
miguelalvarezd Nov 18, 2026
4de60fe
Reorganise the PINT rule sets
miguelalvarezd Nov 18, 2026
f35d31c
Pin gobl and gobl.ubl to the PR heads
miguelalvarezd Nov 18, 2026
4e1b462
Run the schematron validation on phorm 2.2.15
miguelalvarezd Nov 18, 2026
7552b9a
Rework the PINT AE extensions
miguelalvarezd Nov 19, 2026
4784176
Check the PINT AE round trip on the GOBL invoice
miguelalvarezd Nov 19, 2026
e1cd26c
Pin gobl.ubl to the PR head
miguelalvarezd Nov 19, 2026
c6e5789
Trim the PINT AE comments and tests
miguelalvarezd Nov 19, 2026
2e2eb44
Pin gobl and gobl.ubl to the PR heads
miguelalvarezd Nov 19, 2026
d9319da
Merge main into pint-ae-support
miguelalvarezd Nov 19, 2026
227ed46
Stop writing the IBAN scheme on the payee account
miguelalvarezd Nov 19, 2026
33d4602
Shorten the PINT AE README
miguelalvarezd Nov 19, 2026
d37e97f
Pin gobl.ubl to the PR head
miguelalvarezd Nov 19, 2026
a52d92b
Pin gobl.ubl to the PR head
miguelalvarezd Nov 19, 2026
619f0c3
Import the rest of the official PINT AE examples
miguelalvarezd Nov 19, 2026
ece9580
Drop PINT AE rules our output can't fail and simplify helpers
miguelalvarezd Nov 19, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
# fixtures.
services:
phorm:
image: phelger/phorm:latest
image: phelger/phorm:2.2.15
ports:
- 8080:8080

Expand Down
111 changes: 108 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,9 @@ This module implements the Peppol billing models as a set of GOBL tax addons:
beyond VAT (such as GST). Jurisdiction-specific rules are applied according
to the document's tax regime: Australian (`AU`) and New Zealand (`NZ`)
documents are also validated against the
[PINT A-NZ](https://docs.peppol.eu/poac/aunz/pint-aunz/bis/) rules.
[PINT A-NZ](https://docs.peppol.eu/poac/aunz/pint-aunz/bis/) rules, and UAE
(`AE`) documents against the
[PINT AE](https://docs.peppol.eu/poac/ae/pint-ae/) rules.

A document must declare the addon that applies to it.

Expand Down Expand Up @@ -52,6 +54,47 @@ $addons:

See the [`examples`](./examples) directory for complete invoices.

### PINT

Documents with the PINT addon, in any regime:

- Have supplier and customer electronic addresses, and no email address as
an endpoint or inbox. gobl.ubl writes an email address as `cbc:EndpointID`
with the scheme `EM`, which PINT does not accept, so a party can't have one
next to its Peppol endpoint either.
- Have at most one customer identity written as `cac:PartyIdentification`
(any identity other than the tax ones and the first legal one, including a
UAE customer's TIN), and at most one customer tax registration (the tax ID
or a `tax` identity).
- Give the payee a name, and a payee that differs from the supplier in its
legal identity, identity or name.

### PINT AE

UAE documents with the PINT addon follow the PINT AE rules:

- They can only be invoices and credit notes, without the `partial`,
`prepayment` or `factoring` tags, as PINT AE has no document type for
anything else. Documents out of scope of VAT take the `outside-tax-scope`
tag, which sets the document type to 480 on invoices and 81 on credit notes.
- Trade licences carry their issuing authority in the description, and
passports their issuing country.
- The supplier's and customer's UAE identities without a scope get the one
PINT AE reads them from: `legal` for the first trade licence, Emirates ID,
passport or Cabinet Decision of a party that has no legal identity yet, and
`tax` for the supplier's TIN.
- A supplier with a UAE TRN gets the TIN it starts with as a `tax` identity,
and the UAE Peppol endpoint `0235:<TIN>`, when it has neither.
- The PINT AE transaction type comes from the tags `free-trade-zone`,
`deemed-supply`, `margin-scheme`, `summary`, `continuous-supply`,
`disclosed-agent`, `e-commerce` and `export`.
- PINT AE predefines three customer endpoints: `0235:9900000097` on deemed
supplies, which the addon checks, and `0235:9900000099` for exports to a
receiver not on Peppol and `0235:9900000098` for a buyer not subject to UAE
e-invoicing, which the user sets.
- Supplies under the profit margin scheme take the AE regime's
`margin-scheme` tag; see [Conversion](#conversion) for how they are written.

## Layout

- `addon/` — the GOBL addons: normalizers, scenarios and validation rules that
Expand Down Expand Up @@ -86,6 +129,7 @@ import, and the exported XML carries them back:
| `FormatBIS` | `ubl+peppol+bis-v3` | `urn:cen.eu:en16931:2017#compliant#urn:fdc:peppol.eu:2017:poacc:billing:3.0` | `urn:fdc:peppol.eu:2017:poacc:billing:01:1.0` |
| `FormatPINT` | `ubl+peppol+pint` | `urn:peppol:pint:billing-1` | `urn:peppol:bis:billing` |
| `FormatAUNZ` | `ubl+peppol+pint+aunz` | `urn:peppol:pint:billing-1@aunz-1` | `urn:peppol:bis:billing` |
| `FormatAE` | `ubl+peppol+pint+ae` | `urn:peppol:pint:billing-1@ae-1` | `urn:peppol:bis:billing` |

`FormatBIS` writes self-billed invoices with `SpecificationBISSelfBilling`
(Peppol BIS Self-Billing 3.0) and statuses (`bill.Status`) as Peppol Invoice
Expand All @@ -97,12 +141,73 @@ as Peppol BIS allows a single note.
`FormatAUNZ` writes self-billed invoices (those tagged `self-billed`) with its
`SpecificationAUNZSelfBilling` instead: `urn:peppol:pint:selfbilling-1@aunz-1`
and `urn:peppol:bis:selfbilling`. Documents carrying either are imported with
`FormatAUNZ`.
`FormatAUNZ`. `FormatAE` does the same with `SpecificationAESelfBilling`
(`urn:peppol:pint:selfbilling-1@ae-1`).

`FormatAE` also adjusts the output to the PINT AE rules: it writes the invoice
UUID, the price base quantity and gross price, the UAE TRN without its country
prefix, the standard rate on reverse charge lines, breakdowns, allowances and
charges, no rate on exempt lines and breakdowns, one VAT breakdown per
category, and each line's amount with VAT and VAT amount in AED. For invoices not in AED, it also writes the exchange rate to
AED and the total with VAT in AED, and converts the line amounts with that
rate. The seller and buyer legal identities get their PINT AE type (`TL`,
`EID`, `PAS` or `CD`, from the AE regime's identity keys and `passport`), with
the trade licence authority (the identity's description) or the passport's
issuing country, and the seller's TIN goes under the `TIN` tax scheme. It also
writes the transaction type as `cbc:ProfileExecutionID`, with the free trade
zone beneficiary and the disclosed agent's principal as the buyer and seller
parties, and the credit note reason as `cac:DiscrepancyResponse`, the VAT exemption reason (`cef-vatex`, one of the UAE codes `DL8.46.1` to `DL8.46.4`) of
exempt lines, and each item's type of goods or services subject to the reverse charge
as its `cbc:NatureCode`, with its GTIN as the standard identifier. Items keyed
`goods`, `services` or `goods-services` get the item type `G`, `S` or `B`, and
identities labelled `SAC` are written as service accounting codes. The
delivery's ICC Incoterms (`icc-incoterms-2020` or `-2010`) are written as the
delivery terms, and the delivery receiver's UAE TRN, or its TIN without one,
as the delivery party's identification (BTAE-23). PINT allows a single note
on the document and on each line (ibr-sr-51, ibr-sr-34), so the PINT addon
rejects invoices with more, in every PINT format, instead of joining them.
Only the payment due date (IBT-009) is written, so the addon also rejects
more than one due date, or one for part of the amount due. That is a
limitation of this library, not a PINT rule: PINT can carry instalments
(IBG-33).

**Profit margin scheme.** A UAE supply under the profit margin scheme takes the AE regime's
`margin-scheme` tag, with the `exempt` VAT key on every line:

- Issue one invoice per margin scheme sale, with no other VAT treatments and
no document-level discounts or charges (IBR-116-AE).
- The lines go out in the `N` category at the standard rate, with no VAT
amount.
- The statement that VAT is charged under the scheme, which the regime's
scenario adds as a VAT note, goes out as the VAT exemption reason text of
the `N` breakdown and lines.
- The margin VAT is reported in the VAT return, not on the invoice.

Without the tag, `exempt` lines are a normal exempt supply (`E`). Anyone
reading GOBL data must identify margin scheme lines by the tag together with
the `exempt` key, never by the key alone.

It also writes the PINT fields gobl.ubl leaves out: the issue time; each
contract's description, where PINT AE puts the contract value; the `IBAN`
scheme of the payee account and the address of its branch;
`cbc:TaxIncludedIndicator` as `false`; and the tax note of a line's VAT category as its exemption reason text. On import, it reads
the invoice UUID, the out-of-scope type codes 480 and 81 back as the
`outside-tax-scope` tag, and
the identity types, authorities, passport countries and seller TIN back as
identity keys and fields, the transaction type back as its extension and
tags, and the credit note reason, line exemption
reasons and item goods types back as their extensions, and the item
types and service accounting codes back as item keys and identities, and
the `N` category back as the `exempt` key with the `margin-scheme` tag, and
the delivery terms back
as the `icc-incoterms-2020` extension, and the seller and buyer electronic
addresses as endpoints, and the discount and charge exemption reasons and
line exemption reason texts back as their extensions and tax notes.

Each one's Peppol document type identifier is
`urn:oasis:names:specification:ubl:schema:xsd:Invoice-2::Invoice##<CustomizationID>::2.1`,
with `CreditNote-2::CreditNote` replacing `Invoice-2::Invoice` for credit notes.
The A-NZ formats also claim the wildcard customizations the SMP registrations
The A-NZ and AE formats also claim the wildcard customizations the SMP registrations
are made under, and `FormatPINT` is the jurisdiction-neutral base: it takes any
other `urn:peppol:pint:billing-1@…` specialization and validates it against the
base PINT rule set.
Expand Down
Loading