Check the invoicing period end date

Error BR-29 EN 16931

If both Invoicing period start date (BT-73) and Invoicing period end date (BT-74) are given then the Invoicing period end date (BT-74) shall be later or equal to the Invoicing period start date (BT-73).

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

When both ram:StartDateTime and ram:EndDateTime are provided as dates in format 102, the end date is earlier than the start date. If either date is missing, this ordering condition does not apply.

What the rule means

An invoicing period cannot end before it begins. The date order defines the period covered by the invoice.

Affected fields BT-73 BT-74
Please set the end date on or after the start date

The invoicing period end date is earlier than its start date. Adjust the order of the two dates if both are provided for the period.

What to do
  1. Compare the date in ram:StartDateTime with the date in ram:EndDateTime.
  2. Make sure the end date is the same as or later than the start date.
  3. Check that both date values use format 102.
  4. Regenerate the invoice and validate it again.
What it looks like
✗ Triggers the message
<ram:BillingSpecifiedPeriod>
  <ram:StartDateTime>
    <udt:DateTimeString format="102">20250110</udt:DateTimeString>
  </ram:StartDateTime>
  <ram:EndDateTime>
    <udt:DateTimeString format="102">20250109</udt:DateTimeString>
  </ram:EndDateTime>
</ram:BillingSpecifiedPeriod>
✓ Correct
<ram:BillingSpecifiedPeriod>
  <ram:StartDateTime>
    <udt:DateTimeString format="102">20250109</udt:DateTimeString>
  </ram:StartDateTime>
  <ram:EndDateTime>
    <udt:DateTimeString format="102">20250110</udt:DateTimeString>
  </ram:EndDateTime>
</ram:BillingSpecifiedPeriod>
Check in FactoorSharp
  • FacturXInvoice.BillingPeriodStart (BT-73)
  • FacturXInvoice.BillingPeriodEnd (BT-74)
Technical details

The XPath compares the date values in ram:EndDateTime/udt:DateTimeString and ram:StartDateTime/udt:DateTimeString with @format='102'. The condition also passes if either date container is absent.

Where the rule applies

The rule applies to the invoicing period ram:BillingSpecifiedPeriod in the document-level settlement. It compares the period start and end dates when both are provided.

Context (rule/@context)
//ram:ApplicableHeaderTradeSettlement/ram:BillingSpecifiedPeriod
Test expression (assert/@test)
(ram:EndDateTime/udt:DateTimeString[@format = '102']) >= (ram:StartDateTime/ udt:DateTimeString[@format = '102']) or not (ram:EndDateTime) or not (ram:StartDateTime)