5 Working with SAFT-PT XML

This chapter contains the following topics:

5.1 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 applicable for 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 on http://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 Portuguese Tax Authority published Administrative Rule no. 302/2016 XML Format (Doc ID 2275987.1)

5.2 Setting Up UDCs to Generate SAFT-PT XML

This section discusses the UDCs that you set up to generate SAFT-PT XML.

5.2.1 JE Transaction Type (74L/JT)

Set up the JE Transaction Type UDC table (74L/JT) to map the JE document type to the legal SAFT values.

You set up a JE Transaction Type (74L/JT) by associating it to a special handling code. The SAFT values are stored in the special handling code. For example, you set up the UDC value AE using the special handling code J:

UDC Codes Description Special Handling
AE Adjustment transactions J

The following SAFT values are stored in the special handling code.

SAFT Values Description
R Regularizations in the taxation period
A Results assessment
J Adjustment transactions

5.2.2 Invoice Type (74L/IT)

Set up the Invoice Type UDC table (74L/IT) to map the internal invoice document type to the legal SAFT document type. The system uses this value to generate the SAFT-PT XML.

You define the Invoice Type (74L/IT) by mapping to a special handling code. The SAFT values are stored in the special handling code. For example, you set up the UDC value PI using the special handling code FT:

UDC Codes Description Special Handling
PI Imported Invoices FT

The following SAFT values are stored in the special handling code.

SAFT Values Description
FT  Invoice
ND Debit note
NC Credit note
VD Sale for cash and invoice/sales ticket
TV Sale ticket
TD Devolution ticket
AA Assets alienation
DA Assets devolution
RP Premium or premium receipt
RE Return insurance or receipt of return insurance
CS Imputation to co-insurance companies
LD Imputation to a leader coinsurance company
RA Accepted re-insurance

5.2.3 Ledger Types - SAFT Reporting (74L/LT)

Set up the Ledger Types - SAFT Reporting UDC table (74L/LT) to specify the additional ledger types that you need to report in the SAFT-PT reporting. You use the mandatory ledger type AA in SAFT-PT reporting.

Values are:

Codes Description
AA General Ledger. This ledger type is a hardcoded value.
AZ Cash Basis
CA Foreign Currency

5.2.4 Product Type (74L/PT)

Select a hard-coded value from the 74L/PT UDC table when you set up the product type in the Item Master Additional Information program (P704101).

Values are:

Codes Description
E Special Consumption Taxes
I Taxes
O Others
P Products
S Services

5.2.5 Taxonomy Reference (74L/TA)

Select a hard-coded value from the 74L/TA UDC table to set up the taxonomy reference code required for the SAFT-PT reporting.

Values are:

Codes Description
S SNC Base Accounts - Taxonomy S
N Interntnl Acc Rules-Taxonomy S
M SNC Microentities - Taxonomy M
O No Taxonomy Coded

5.2.6 Taxonomy Code for Taxonomy S (74L/TB)

Select a value from the 74L/TB UDC table to specify the taxonomy code for the taxonomy reference codes S and N, as required by the Portuguese tax authorities.

The taxonomy codes for taxonomy reference codes S and N are described in Law 302/2016 - Anexo II.

5.2.7 Taxonomy Code for Taxonomy M (74L/TO)

Select a value from the 74L/TO UDC table to specify the taxonomy code for the taxonomy reference code M, as required by the Portuguese tax authorities.

The taxonomy codes for taxonomy reference code M are described in Law 302/2016 - Anexo III.

5.3 Working with the SAFT-PT Report

This section lists the prerequisites and discusses how to:

  • Set up processing options for SAFT Extractor

  • Generate the SAFT-PT report

5.3.1 Prerequisites

