Invalid VAT type code for a charge

Error FX-SCH-A-000603 Factur-X

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

What the rule means

ram:TypeCode identifies the VAT type for the charge. A code that is not permitted cannot be classified using the designated code list.

Please use an allowed VAT type code for the charge

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

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

The test applies to charges with udt:Indicator equal to true and accepts an empty value or a value from code list cl with ID 9.

Where the rule applies

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

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