Invalid VAT category code for an allowance

Error FX-SCH-A-000599 Factur-X

Value of 'ram:CategoryCode' 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 ram:CategoryCode is not in the designated code list. The test accepts a missing or empty value.

What the rule means

ram:CategoryCode classifies the VAT category of the allowance. A code that is not permitted cannot be assigned to the designated category.

Please use an allowed VAT category code for the allowance

The VAT category code for the allowance is not in the designated code list. You can change the value or leave it empty.

What to do
  1. Find the allowance in ram:SpecifiedTradeAllowanceCharge whose udt:Indicator is false.
  2. Check the value of ram:CategoryCode inside ram:CategoryTradeTax.
  3. Use a value from the designated code list or leave ram:CategoryCode empty.
  4. Generate the invoice again and validate it again.
What it looks like
✗ Triggers the message
<ram:SpecifiedTradeAllowanceCharge>
  <ram:ChargeIndicator>
    <udt:Indicator>false</udt:Indicator>
  </ram:ChargeIndicator>
  <ram:CategoryTradeTax>
    <ram:CategoryCode>INVALID-CODE</ram:CategoryCode>
  </ram:CategoryTradeTax>
</ram:SpecifiedTradeAllowanceCharge>
✓ Correct
<ram:SpecifiedTradeAllowanceCharge>
  <ram:ChargeIndicator>
    <udt:Indicator>false</udt:Indicator>
  </ram:ChargeIndicator>
  <ram:CategoryTradeTax>
    <ram:CategoryCode/>
  </ram:CategoryTradeTax>
</ram:SpecifiedTradeAllowanceCharge>
Technical details

The test applies to allowances with udt:Indicator equal to false and accepts an empty value or a value from code list cl with ID 10.

Where the rule applies

The rule applies to ram:CategoryCode of ram:CategoryTradeTax for a document-level allowance in ram:SpecifiedTradeAllowanceCharge.

Context (rule/@context)
/rsm:CrossIndustryInvoice/rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeSettlement/ ram:SpecifiedTradeAllowanceCharge[ram:ChargeIndicator/udt:Indicator="false"]/ ram:CategoryTradeTax/ram:CategoryCode
Test expression (assert/@test)
string-length($codeValue10)=0 or document('FACTUR-X_EN16931_codedb.xml')/codedb/cl[@id=10]/enumeration[@value=$codeValue10]