Invalid charge reason code

Error FX-SCH-A-001036 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 not included in the permitted code list for this field. The test also accepts an empty value.

What the rule means

The reason for the charge must match an allowed code from the designated code list. The code assigns the charge a standardized reason.

Please provide an allowed reason code for the charge

The charge reason code is not in the code list permitted for listID="5153". Use an allowed code or leave the value empty.

What to do
  1. Locate ram:ReasonCode with listID="5153" in the charge under ram:GrossPriceProductTradePrice.
  2. Replace the value with a code allowed by the code list, or leave the value empty.
  3. Generate the invoice again and validate it again.
Technical details

The test checks whether the text value of ram:ReasonCode is empty or appears as an enumeration in code list 22. The context restricts the element to listID="5153".

Where the rule applies

The rule applies to ram:ReasonCode with listID="5153" on an allowance/charge element marked as a charge within an invoice line’s gross price.

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