CII-DT-031

currencyID should not be present

error: the document is invalid

Why it fails

  • Amounts carry a currencyID attribute, which CII invoices under EN 16931 leave out: the currency is given once, in ram:InvoiceCurrencyCode.
  • A generator that also writes UBL, where every amount has a currencyID, added it to CII amounts as well.

How to fix it

Remove currencyID from every amount except ram:TaxTotalAmount, which keeps it so a VAT total in the accounting currency (BT-111) can be told apart.

What the rule checks

As the rule set's publisher wrote it. The rule runs on every element the context matches, and fails where the test is false; the validator reports the line of that element.

Context
//ram:*[ends-with(name(), 'Amount') and not (self::ram:TaxTotalAmount)]
Test
not(@currencyID)

Checked with EN 16931 Invoice (CII)