FATTURAPA-IT-00404: SdI Error 00404: Duplicate invoice number and date combination already registered in Sistema di Interscambio
This rule enforces the uniqueness of the invoice number (BT-1) combined with the invoice issue date (BT-2) within the Italian Sistema di Interscambio (SdI). The context XPath selects the Numero element (BT-1) inside DatiGeneraliDocumento. The Schematron test normalize-space(Numero) != "" ensures the invoice number is not empty or whitespace-only. However, the official assertion message indicates a duplicate check: SdI rejects invoices where the same combination of invoice number and date has already been registered. This is a stateful validation performed by the SdI, not purely by the XPath. The XPath test itself only checks for non-empty Numero, but the rule code FATTURAPA-IT-00404 is associated with the duplicate detection error. In the context of EN 16931 and Peppol BIS Billing 3.0, BT-1 (Invoice number) and BT-2 (Invoice issue date) must be present and together form a unique identifier for the invoice. The SdI enforces this uniqueness across all invoices submitted by a given supplier. The Schematron rule as given is a simplified representation; the actual duplicate check is performed by the SdI backend. For developer documentation, it is crucial to understand that this rule triggers when the invoice number is empty (which would also cause a duplicate if multiple empty numbers are sent) or when the SdI detects a duplicate combination. The XPath evaluation context is the Numero element, and the test ensures it has non-whitespace content. If the test fails (i.e., Numero is empty), the error 00404 is raised, but the message about duplicate is misleading; however, in practice, an empty number would be rejected with a different error. The rule is fatal, meaning the invoice is rejected.
1. Ensure that the invoice number (BT-1) is always populated with a non-empty, non-whitespace value. 2. Verify that the combination of invoice number and invoice date (BT-2) has not been used in any previously submitted invoice to the SdI for the same supplier VAT number. 3. If resubmitting a corrected invoice, use a new unique invoice number or ensure the original submission was not accepted. 4. Implement client-side validation to check for empty or whitespace-only invoice numbers before sending to SdI. 5. For duplicate detection, maintain a local database of previously sent invoice numbers and dates per supplier to avoid duplicates. 6. Note that the SdI performs the duplicate check; the Schematron rule provided is a simplified check for non-empty number, but the error code 00404 is specifically for duplicates. Therefore, also ensure that the invoice number is unique per supplier and date.
Input does not contain a valid OASIS UBL 2.1 <Invoice> or UN/CEFACT <rsm:CrossIndustryInvoice> root element.
fix: Ensure payload is valid UBL 2.1 or CII D16B XML, or drop an uncompressed ZUGFeRD/Factur-X PDF/A-3.