End of the invoice line period

Error PEPPOL-EN16931-R111 Peppol

End date of line period MUST be within invoice period.

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

The end of the invoice line period is after the end of the invoice period in the header. The test compares the line’s udt:DateTimeString with the header date and requires the line period to end no later.

What the rule means

An invoice line’s period must end within the billing period stated in the invoice header. This keeps the line’s time coverage consistent with the invoice period.

Please keep the invoice line period from ending after the invoice period

An invoice line period ends after the invoice period stated in the header. You can resolve this by aligning the two end dates.

What to do
  1. Compare the invoice line’s ram:EndDateTime with ram:EndDateTime in the invoice header.
  2. Make sure the invoice line period does not end after the invoice period.
  3. Generate the invoice again and validate it.
What it looks like
✗ Triggers the message
<ram:BillingSpecifiedPeriod>
  <ram:EndDateTime>
    <udt:DateTimeString>2026-02-28</udt:DateTimeString>
  </ram:EndDateTime>
</ram:BillingSpecifiedPeriod>
<ram:BillingSpecifiedPeriod>
  <ram:EndDateTime>
    <udt:DateTimeString>2026-03-01</udt:DateTimeString>
  </ram:EndDateTime>
</ram:BillingSpecifiedPeriod>
✓ Correct
<ram:BillingSpecifiedPeriod>
  <ram:EndDateTime>
    <udt:DateTimeString>2026-02-28</udt:DateTimeString>
  </ram:EndDateTime>
</ram:BillingSpecifiedPeriod>
<ram:BillingSpecifiedPeriod>
  <ram:EndDateTime>
    <udt:DateTimeString>2026-02-28</udt:DateTimeString>
  </ram:EndDateTime>
</ram:BillingSpecifiedPeriod>
Technical details

The rule is evaluated for invoice lines when the invoice header contains a ram:EndDateTime. Under the XPath comparison, the line end value must be less than or equal to the header end value.

Where the rule applies

The rule applies to ram:EndDateTime in the ram:BillingSpecifiedPeriod of an invoice line when the invoice header also has a ram:BillingSpecifiedPeriod with an end date.

Context (rule/@context)
rsm:SupplyChainTradeTransaction[ram:ApplicableHeaderTradeSettlement/ram:BillingSpecifiedPeriod/ ram:EndDateTime]/ram:IncludedSupplyChainTradeLineItem/ram:SpecifiedLineTradeSettlement/ ram:BillingSpecifiedPeriod/ram:EndDateTime
Test expression (assert/@test)
udt:DateTimeString <= ../../../../ram:ApplicableHeaderTradeSettlement/ram:BillingSpecifiedPeriod/ ram:EndDateTime/udt:DateTimeString