Invalid reason code for a charge

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

A non-empty value in this ram:ReasonCode is not included in the designated value list. An empty value passes this check.

What the rule means

ram:ReasonCode states the reason for the charge. In this case, the code is checked against the value list for listID 5153.

Please use an allowed reason code for the charge

The reason code for the charge on the invoice line is not in the designated value list for listID 5153. Using an allowed code will satisfy this check.

What to do
  1. Check ram:ReasonCode for the charge whose ram:ChargeIndicator has the value true.
  2. For a non-empty value, use an entry from the value list for listID 5153.
  3. Generate the invoice again and validate it.
Technical details

The test permits an empty code value; otherwise, it checks the value against the enumeration in code list 30.

Where the rule applies

The rule applies to ram:ReasonCode of a charge on an invoice line where ram:ChargeIndicator has the value true and listID has the value 5153.

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