Allowed VAT type code for the allowance

Error FX-SCH-A-000519 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 in ram:TypeCode in the VAT information for the allowance is neither empty nor included in the code list used by this rule.

What the rule means

If provided, the VAT type for the allowance must match an allowed code. The rule concerns an allowance because ram:ChargeIndicator has the value false, and it also accepts an empty value.

Please use an allowed VAT type code for the allowance

This rule does not recognize the value in ram:TypeCode for the allowance as allowed. You can use a value from the applicable code list or leave the value empty.

What to do
  1. Check ram:TypeCode in the VAT information for the allowance.
  2. Use an entry from the applicable code list or leave the value empty.
  3. Regenerate the invoice and check it again.
Technical details

The test selects ram:SpecifiedTradeAllowanceCharge with ram:ChargeIndicator equal to false and accepts an empty value or an entry from FACTUR-X_BASIC_codedb.xml, code list 7.

Where the rule applies

The rule applies to ram:TypeCode in the VAT information for a document-level allowance. It applies when ram:ChargeIndicator has the value false.

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