Provide exactly one form of the attribute value

Error BR-FXEXT-BR-54-2 Factur-X

Each Item attribute (BG-32) shall contain an Item attribute value (BT-161) or an Item attribute value with unit of measure (BT-X-12, with BT-X-12-0), but noth both.

Mandatory rule: As long as it is violated, the invoice is invalid and will be rejected by validators.
What is wrong

The item attribute must contain either a value in Value or a measured value in ValueMeasure with a non-empty unitCode. Both forms must not be provided at the same time.

What the rule means

The attribute value is provided either without a unit of measure or as a measured value with a unit, not in both forms at once.

Affected fields BG-32 BT-161 BT-X-12 BT-X-12-0
Please provide the item attribute value in exactly one form

Exactly one value form is required for the item attribute: a plain value or a measured value with a unit. The invoice can be corrected by providing the appropriate form.

What to do
  1. Decide whether to provide the value without a unit or as a measured value with a unit.
  2. Use ApplicableProductCharacteristic.Value for a value without a unit.
  3. Use TradeLineItem.ApplicableProductCharacteristics for the item attribute and provide a non-empty unitCode for ValueMeasure.
  4. Generate the invoice again and validate it again.
What it looks like
✗ Triggers the message
<ram:ApplicableProductCharacteristic>
  <ram:Value>Large</ram:Value>
  <ram:ValueMeasure unitCode="CMT">10</ram:ValueMeasure>
</ram:ApplicableProductCharacteristic>
✓ Correct
<ram:ApplicableProductCharacteristic>
  <ram:ValueMeasure unitCode="CMT">10</ram:ValueMeasure>
</ram:ApplicableProductCharacteristic>
Check in FactoorSharp
  • ApplicableProductCharacteristic.Value (BT-161)
  • TradeLineItem.ApplicableProductCharacteristics (BG-32)
Technical details

The XPath allows either Value without ValueMeasure, or the absence of Value together with ValueMeasure whose unitCode attribute is not empty.

Where the rule applies

The rule applies to the value fields Value and ValueMeasure of an ApplicableProductCharacteristic.

Context (rule/@context)
//ram:ApplicableProductCharacteristic
Test expression (assert/@test)
(exists(ram:Value) and not(exists(ram:ValueMeasure))) or ( not(exists(ram:Value)) and (exists(ram:ValueMeasure[@unitCode!=''])) )