Exemption reason code must be allowed

Error FX-SCH-A-001065 Factur-X

Value of 'ram:ExemptionReasonCode' 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:ExemptionReasonCode is not included in the code list used by this rule. The test condition also accepts an empty value.

What the rule means

The exemption reason code identifies the reason for a tax exemption. A non-empty code must match an entry in the associated code list.

Please use an allowed exemption reason code

The supplied exemption reason code is not included in the code list allowed by this rule. This check also accepts an empty value.

What to do
  1. Check the value in ram:ExemptionReasonCode.
  2. Use an entry from the code list used by this rule, or leave the value empty.
  3. Generate the invoice again and validate it again.
What it looks like
✓ Correct
<ram:ExemptionReasonCode/>
Technical details

The check compares the text value of ram:ExemptionReasonCode with entries in the external code list identified as 25; a value of zero length is also accepted.

Where the rule applies

The rule checks ram:ExemptionReasonCode in the tax information for an invoice line’s net price.

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