Understanding SAFT-PT

The Standard Audit File for Tax Purposes - Portuguese version (SAFT-PT) is a standardized XML file used for exporting the accounting information of a company to the tax authorities. SAFT-PT complies with the Portuguese law of a directive from the Organization for Economic Co-operation and Development (OECD) and is applied to all information registered after January 1, 2008. The system generates the SAFT-PT report in a normalized format for XML documents, complying with the SAFT-PT.xsd validation schema available onhttp://www.portaldasfinancas.gov.pt.

The system generates the SAFT-PT XML using the following steps:

  • The SAFT-PT Extractor program (R74L3001) extracts the required information and produces the intermediate XML.

  • The Business Intelligence Publisher (BIP) XSL transformation and report definition converts the intermediate XML to the legal SAFT-PT XML.

See Portugal SAF-T XML Mappings (Doc ID 2308107.1) .

(Release 9.2 Update 26) Portuguese regulatory requirements require specific sensitive information in the SAF-T XML file to be encrypted and require SHA-256 checksum validation for the file.

After generating the SAF-T XML using the SAFT Extractor program (R74L3001), you can use the SAFT Encryption and Hash Generation program (R74L3004) to:

  • Convert the SAF-T XML to its canonical form.
  • Generate a SHA-256 hash for the original XML.
  • Encrypt the sensitive XML elements using AES-128 encryption in Counter (CTR) mode.

The process generates an encrypted SAF-T XML file and a separate text file containing the SHA-256 hash. These files can be used for submission to the Portuguese tax authority.

Note: Before running R74L3004, use the SAFT Encryption Setup program (P74L3003) to enter the AES key and initialization vector (IV) provided by the Portuguese government.
Note: The SAF-T encryption feature is available with Tools Release 9.2.26.6 or later.