Billing period end date is before its start date

Error BR-30 EN 16931

If both Invoice line period start date (BT-134) and Invoice line period end date (BT-135) are given then the Invoice line period end date (BT-135) shall be later or equal to the Invoice line period start date (BT-134).

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 with a udt:DateTimeString in format 102, the end date is earlier than the start date. The end date must be the same as or later than the start date.

What the rule means

A billing period must be chronologically ordered: its end date cannot be earlier than its start date.

Affected fields BT-134 BT-135
Please put the billing period start and end dates in order

The end date of an invoice line’s billing period is earlier than its start date. Adjust the dates so that the end date is the same as or later.

What to do
  1. Check ram:StartDateTime and ram:EndDateTime in the billing period.
  2. Set TradeLineItem.BillingPeriodEnd to a date that is the same as or later than TradeLineItem.BillingPeriodStart.
  3. Generate the invoice again and validate it once more.
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
  • TradeLineItem.BillingPeriodStart (BT-134)
  • TradeLineItem.BillingPeriodEnd (BT-135)
Technical details

The test compares the date values of the udt:DateTimeString elements with format='102'. It also passes if either date element is absent.

Where the rule applies

The rule applies to an invoice line’s billing period in ram:BillingSpecifiedPeriod.

Context (rule/@context)
//ram:SpecifiedLineTradeSettlement/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)