CII-DT-024

ReferenceTypeCode should not be present

error: the document is invalid

Why it fails

  • A referenced document (an order, contract or preceding invoice reference) carries ram:ReferenceTypeCode, which EN 16931 uses only for an invoiced object identifier.

How to fix it

Remove ram:ReferenceTypeCode from the reference, or, if it identifies an invoiced object (BT-18), put it in an ram:AdditionalReferencedDocument with ram:TypeCode 130.

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(), 'ReferencedDocument')]
Test
not(ram:ReferenceTypeCode) or (self::ram:AdditionalReferencedDocument and ram:TypeCode='130')

Checked with EN 16931 Invoice (CII)