Unit code missing for the penalty period

Error FX-SCH-A-000277 Factur-X

Attribute '@unitCode' is required in this context.

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

The required @unitCode attribute is missing from ram:BasisPeriodMeasure. Without this attribute, the unit of the specified period is not provided.

What the rule means

The penalty period must be provided together with its unit so that its duration can be understood unambiguously.

Please add the unit for the penalty period

No unit is specified for the penalty period in ram:BasisPeriodMeasure. Add the missing attribute so the duration is clear.

What to do
  1. Locate ram:BasisPeriodMeasure in the penalty terms.
  2. Add the unitCode attribute to this element.
  3. Regenerate the invoice and validate it again.
Technical details

The XPath test @unitCode checks whether the unitCode attribute is present on the current ram:BasisPeriodMeasure.

Where the rule applies

The rule applies to ram:BasisPeriodMeasure, which specifies a period in the penalty terms within the document-level payment terms.

Context (rule/@context)
/rsm:CrossIndustryInvoice/rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeSettlement/ ram:SpecifiedTradePaymentTerms/ram:ApplicableTradePaymentPenaltyTerms/ram:BasisPeriodMeasure
Test expression (assert/@test)
@unitCode