Before you generate the SAFT-PT report:

  • Verify that the taxpayer ID is assigned for the customers and suppliers. Verify that the taxpayer ID is stored in the Tax ID field of the Address Book Master table (F0101).

  • Verify that the G/L Date of the journal entries and source documents matches the period specified in the processing options Period Start Date and Period End Date of the SAFT Extractor program (R74L3001).

  • Verify that when a generic customer is used (for example, for counter sales customers) the name must be Consumidor final and the taxpayer ID must be 999999990.

  • Verify that the following information is set up:

    • The product type and product group in the Item Master Additional Information program (P704101).

      You also specify the UDCs Product Type (74L/PT) and the Product Group (74L/PG) in the processing options of the Item Master Additional Information program. Verify that the version of the Item Master Additional Information program is the same as the version of the Item Master program (P4101) used.

      Figure 5-1 Item Master Additional Information Program - Processing Option

      Description of Figure 5-1 follows
      Description of ''Figure 5-1 Item Master Additional Information Program - Processing Option''

    • The chart of accounts responsible in the Referential Chart of Accounts program (P74L920) and the Accounts Mapping program (P74L921).

      See "Understanding Charts of Accounts".

    • The self billing indicator in the Address Book Additional Information program (P74L101).

      Select 1 from the Billing Indicator (74L/BI) UDC value if the self billing agreement exists. Otherwise, select 0. The Address Book Additional Information program (P74L101) provides the additional regional information of the Address Book program (P01012).

    • The tax types, tax country region, and tax code in the Tax Rate/Area Additional Information program (P74L4008).

      The Tax Rate/Area Additional Information program (P74L4008) provides the additional regional information of the Work With Tax Rate/Areas program (P4008).

      See "Understanding Tax Rate/Area Additional Information for Portugal"

5.3.2 Form Used to Generate SAFT-PT

Form Name Form ID Navigation Usage
SAFT Extractor (R74L3001) W98305WD SAFT-PT (G74LSAFT), SAFT Extractor Extracts the required information and produces the intermediate XML file.

5.3.3 Setting Processing Options for SAFT Extractor (R74L3001)

Before you generate the SAFT-PT report, you set the processing options for the SAFT Extractor program (R74L3001).

5.3.3.1 General

1. Audit File Version

Specify the version of XML Schema that the system uses for the SAFT-PT reporting. It can be found at http://www.portaldasfinancas.gov.pt

2. Work Type

Specify the work type to be exported in the XML file.

5.3.3.2 Process

1. Accounting System

Specify the accounting system that the system uses for reporting the SAFT-PT. Certain sections of the SAFT -PT report are generated based on this processing option. Values are:

  • C: Accounting

  • E: Billing, Shipping and Working Documents Issued By Others

  • F: Invoicing

  • I: Integrated Invoices and Accounts

  • S: Self Billing

  • P: Partial Data

2. Integrated Accounting Invoicing

Enter 1 if you want the accounting system to produce invoicing and accounting integrated data. This processing option is applicable only when the value of the Accounting System processing option is P (Partial Data).

3. Period Start Date

Specify the start date of the period for which the system generates the SAFT-PT report.

4. Period End Date

Specify the end date of the period for which the system generates the SAFT-PT report.

5. Taxonomy Reference

Specify the taxonomy reference required for generating the SAFT-PT report. Only those accounts entered in the Referential Chart of Accounts program (P74L920) based on the taxonomy reference selected will be exported in the general ledger section of the XML file.

6. WO Status From

Specify the start range of service work order status that the system uses to select service work orders to generate the SAFT-PT report. The value that you specify must exist in the Work Order Status UDC table (00/SS). The values in the 00/SS UDC table describe the status of a work order, rate schedule, or engineering change order.

7. WO Status To

Specify the end range of service work order status that the system uses to select service work orders to generate the SAFT-PT report. The value that you specify must exist in the Work Order Status UDC table (00/SS). The values in the 00/SS UDC table describe the status of a work order, rate schedule, or engineering change order.

8. Part List Material Status

Specify the material status from the Material Status UDC table (31/MS) for which the system generates the SAFT-PT report.

5.3.3.3 Company

1. Legal Company

Specify the legal company code of the company.

2. Commercial Registry Office

