Invalid charge reason code

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

The value of ram:ReasonCode with @listID="5153" is not in the permitted code list for this field. An empty value is permitted by the test condition.

What the rule means

ram:ReasonCode identifies the reason for the charge. This test validates the reason code from the code list identified by @listID="5153".

Please use an allowed `ram:ReasonCode` for the charge

The reason code for the charge on the invoice line is not allowed. You can adjust the code or leave the value empty.

What to do
  1. Locate ram:ReasonCode with @listID="5153" in the relevant ram:SpecifiedTradeAllowanceCharge on the invoice line.
  2. Check the code against the code list permitted for this field.
  3. Generate the invoice again and validate it once more.
Technical details

The test accepts an empty value or a value included in the code list with ID 30. The rule context restricts it to ram:ReasonCode[@listID="5153"].

Where the rule applies

The rule applies to ram:ReasonCode with @listID="5153" for a charge on an invoice line whose ram:ChargeIndicator has the value true.

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]