Use exactly one value representation for the item attribute

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 may contain either ram:Value or ram:ValueMeasure, but not both. If ram:ValueMeasure is used, its unitCode attribute must also have a non-empty value.

What the rule means

The value must be represented unambiguously either as a simple value or as a value with a unit of measure. A measure without a populated unit code is incomplete.

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

Both value forms are provided for an item attribute, or the measure has no unit code. You can use either a simple value or a value with a unit of measure.

What to do
  1. Keep either ram:Value or ram:ValueMeasure for the item attribute.
  2. If you use ram:ValueMeasure, provide a value for its unitCode attribute.
  3. If you use the ApplicableProductCharacteristic.Value property, check the value it supplies.
  4. Regenerate the invoice and validate it again.
What it looks like
✗ Triggers the message
<ram:ApplicableProductCharacteristic>
  <ram:Value>10</ram:Value>
  <ram:ValueMeasure unitCode="">10</ram:ValueMeasure>
</ram:ApplicableProductCharacteristic>
✓ Correct
<ram:ApplicableProductCharacteristic>
  <ram:ValueMeasure unitCode="KGM">10</ram:ValueMeasure>
</ram:ApplicableProductCharacteristic>
Check in FactoorSharp
  • ApplicableProductCharacteristic.Value (BT-161)
  • TradeLineItem.ApplicableProductCharacteristics (BG-32)
Good to know

ram:Value contains a simple value; ram:ValueMeasure contains a value with a unit of measure.

Technical details

The XPath permits either ram:Value without ram:ValueMeasure, or ram:ValueMeasure without ram:Value and with a non-empty unitCode attribute.

Where the rule applies

This rule applies to the value fields of an item attribute ram: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!=''])) )