Specify the name of the Commercial Registry Office.

3. Commercial Registration Number

Specify the Commercial Registration Number allotted by the Commercial Registry Office.

5.3.3.4 Software Provider

1. Software Provider Address Number

Specify the address book number of the software provider.

5.3.3.5 Default

1. Enter the Item Number to be used for the A/R invoices without sales information.

Specify the item number the system uses for the A/R invoices without sales information.

5.3.4 Generating the SAFT-PT Report

To generate the SAFT-PT report, select SAFT-PT (G74LSAFT), SAFT Extractor from the menu.

You run the SAFT -PT Extractor program (R74L3001) to generate the SAFT-PT report. When you run the SAFT -PT Extractor program, the system validates and generates the SAFT-PT XML file.

The JD Edwards EnterpriseOne system populates three sections of the SAFT-PT report:

  1. Sales Invoices

  2. Movement of Goods

  3. Working Documents

If there is an error, the system terminates the extraction and generates a PDF listing the errors. The system also lists the errors in the Work Center.

The R74L3001 program prints the working document details for the service work orders that are marked as payable and issued. The program includes only the service work orders that you have selected based on the work order status date range and part list material status specified in the processing options.


Note:

The JD Edwards EnterpriseOne software only encrypts the Commercial Invoice and Shipping documents since these are the only document types that are certified. You must not print working documents such as packing slips because they are not encrypted and certified.

5.4 Understanding the Portugal Legal Number Requirement

Taxpayers are required to submit information related to shipping documents issued to the tax authorities in order to obtain an identification code for each transaction reported. The identification code must be obtained before shipping the goods.

The following illustration describes the sales order process.

Figure 5-2 Process Flow for Sales

Description of Figure 5-2 follows
Description of ''Figure 5-2 Process Flow for Sales''

To obtain the AT identification code for transportation documents:

  1. Create the sales order in the standard Sales Order Entry program (P4210).

  2. Confirm that the goods are ready for shipping using the Confirm Shipment program (P4205).

    1. Print shipping documents using the Legal Shipping Document Print - Portugal report (R74L3035).

    2. Extract information related to the shipping documents using the Movement of Goods Extract report (R74L3002).

    3. You submit information related to the shipping documents to the tax authority.

    4. You receive the response XML file from the tax authority.

    5. Parse the response XML file to extract the AT identification code for approved transactions using the Parse XML Response report (R74L3003).

    6. Update the legal document number and transmission status in the Exported Transactions File table (F74L3002).

    7. Print the AT identification code in the invoices using the Reprint Legal Document program (P7430031).

  3. Print the invoice for the customer using the Print Legal Documents from Sales Orders program (P7420565).

  4. Run the Sales Update program (R42800) to record and maintain accurate records.

5.5 Working with the Movement of Goods Extract Report (R74L3002)

You generate the Movement of Goods Extract report (R74L3002) to retrieve data for the transactions related to the shipping documents. You can submit the information to the tax authorities to obtain the AT identification code for each transaction reported.

5.5.1 Setting Processing Options for the Movement of Goods Information Extract Report (R74L3002)

Processing options enable you to specify the default processing for programs and reports.

5.5.1.1 General

1. Audit File Version

Specify the version of XML Schema to be used for the SAFT-PT reporting. It can be found at http://www.portaldasfinancas.gov.pt

5.5.1.2 Process

1. Accounting System

Specify the accounting system to be used for reporting transactions related to shipping documents. Certain sections of the Movement of Goods Extract report are generated based on this processing option. Values are:

  • C: Accounting

    The transactions related to shipping documents are not included in the report when you specify this value in the processing option.

  • E: Billing, Shipping, and Working Documents Issued By Others

  • F: Invoicing

  • I: Integrated Invoices and Accounts

  • S: Self Billing

  • P: Partial Data

2. Integrated Accounting Invoice

Enter 1 if you want the accounting system to produce invoicing and accounting integrated data. This processing option is applicable only when the value of the Accounting System processing option is P (Partial Data).

