Use an allowed unit of measure code

Error FX-SCH-A-001059 Factur-X

Value of '@unitCode' 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 of @unitCode is not included in the code list used by this rule. The test allows an empty value or a value included in the code list.

What the rule means

An allowed code identifies the unit of ram:BasisQuantity. The test checks the value against the unit of measure code list.

Please use an allowed unit of measure code for the base quantity

The code in @unitCode on ram:BasisQuantity is not allowed by this rule. You can check the value against the applicable code list.

What to do
  1. Find ram:BasisQuantity within ram:NetPriceProductTradePrice.
  2. Check the value of @unitCode against the applicable unit of measure code list.
  3. Generate the invoice again and validate it.
Technical details

The test passes when $codeValue15 is empty or its value matches an entry in codedb/cl[@id=15]/enumeration.

Where the rule applies

The rule applies to the value of @unitCode on ram:BasisQuantity of an invoice line’s net price.

Context (rule/@context)
/rsm:CrossIndustryInvoice/rsm:SupplyChainTradeTransaction/ram:IncludedSupplyChainTradeLineItem/ ram:SpecifiedLineTradeAgreement/ram:NetPriceProductTradePrice/ram:BasisQuantity
Test expression (assert/@test)
string-length($codeValue15)=0 or document('FACTUR-X_EXTENDED_codedb.xml')/codedb/cl[@id=15]/enumeration[@value=$codeValue15]