Allowed country code for the legal-organization address

Error FX-SCH-A-000664 Factur-X

Value of 'ram:CountryID' is not allowed.

Mandatory rule: As long as it is violated, the invoice is invalid and will be rejected by validators.
What is wrong

The value in ram:CountryID is not in code list 10 used by this check. An empty value passes this specific check; a non-empty value must be in the code list.

What the rule means

The rule ensures that a stated country code conforms to the designated country code list.

Please use an allowed country code for the legal-organization address

The value provided in ram:CountryID is not allowed by this check. You can correct it using the designated country code list.

What to do
  1. Find ram:CountryID in ram:PostalTradeAddress under ram:SpecifiedLegalOrganization.
  2. Compare the stated value with the designated country code list.
  3. Generate the invoice again and validate it.
Technical details

The test accepts an empty code value or a value present as an enumeration in code list 10 of the referenced code database.

Where the rule applies

Applies to ram:CountryID in the postal address of the buyer agent’s ram:SpecifiedLegalOrganization.

Context (rule/@context)
/rsm:CrossIndustryInvoice/rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeAgreement/ ram:BuyerAgentTradeParty/ram:SpecifiedLegalOrganization/ram:PostalTradeAddress/ ram:CountryID
Test expression (assert/@test)
string-length($codeValue10)=0 or document('FACTUR-X_EXTENDED_codedb.xml')/codedb/cl[@id=10]/enumeration[@value=$codeValue10]