Allowed value for the legal organization’s country identifier

Error FX-SCH-A-000847 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 non-empty value of ram:CountryID is not included in the country code list used by this rule. An empty value is also allowed by the test.

What the rule means

ram:CountryID associates the legal organization’s address with a country. If a value is provided, it must belong to the designated code list.

Please use an allowed country identifier for the legal organization

The value in ram:CountryID is not recognized by the rule as an allowed country identifier. An empty value or a value from the designated code list is allowed.

What to do
  1. Locate ram:CountryID in the legal organization’s postal address.
  2. Compare its value with the designated country code list, or leave it empty.
  3. Generate the invoice again and validate it.
Technical details

The test accepts an empty value or a value present in code list 10 in FACTUR-X_EXTENDED_codedb.xml.

Where the rule applies

The rule applies to ram:CountryID in PostalTradeAddress of the SpecifiedLegalOrganization for the ultimate ship-to party.

Context (rule/@context)
/rsm:CrossIndustryInvoice/rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeDelivery/ ram:UltimateShipToTradeParty/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]