3. Period Start Date

Specify the start date of the period for which you need to generate the Movement of Goods Extract report.

4. Period End Date

Specify the end date of the period for which you need to generate the Movement of Goods Extract report.

5. Include Processed Transactions

Specify whether you want to include the processed transactions in the report. Processed transactions are the transactions that are available in the Exported Transaction File table (F74L3002) and do not have a value in the ATDocCodeID field.

5.5.1.3 Company

1. Legal Company

Specify the legal company code.

2. Commercial Registry Office

Specify the name of the Commercial Registry Office.

3. Commercial Registration Number

Specify the Commercial Registration Number allotted by the Commercial Registry Office.

5.5.1.4 Software Provider

1. Software Provider Address Number

Specify the address book number of the software provider.

5.5.1.5 Default

1. Enter the Item Number to be used for the A/R invoices without sales information.

Specify the item number to be used for the A/R invoices without sales information.

5.5.2 Generating the Movement of Goods Information Extract Report

Select Portugal Localization module (G74L), SAFT - Shipping Documents, Shipping Documents Information Extract (R74L3002).

The system retrieves information for the relevant transactions and stores that information in the Exported Transactions File table (F74L3002). The value for the Transaction Status field in the table is set to Submitted for all transactions included in the report.

5.6 Working with the Parse XML Response Report (R74L3003)

You generate the Parse XML Response report (R74L3003) to retrieve information from the response XML file you have received from the tax authority. The response XML file contains information about transactions related to shipping documents that you submitted previously to the tax authority. The tax authority can approve or reject a transaction and provide a value for the ATDocCodeID field for each approved transaction.

5.6.1 Setting Processing Options for the Parse XML Response Report (R74L3003)

Processing options enable you to specify the default processing for programs and reports.

Response XML Path

Specify the location of the response XML file from which you want to retrieve information.

Legal Company

Specify the name of the company for which you want to run the report.

5.6.2 Generating the Parse XML Response Report (R74L3003)

Select Portugal Localization module (G74L), SAFT - Shipping Documents, Parse XML Response (R74L3003).

The system retrieves the information from the response XML file and updates the Exported Transaction File table (F74L3002) with the ATDocCodeID, Job ID, Transaction Status, and Job Process Date for each transaction.

5.7 Reprinting Invoices

Use the Reprint Legal Document program (P7430031) to reprint selected documents. When you reprint a document, the system prints the same legal number as was used on the original legal document. When you select to reprint, the system verifies whether the record is included in the Legal Document Header table (F7430030). If the record is not in the F7430030 table, the system adds the record to the table as well as to the Legal Document Detail table (F7430032).

You must reprint the invoices to include the AT identification code received for transactions related to the shipping documents.

5.7.1 Reprinting an Invoice

Select Portugal Localization module (G74L), SAFT - Shipping Documents, Reprint Legal Document.

Alternatively, you can click Legal Doc Reprint on the Form menu in the Work With Exported Transactions program (P74L3002) to reprint invoices.

5.8 Reviewing the Exported Transactions Information

You use the Work With Exported Transactions program (P74L3002) to view information about transactions related to the movement of goods that are submitted to the tax authority.

Complete the following steps to view the details of the exported transactions:

  1. Select Portugal Localization module (G74L), SAFT - Shipping Documents, Shipping Documents Status.

  2. Complete the header section, and then click Search.

  3. Review the transaction details available in the grid.

5.9 Deleting Exported Transactions Information

You use the Work With Exported Transactions program (P74L3002) to delete information about transactions related to the movement of goods that are submitted to the tax authority. Transactions that have a value in the ATCodeDocID field cannot be deleted.

Complete the following steps to delete information of the exported transactions:

  1. Select Portugal Localization module (G74L), SAFT - Shipping Documents, Shipping Documents Status.

  2. Complete the header section, and then click Search.

  3. Select the transaction you want to delete from the grid, and then click Delete.

    The system deletes the transaction after confirmation.