KSEF-PL-P1-DATE: KSeF Invoice Issue Date (Fa/P_1) must conform to YYYY-MM-DD and cannot exceed session submission timestamp
This rule enforces the Polish KSeF (Krajowy System e-Faktur) specific requirement for the invoice issue date (P_1) in the FA(2) format. The context XPath /Faktura/Fa/P_1 selects the P_1 element, which corresponds to BT-2 (Invoice issue date) in EN 16931. The test xs:date(P_1) <= current-date() checks that the value of P_1, when cast to xs:date, is less than or equal to the current date (the date of validation, which approximates the session submission timestamp). The rule triggers if the cast fails (e.g., invalid date format) or if the date is in the future. The severity is fatal, meaning the invoice is rejected. Note: The official assertion message mentions YYYY-MM-DD format, but the XPath test only checks the date value; format compliance is enforced by the underlying XML Schema (xs:date). However, the test will fail if P_1 is not a valid xs:date, which includes format errors. The rule is specific to KSeF and does not appear in standard EN 16931 or Peppol BIS.
1. Ensure that the P_1 element contains a date value in the format YYYY-MM-DD (e.g., 2023-10-15). Do not include time or timezone information. 2. Verify that the date is not later than the current date at the time of invoice submission to KSeF. If the invoice is generated in advance, adjust the date to the actual issue date or the submission date. 3. If using a library to generate the XML, configure it to output xs:date without time component. 4. Validate the invoice against the KSeF FA(2) schema and Schematron rules before submission to catch such errors early.
KSeF XSD rejects NIP "MISSING". Country prefixes ("PL") and hyphens are forbidden.
fix: Normalize <NIP> to 10 digits: <NIP>1111111111</NIP>.