Use an allowed value for the tax exemption reason

Error FX-SCH-A-000181 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

A non-empty value in ram:ExemptionReasonCode is not included in the code list used by this rule. This test allows an empty value.

What the rule means

ram:ExemptionReasonCode identifies the reason for the tax exemption. A non-empty value must come from the code list specified for this element.

Please use an allowed value for the tax exemption reason

The value entered in ram:ExemptionReasonCode is not included in the code list used for this element. You can correct it using an allowed entry from that code list.

What to do
  1. Find ram:ExemptionReasonCode in the relevant ram:ApplicableTradeTax.
  2. Compare its value with the allowed entries in the corresponding code list.
  3. Regenerate the invoice and check it again.
Technical details

The test allows an empty value; otherwise, the value must occur as an enumeration in the code list with ID 15.

Where the rule applies

The rule checks the value of ram:ExemptionReasonCode within ram:ApplicableTradeTax in the document-level VAT breakdown.

Context (rule/@context)
/rsm:CrossIndustryInvoice/rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeSettlement/ ram:ApplicableTradeTax/ram:ExemptionReasonCode
Test expression (assert/@test)
string-length($codeValue15)=0 or document('FACTUR-X_BASIC-WL_codedb.xml')/codedb/cl[@id=15]/enumeration[@value=$codeValue15]