BR-FR-11_BT-47

The rule sets below word this rule differently; each wording is shown with its rule set.

In English If a note with subject code BAR says B2B, the buyer's SIREN (BT-47, scheme 0002) must be given and be exactly 9 digits.

error: the document is invalid

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

Message

[BR-FR-11/BT-47] Si une note contient le code sujet BAR avec la valeur 'B2B', alors le SIREN de l’acheteur (cbc:ID[@schemeID='0002']) est obligatoire et doit être composé exactement de 9 chiffres. BARvalue : … , Valeur actuelle SIREN : " … ". Veuillez renseigner un identifiant SIREN valide.

Context
ubl:Invoice | cn:CreditNote
Test
not($barTreatment='B2B') or ($siren and matches(normalize-space($siren), '^\d{9}$'))

Checked with France e-invoice (UBL), France e-credit note (UBL), France EXTENDED-CTC-FR (UBL)

Message

BR-FR-11/BT-47 : Si une note contient le code sujet BAR avec la valeur 'B2B', alors le SIREN de l’acheteur (BT-47, ram:ID) est obligatoire et doit être composé exactement de 9 chiffres. Valeur actuelle : " … ". Veuillez renseigner un identifiant SIREN valide.

Context
rsm:CrossIndustryInvoice
Test
not($barTreatment = 'B2B') or matches($siren, '^\d{9}$')

Checked with France e-invoice (CII), France Factur-X EN 16931, France EXTENDED-CTC-FR (CII), France Factur-X EXTENDED, France Factur-X BASIC WL