Disallowed charge reason code

Error FX-SCH-A-000624 Factur-X

Value of 'ram:ReasonCode[not (@listID)]' 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 non-empty value in ram:ReasonCode without the @listID attribute is not included in the code list defined for the charge reason. An empty value also passes this specific check.

What the rule means

ram:ReasonCode identifies the reason for the charge. For this check, a non-empty value without @listID must come from the code list defined for it.

Please use an allowed code for the charge reason without listID

The code in ram:ReasonCode for the invoice line’s charge is not included in the code list defined for it. This check applies to ram:ReasonCode without the @listID attribute.

What to do
  1. Check ram:ReasonCode for the charge on the affected invoice line.
  2. Check the value of ram:ReasonCode without @listID against the codes allowed for it.
  3. Generate the invoice again and validate it again.
Technical details

The context restricts the check to SpecifiedTradeAllowanceCharge where ChargeIndicator is true and ram:ReasonCode has no @listID. An empty value or a value from codedb/cl[@id=12]/enumeration is accepted.

Where the rule applies

The rule applies to ram:ReasonCode without listID for a charge on an invoice line.

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