BR-NL-10

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

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

For suppliers in the Netherlands, if the customer is in the Netherlands, the customer's legal entity identifier (cac:AccountingCustomerParty/cac:Party/cac:PartyLegalEntity/cbc:CompanyID) MUST be either a KVK (schemeID=0106) or OIN number (schemeID=0190)

Context
cac:AccountingCustomerParty/cac:Party/cac:PartyLegalEntity[$s]
Test
(not(//cac:AccountingCustomerParty/cac:Party/cac:PostalAddress/cac:Country/cbc:IdentificationCode = 'NL') or contains(concat(' ', string-join(//cac:AccountingCustomerParty/cac:Party/cac:PartyLegalEntity/cbc:CompanyID/@schemeID, ' '), ' '), ' 0106 ') or contains(concat(' ', string-join(//cac:AccountingCustomerParty/cac:Party/cac:PartyLegalEntity/cbc:CompanyID/@schemeID, ' '), ' '), ' 0190 ') ) and (not(cbc:CompanyID) or (cbc:CompanyID/normalize-space(.) != ''))

Checked with Netherlands SI-UBL 2.0 Invoice (NLCIUS), Netherlands SI-UBL 2.0 Credit Note (NLCIUS)

Message

For suppliers in the Netherlands, if the customer is in the Netherlands, the customer's legal entity identifier (/rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeAgreement/ram:BuyerTradeParty/ram:SpecifiedLegalOrganization/ram:ID) MUST be either a KVK (schemeID=0106) or OIN number (schemeID=0190)

Context
ram:BuyerTradeParty[$s]
Test
(not(ram:PostalTradeAddress/ram:CountryID = 'NL') or contains(concat(' ', string-join(ram:SpecifiedLegalOrganization/ram:ID/@schemeID, ' '), ' '), ' 0106 ') or contains(concat(' ', string-join(ram:SpecifiedLegalOrganization/ram:ID/@schemeID, ' '), ' '), ' 0190 ') ) and (ram:SpecifiedLegalOrganization/ram:ID/normalize-space(.) != '')

Checked with Netherlands NLCIUS Invoice (CII)