Invalid reason code from code list 5153

Error FX-SCH-A-000390 Factur-X

Value of 'ram:ReasonCode[@listID="5153"]' 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:ReasonCode with listID="5153" is neither empty nor included in the corresponding Factur-X code list. The specified reason code is therefore not allowed.

What the rule means

The reason code describes the reason for the allowance. Using an allowed code from the specified list enables standardized transmission.

Please check the allowance’s reason code from list 5153

The allowance’s reason code is not recognized as an allowed value from the specified code list. You can compare it with list 5153.

What to do
  1. Locate ram:ReasonCode on the allowance and check that it has listID="5153".
  2. Check whether its value is included in the corresponding code list.
  3. Generate the invoice again and validate it once more.
Technical details

The test accepts an empty value or a value present in code list 47 in FACTUR-X_EXTENDED_codedb.xml. The context restricts the element to listID="5153".

Where the rule applies

The rule applies to ram:ReasonCode with the attribute listID="5153" on a document-level allowance.

Context (rule/@context)
/rsm:CrossIndustryInvoice/rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeSettlement/ ram:SpecifiedTradeAllowanceCharge[ram:ChargeIndicator/udt:Indicator="true"]/ ram:ReasonCode[@listID="5153"]
Test expression (assert/@test)
string-length($codeValue47)=0 or document('FACTUR-X_EXTENDED_codedb.xml')/codedb/cl[@id=47]/enumeration[@value=$codeValue47]