Technology Blog Posts by SAP
cancel
Showing results for 
Search instead for 
Did you mean: 
elsa_martins
Product and Topic Expert
Product and Topic Expert
535

 

(Source: Video created by IA google NotebookLM)

Hello everyone.

This guide breaks down the blueprint for achieving compliance inside your system - starting with the foundation and moving through the critical layers of validation required to ensure a perfect, unbreakable match between the invoice your customer holds, and the data reported to the government via the Saft PT (digital audit file). Any discrepancy between those two records is an immediate red flag.

Phase 1: The Foundation – Sequential Numbering (The Document's DNA)

To achieve that necessary "perfect match", everything must start with the document number, which acts as the entire compliant invoice’s foundation. This is not a random reference but a "super structured system".

Compliance demands that you treat this foundation with extreme rigidity:

  1. Strict Separation: You must "absolutely have separate number ranges" for different document types, including invoices, credit memos, and even reversals. These document types cannot share ranges.
  2. Chronological Order: The system ensures every document has a unique sequential number that follows in strict chronological order.
  3. Series Retirement: A Series (e.g., B001) must be defined for "at least a year," and once used, it is "retired forever".

If this numbering foundation, which the source describes as the document’s "unique DNA," is flawed, the entire compliant structure "falls apart", and the crucial digital signature simply won't work.

Phase 2: Layered Validation

Once the foundational numbering is in place, we add the two critical layers of official validation: the ATCUD and the Digital Signature.

Validation 1: The ATCUD (The Official Passport Number)

The ATCUD (Unique Document Code) is the first layer of official validation. You can think of it as your document's "official passport number," issued and recognized by the government.

The ATCUD’s simple purpose is to provide a "single unique identifier" recognized by the tax authority before the document is even finalized. It directly links your internal document series to the government's records.

How to Build the ATCUD:

  1. Register the Series: You register your document series (e.g., B001) with the tax authority.
  2. Receive the Code: The AT gives you back a unique validation code for that registered series.
  3. Final Construction: The final ATCUD is the validation code "stuck together with your document sequential number".

Validation 2: The Digital Signature (The Cryptographic Seal)

While the ATCUD identifies the document series (answering, "What document is this?"), the digital signature guarantees integrity (answering, "Is this document valid and has it been altered?"). You absolutely need both.

The digital signature is a "complex cryptographic hash" that seals the document and proves its authenticity. It works by chaining every document together.

Key data from the invoice—including the document number, date, total amount, and, crucially, the signature of the previous document—is fed into an algorithm. This process creates a unique signature that links each document to the one before it, making it "impossible to alter or delete a document without breaking the entire chain".

Phase 3: The Final Walkthrough – Layout and Presentation

Building the data components is only half the battle; Portuguese law is "just as strict" about how the information is "actually presented on the page". The final printed document has its own set of "non-negotiable rules".

Your final compliant invoice must visibly include:

  • The Specific Document Number Format: This must be a specific three-part format that is not just your internal system number.
  • The ATCUD: This code "has to be on every single page".
  • The QR Code Relationship: The ATCUD must be printed "directly above the QR code" with "absolutely zero space in between". The QR code itself must be located on either the first or the last page.
  • Mandatory Legal Phrase: Every document must include a precise legal phrase, such as "Processed by certified program number 2563/AT," which serves as a declaration that the invoice was generated by legally certified software. The number 2563 is the official certification number the AT gave to SAP S/4HANA.
  • Pagination: Page numbering must use the mandatory "page one of N format".

If you miss any one of these items, the final document fails inspection.

Compliance Checklist and Final Considerations

To ensure you have covered all the essential ground, here is a rapid-fire checklist of the absolute non-negotiables:

  • Correct number ranges are the essential foundation.
  • The ATCUD and the digital signature provide the necessary validation.
  • The layout must be perfect and match the SFTPT data exactly.
  • A critical regulation: You cannot have negative postings in Portugal; all corrections must be made through "proper credit memos".

Finally, remember that regulations cover data consistency over time. Ongoing data governance is necessary to ensure that if you reprint an old invoice, it still displays the original, correct data (like the customer's original address).

Hope you enjoyed this explanation. Feel free to share your thoughts in the Comments!

 

2 Comments