# PEPPOL-EN16931-R111

Source: https://xmlvalid.com/rules/PEPPOL-EN16931-R111

> End date of line period MUST be within invoice period.

- Level: error
- Rule sets: Peppol BIS Billing 3.0 rules 3.0.21, XRechnung 3.0 rules (UBL) 2.6.0
- Context: `ubl-invoice:Invoice[cac:InvoicePeriod/cbc:EndDate]/cac:InvoiceLine/cac:InvoicePeriod/cbc:EndDate | ubl-creditnote:CreditNote[cac:InvoicePeriod/cbc:EndDate]/cac:CreditNoteLine/cac:InvoicePeriod/cbc:EndDate`
- Test: `xs:date(text()) <= xs:date(../../../cac:InvoicePeriod/cbc:EndDate)`

> End date of line period MUST be within invoice period.

- Level: error
- Rule sets: XRechnung 3.0 rules (CII) 2.6.0
- Context: `rsm:SupplyChainTradeTransaction[ram:ApplicableHeaderTradeSettlement/ram:BillingSpecifiedPeriod/ram:EndDateTime]/ram:IncludedSupplyChainTradeLineItem/ram:SpecifiedLineTradeSettlement/ram:BillingSpecifiedPeriod/ram:EndDateTime`
- Test: `udt:DateTimeString <= ../../../../ram:ApplicableHeaderTradeSettlement/ram:BillingSpecifiedPeriod/ram:EndDateTime/udt:DateTimeString`

Validate a document against these rules: https://xmlvalid.com/validate
