Invalid tax exemption reason code

Error FX-SCH-A-001130 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 value in ram:ExemptionReasonCode is not included in the value list defined for this code. This check permits an empty value.

What the rule means

ram:ExemptionReasonCode identifies the reason for a tax exemption. A code that is not listed is not a valid coded representation of that reason.

Please use an allowed code for the tax exemption reason

The value in ram:ExemptionReasonCode is not in the expected value list. You can correct this entry using an allowed code.

What to do
  1. Locate ram:ExemptionReasonCode in the relevant invoice line.
  2. Replace its value with a code from the defined value list.
  3. Generate the invoice again and check it.
Technical details

The test accepts an empty value or a value contained in code list 25.

Where the rule applies

The rule applies to ram:ExemptionReasonCode within the tax information of an invoice line.

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