You are on page 1of 58

How to guide – Portuguese legislation

How to guide

Portuguese legislation
Version 1
March 2015
How to guide – Portuguese legislation

Contents

OVERVIEW....................................................................................................................................... 1

BEFORE YOU BEGIN .................................................................................................................. 2

Technical prerequisites ............................................................................................................................ 2

POR VAT ........................................................................................................................................... 3

Setup............................................................................................................................................................ 3

Relevant transactional data ..................................................................................................................... 7

Generating the VAT declaration ............................................................................................................. 8

Managing the VAT declaration ................................................................................................................ 8

CASH FLOW .................................................................................................................................. 10

Description ............................................................................................................................................... 10

Prerequisites ............................................................................................................................................ 10

Setup.......................................................................................................................................................... 10

Previous recommendations before execution ................................................................................... 11

Data extraction ......................................................................................................................................... 12

P-CASHFLO report .................................................................................................................................. 13

CAPITAL FLOW REPORT ........................................................................................................ 14

Description ............................................................................................................................................... 14

Prerequisites ............................................................................................................................................ 14

Process in Sage ERP X3 ........................................................................................................................ 15

IES ..................................................................................................................................................... 16

Description ............................................................................................................................................... 16
How to guide – Portuguese legislation

Setup.......................................................................................................................................................... 16

Process in Sage ERP X3 ........................................................................................................................ 22

NUMBER OF DOCUMENT COPIES ...................................................................................... 23

Description ............................................................................................................................................... 23

Prerequisites ............................................................................................................................................ 23

Setup.......................................................................................................................................................... 23

INTRASTAT ................................................................................................................................... 25

Description ............................................................................................................................................... 25

Prerequisites ............................................................................................................................................ 25

Process in Sage ERP X3 ........................................................................................................................ 26

CASH VAT ...................................................................................................................................... 27

Description ............................................................................................................................................... 27

Setup.......................................................................................................................................................... 28

Relevant transactional data ................................................................................................................... 29

Process in Sage ERP X3 ........................................................................................................................ 29

Functions excluded from the process ................................................................................................. 31

ELECTRONIC SIGNATURE AND SOFTWARE CERTIFICATION ............................. 32

Description ............................................................................................................................................... 32

Setup.......................................................................................................................................................... 33

SAFT-PT CONFIGURATION .................................................................................................... 35

Setup.......................................................................................................................................................... 35

Process in Sage ERP X3 ........................................................................................................................ 40

SAFT GENERATION .................................................................................................................. 42

Setup.......................................................................................................................................................... 42

Process in Sage ERP X3 ........................................................................................................................ 42


How to guide – Portuguese legislation

LAW 50001 ..................................................................................................................................... 44

Description ............................................................................................................................................... 44

Prerequisites ............................................................................................................................................ 44

Default “final consumer” (LEGETT) and fiscal number mandatory


(EECNUM) ................................................................................................................................................. 44

Modification of the business partner’s fiscal number ...................................................................... 45

Modification of the product description .............................................................................................. 45

Sales credit notes .................................................................................................................................... 46

TRANSPORT NOTES ................................................................................................................. 48

Description ............................................................................................................................................... 48

TRANSPORT COMMUNICATION .......................................................................................... 49

Description ............................................................................................................................................... 49

Process in Sage ERP X3 ........................................................................................................................ 51

FAQ ................................................................................................................................................... 54

What is a global document? .................................................................................................................. 54

What is a manual document? ................................................................................................................ 54

What is the transport code? .................................................................................................................. 54


How to guide – Portuguese legislation

Overview
This document describes Portuguese localization for Sage ERP X3,
including how to set up and use EU VAT specific rules for
Portugal:

 VAT is charged on most goods and services provided in Portugal and


Europe.
 Companies can generally claim the VAT that they have paid on purchases.
 Sage ERP X3 calculates the VAT for Portugal, including price discounts
(VAT is calculated after the discount).
 VAT rates in mainland Portugal are different than those in the Azores and
Madeira.
 You can generate and submit the periodic and annual VAT declarations,
along with the Informação Empresarial Simplificada (IES) declaration, to the
government.

1/54
How to guide – Portuguese legislation

Before you begin


Technical prerequisites
Before you can calculate VAT for Portugal, you must: Related activity code
 KPO (Portuguese localization)
 Activate POR legislation.
 Activate the KPO - Portuguese localization activity code.

2/54
How to guide – Portuguese legislation

Related functions
POR VAT  GESDVPT (Tax codes)
 FUNFLDREN (VAT
regularization reason)
Setup  GESPDM (Balance transfer
validation function)
Setting up companies  GESCOA (Chart of accounts)
 In the Companies function, click Legal data to open the Portuguese legal
data screen. Enter your data in the fields.

 Activate the PORVAT - VAT portuguese general parameter (LOC chapter,


Related parameters
POR group).  PORVAT (TVA portuguese)
 The PORVATREG - VAT regularization reason general parameter (LOC  PORVATREG (VAT
chapter, POR group) determines if the regularization reasons should be regularization reason)
entered in the documents transaction.

Definition
IES (INFORMAÇÃO
EMPRESARIAL SIMPLIFICADA)

Document for the annual VAT


declaration.

3/54
How to guide – Portuguese legislation

Related functions
Setting up counters
 GESTCA (Sequential
Define the three following codes for the sequential number assignment from the numbers assignement
Financial module.
These counters will be used for each declaration type.

Setting up VAT
The VAT rate indicates the percentage of VAT to apply to the invoice line. Related functions
You can calculate the VAT in two different ways:  GESPDM (Balance transfer
validation)
 From BP invoices: the rate is linked to an account.

 From the Sales module and the Purchase module: the rate is a
combination of Article tax level and BP tax rule.
Before calculating the declaration, you must calculate the VAT.
Set up the balance of the VAT to pay or the VAT to collect in the Balance
transfer setup screen.

4/54
How to guide – Portuguese legislation

Run the Balance transfer validation function (GESPDM) codes in this order:
1. IVA1
2. IVA2

Setting up VAT declaration fields Related functions



1. Declaration field versus the Tax codes function (GESDVPT)
GESDVPT (Taxes codes)
At this point, you will be able to map the declaration field number (provided
by the Fiscal Authority software) and the potential tax codes that can be
applied to this field number.

 To define a tax code for each declaration, select a type of declaration


(periodic or annual), in the Type field. Select an Annex and enter the
Declaration.

Because setup may depend on the company activity, you can set up
VAT declarations for each company.

5/54
How to guide – Portuguese legislation

2. Setting up declarations (DCLVATPOR1)

For periodic declarations, define the minimum amounts above which


transactions must be detailed by BP.
Three different limits can be applied separately for the VAT: to collect, to
deduct, and to regularize.

For annual declarations:

 Under CAP, define the minimum amounts above which transactions


must be detailed by BP. You can apply limits on Purchasing and Sales.

 Under Annual - Account roots, enter the Service sales and the Good
sales in order to split the VAT.

 Under Exceptions - Account roots, enter the roots of accounts that are
eligible for the recap data.

6/54
How to guide – Portuguese legislation

Relevant transactional data


Possible VAT regularization (debit and credit notes) in customer
invoices

Invoice type = Credit note


Field reason for
> Regularization linked to field 40
company to collect
Conditions :
Regime type = Normal

Invoice type = Debit note


Field reason for
> Regularization linked to
field 41
company to pay

VAT regularization in the Supplier invoices (Purchasing and AR)

Invoice type = Credit note Field reason for


> Regularization linked to field 41
company to pay
Conditions :
Regime type = Normal
Invoice type = Debit note
Field reason for
> Regularization linked to field 40
company to collect

Conditions : Invoice type = Debit note


Field reason for
Regime type = Normal > Regularization linked to field 40 and field
company to collect 41

7/54
How to guide – Portuguese legislation

Field 40: used in the Fiscal Authorities software to store VAT


regularization to collect.
Field 41: used in the Fiscal Authorities software to store VAT
regularization to Pay.

You can set up or modify regularization reasons any time in the VAT
regularization reason function (FUNFLDREN).
Set up the External Document Number for import and export supplied by duties
Related functions
in the Import/export declaration function (DCLVATPORI).  FUNFLDREN (the VAT
In the Document types function (GESGTE), select the Tax on issue check regularization reason)
box for documents filtered for the VAT declaration.
 DCLVATPORI (Import/export
declaration)
 GESGTE (Document types)

Generating the VAT declaration


Two declarations are issued every month or every quarter:
 The European services declaration (DCLVATPOR3)
 The periodic VAT declaration (DCLVATPOR2)
The annual VAT declaration is issued yearly, along with the IES declaration
(DCLVATPOR4).
The annual VAT declaration must be exported from ERP X3 and uploaded on
the government website.

Managing the VAT declaration


Values appear on the screen according to how each declaration has been set Related functions
up.
 GESCOA (Chart of accounts)
The account type (submitted or VAT account) in the Chart of accounts
function (GESCOA) is relevant to determine bases and VAT amounts
In the chart of accounts, you must define the VAT for each declaration field.

8/54
How to guide – Portuguese legislation

To check your data, run the following reports:

 P-VATPORBAS

 P-PERVAT

Modify existing calculations at your own risk.

9/54
How to guide – Portuguese legislation

Cash flow
Description
A process will trigger all transactions with cash accounts and analyze the Related activity codes
journal entry’s counterpart accounts. The amounts are displayed according to a
specific setup.
 CSFLO (Cash flow analysis)

This requirement is defined on IAS 7 and NCRF 2 (Portuguese IAS


adaptation).
Cash flow data is also reported in the IES declaration.

Prerequisites
Activate the CSFLO - Cash flow analysis activity code. Related functions
 GESCSF (Extraction
Setup parameter)
In the header of the Extraction parameter function (GESCSF), create your  GESCSRH (Cash flow analysis
main filtering criteria associated with an extraction code. function)
 Extraction code: Free alpha code and description to identify the criteria  GESCOA (Chart of accounts)

group.

GESCSF (Extraction
Company: Company or a group of companies. For a group of companies, parameter)
you can set the BP detail.
 Ledger type , Amount type, and Accounts to be anayzed: Define the
ledger type, the amount type, and the cash accounts you want to analyze.
 Rate var process check box: Define how you want to analyze the rate
deviations.

 By account: Select the Rate var process check box. When an


account is found in an eligible entry journal and it is set up in the
Chart of accounts function (GESCOA) as rate deviation, the
system will search the BP account on the original document.

 By the original BP and its account: Do not select the Rate var
process check box.

10/54
How to guide – Portuguese legislation

In the Setup block, specifiy a code and a sub-code for each item. This will
group all transactions where the counterparts are the accounts set in the
Original accounts column.

 Original accounts: Accounts configuration follow the same setup rules as


Financial Data Extraction.
 Code and Sub-code: Grouping codes and sub-codes.
 Description: Description of each grouping criteria.

Previous recommendations before execution


The balance recovery calculation is:
Starting amount + movements = end amount

Related functions
 Do the balance recovery before running the cash flow process.  RECBAL (Balance
 Run the end of year simulation after the balance recovery and before
resynchronization)
running the cash flow process.  SIMULFINEX (in Year end
simulation)
 GESCSRH (Cash flow
analysis)

11/54
How to guide – Portuguese legislation

Data extraction
In the header of the Cash flow analysis function (GESCSRH) enter:
 Extraction code: Select the extraction code you previously created.
 Site: Select the site or sites to be queried.
 Extraction start date and Extraction end date: Select the period you want
to analyze.
 If you want to display the previous period, select the Previous period
check box.

 Click Calculate to display the data.


You can modify the amounts you want, but the following control must be
respected:
Amount at the start of the period + movements of the period = amount at
the end of the period

12/54
How to guide – Portuguese legislation

P-CASHFLO report
Once the results are generated, you can print the P-CASHFLO report.

13/54
How to guide – Portuguese legislation

Capital flow report


Related miscellaneous
Description tables
Legal report requirement connected to IAS/IFRS rules.  389 (Capital flow)
The Capital flow report identifies, at the entry journal level, which type of capital  390 (Capital flow colums)
movement is going to take place.
This is only possible and is mandatory if the account in the entry journal is a
capital account.
This report is always linked to the first referential.

Prerequisites
The 389 miscellaneous table (Capital flow) and the 390 miscellaneous table
(Capital flow columns) drive the data.
 Contents of ADI 389 are printed on the rows of the report. They represent
the capital flow reasons.

 Contents of ADI 390 are printed as columns on the report with the root
accounts to link in the entry journal.

14/54
How to guide – Portuguese legislation

Process in Sage ERP X3


Entry journal: Equity accounts require you to enter the type in Capital flow.

The P-Cashflow report with the results:

These data will also be exported in the IES declaration.

15/54
How to guide – Portuguese legislation

IES
Description
Related functions
The IES declaration is an annual report. It gathers data from the following Sage  GESCSF (Extraction
ERP X3 sources: parameter)
 Annual VAT  GESCOA (Chart of accounts)
 Cashflow
 Capital flow
 Balance figures extracted from the financial data extraction

You have the two following possibilities:


 Generate and work on the data, then enter the results for the IES manually.
Related activity code


Export an XML file and upload it on the dedicated IES environment.
IESFG (IES file generator)
This second option carries an extra cost, due to additional licensing
for the IESFG- IES file generator activity code. Check the related price
list for more information.

Setup
As mentioned previously, four groups of data require particular attention for this
declaration:
 Annual VAT
 Cashflow,
 Capital flow
 Balance figures extracted from the financial data extraction

Find below a simple recap of what you need to report and how.

16/54
How to guide – Portuguese legislation

Setting up annual VAT


In the VAT parameters function (GESDVPP), review the setup by company
and by year.

Then, generate the annual declaration through the Annual VAT function Related functions
(GESDVPHA) and check if everything is correct. If not, modify the values.
 GESDVPP (VAT parameters)
 GESDVPHA (Annual VAT)

17/54
How to guide – Portuguese legislation

If you are going to use the IES generator, point the Declaration code
to be used later.

Setting-up cash flow Related functions


In the Extraction code field, enter ‘CASHFLOW’.
 GESCSF (Counterpart
Because the data to extract can depend on the business of each company, extraction)
review the original accounts to ensure that they are in agreement.
Review this setup in the Counterpart extraction function (GESCSF).

18/54
How to guide – Portuguese legislation

Related functions
 GESCSF (Extraction
parameter)
 GESCSRH (Cash flow
analysis)

Then, generate the data in the Cash flow analysis (GESCSRH) function.
Modify this data at your own risk.

If you are going to use the IES generator, point the Query number
to be used later.

19/54
How to guide – Portuguese legislation

Setting up capital flow


You need to print out the P-CAPFLO report. Check the results. You can modify
the results on entry journals if needed.

Setting up financial data extraction


Related functions
The IES requires information extracted by the financial data extraction (FDE).
Generate and verify the accuracy of all “IES” group outputs. Any data  GESTXW (Inquire)
modification you make will be included in the file generation.
 TXSGRP (Calculation)
 GESTXS (Financial data
extraction)

20/54
How to guide – Portuguese legislation

Although the IES declaration contains many annexes, only the following
annexes are currently being taken in consideration:

Description GESTXS code

Profit and losses 03A

Balance 04A

Cash detail 05041A

Investment detail 05071A

Fixed investment detail 05081A

Losses on investments 05121A

Investments in the group 0516A

Cost of sales and production 05191A

Production variations 05192A

Provisions 0522A

Rate deviations 05241A

IRC 0526A

Impairments 05281A

Investment information 05283A

Financial information 05284A

Personnel expenses 05292A

Results 0531A

P&L and Balance detail 061A

Once you have generated all the data, make a note of the extraction
number code if you want to generate the XML file.

21/54
How to guide – Portuguese legislation

Process in Sage ERP X3

Process to generate the XML file (depending on Related functions


license allowance)
 FUNIESGNR (IES generation)

In the IES generation function (FUNIESGNR), select the company and the
fiscal year start and the fiscal year end. Then, complete these fields :
 In the table, enter the version for each FDE in the Version field.
 Declaration: Enter the VAT declaration number.
 Query number: Enter the query of the cash flow you want to export.

Capital flow data is exported on the fly because the data is extracted from the
GACCENTRY* tables.

If you do not have the IES generator, use the previous records and enter the
data manually.

22/54
How to guide – Portuguese legislation

Number of document copies


Description
This requirement is defined in the DL 198/2012 Degree. Related parameters
Documents issued for customers and suppliers can be automatically printed  MULCOPRINT (Multiple copy
and stamped with descriptions such as ‘Original’, ‘Duplicate’, or ‘Triplicate’. mgmt/ext doc)
Use this feature on customer sales invoices, customer AP/AR invoices,
shipping notes and supplier returns.
Related activity code
The number of copies to print is set up in the printing template for the customer
or supplier.  MULCP (Multiple copy
For AP/AR customer invoices, the number of copies will depend on the value of mgmt/ext doc)
[M:RPT]NBRCPY (field at the bottom of the printing input parameters) at
printing time.

Prerequisites
 Set the general parameter MULCOPRINT - Multiple copy mgmt/ext doc
(TC chapter, RPT group) to ‘Yes’.
 Activate the MULCP - Multiple copy mgmt/ext doc activity code.

Setup
The copies from purchase returns, deliveries, and invoices will determine the Related functions
number of printings and what will be stamped in the invoice.
 GESTPM (Printing templates)
 GESBPC (Customers)
 GESBPS (Suppliers)

23/54
How to guide – Portuguese legislation

Assign a template code to the BP in the Customers function (GESBPC) and


the Suppliers function (GESBPS).

The results of this setup:

Return Suppliers with a


template code where
Original number of copies for
Return returns = 2
Duplicate

Customers with a
Shipping template code where
Original number of copies for
Invoice shipping=2 and for
Shipping
invoices = 3
Original Duplicate
Invoice
Duplicate

Invoice
Triplicate

24/54
How to guide – Portuguese legislation

Intrastat
Description
The report can be delivered in two different ways: Related functions
 Upload the file exported from Sage ERP X3 on the Instituto Nacional de  GESTMD (Delivery modes)
Estatística website: http://webinq.ine.pt/aderentes.
 Enter the data manually by copying the results from the report.

Prerequisites
Related miscellaneous
Specify the delivery modes in the Delivery modes function (GESTMD) in order
tables
to foresee all the possible situations in a company.  950 (Regions)
 951 (Airport/Seaport Intrastat)

The region is specified in the 950 miscellaneous table (Regions) and


the airport or the seaport is specified in the 951 miscellaneous table
(Airport/Seaport Intrastat).

25/54
How to guide – Portuguese legislation

Process in Sage ERP X3


Related functions
The P-INTRASTAT report:  FUNDEBPOR (Intrastat POR
file)

To export the text file, you need to enter: Company, Flow, and Date .

26/54
How to guide – Portuguese legislation

Cash VAT
Description

The DL 71/2013 has amended tax law in Portugal and introduced a new
concept for the VAT declaration. Collecting and deducing the VAT based on the
date of the invoices is no longer used. Now you are required to do so upon
receiving payment from your customers.
It is not expected that any Sage ERP X3 customer will comply with this regime,
but we can handle companies in business with customers who comply with the
VAT cash regime.
Cash VAT means that the VAT is declared only when receiving payment. If a
company complies with the cash VAT regime, this regime must apply to both
suppliers and customers. Because we do not foresee this regime for Sage ERP
X3 customers, we can manage this at the payment level (receipts in this case).

X3 customer X3 customer
Normal regime VAT Cash regime

1. Invoice issue

Declaration of VAT calculated


VAT to collect but not
deduced

2. Payment

3. Receipt

VAT deduced,
included in the
purchase

27/54
How to guide – Portuguese legislation

SAFT communication
The receipt communication sent by the company to the government is applied
only to customers under VAT cash regime.

Setup
In the Customers function (GESBPC), in the Financial tab, the Cash VAT Related functions
block has been added. This block includes the following fields:
 GESBPC (Customers)
 Tax rule (Cash VAT), set with the value ‘Yes’ or the value ‘No’
 VAT start date
 VAT end date

28/54
How to guide – Portuguese legislation

Relevant transactional data

Standard procedure
The invoice is not
under VAT cash
regime

Picking
due dates
in GESPAY
The invoice is
submitted to VAT
cash regime  New table (PAYVAT)
to update
New process  New controls:
- GESPAY
- IMPAYE

Process in Sage ERP X3


Related functions
 Payments function (GESPAY)  GESPAY (Payments)
 IMPAYE (Doutbtful receipt
 The payment sign has to be a ‘Revenue’ ( [F:PYH]SNS=2) and
entry)
the allocation on the lines must be linked to a customer or supplier
invoice ([F:PYD]VCRNUM<>””).

 Each time the record is created or modified, the record in the new
table is created and updated with the status: ‘Entered’.

 You can not modify a record if the status has been


communicated.
If you try to modify it, the following message is displayed:
Impossible to update. You have to delete and create a new one.

 Each time a record is deleted, regardless the actual status


(‘Entered’ or ‘Communicated’), the new status will be reversed
and it will be communicated again.

29/54
How to guide – Portuguese legislation

 P-RECIBO report
The report P-RECIBO is mandatory for customers under VAT cash regime.
Therefore, you must deliver this document to customers each time they
process a payment. With this document, the customers can collect the VAT
in their declaration to the government.

 Doutbtful receipt entry function (IMPAYE)

 Each time a payment (receipt) is reversed, the new table must be


updated with the reversal date.

 If the payment has already been communicated, this record must


be updated with the ‘Reversed’ status so that it can be
communicated again.

30/54
How to guide – Portuguese legislation

Process on the SAFT:

 Exported when the status is equal to ‘Entered’ and ‘Reversed’.

 Imported with the status ‘Communicated’.

Payment status

Entered
Status updated to
‘Communicated’
Reversed

SAFT

Functions excluded from the process


Related functions
 Automatic payment generation function (PAYPROPAL)  PAYPROPAL (Automatic
payment generation)
Customers using the cash VAT regime are excluded from this functionality.
If you generate receipts from cash VAT customers, you must create them in the  BPOINET (BP net settlement)
Payments function (GESPAY).

 BP net settlement function (BPOINET)


Customers using the cash VAT regime are excluded from this functionality.

31/54
How to guide – Portuguese legislation

Electronic signature and software


certification
Description
As of 2011 January 1st, it is a legal obligation in Portugal to digitally sign Related Parameter(s)
customer invoices and have the ability to generate an audit file that follows the
SAF-T PT standard. Standard Audit File - Tax (SAF-T) is a standard for audit
 PORDKS (Electronic
purposes established by the OECD (Organization for Economic Co-operation signature Portugal)
and Development). SAF-T PT is the Portuguese version of the SAF-T standard.
Several laws were issued by the government with a big impact on the regulation
of software behavior with several specificities. The contents of these
specificities derive from laws 197/2012, 198/2012, 160/2013, 161/2013 and law
22-A/2012 from 24/January regarding mandatory requirements for
January/2013. The purpose is to ensure X3 compliance with software
certification.
rd
According to law 363/2010, from June the 23 , any software needs to be
certified by the government before it can be sold.
One of the requirements to obtain this certification is to generate a digital
signature for all the logistics documents issued to the customers and suppliers.
This electronic signature is based on the RSA asymmetric cipher algorithm
which contains a private key provided by the software company and a public
key provided to the government
Generally speaking, the following document types need to be digitally signed:
 Invoices
 Deliveries
 Returns (sales and purchase)
 Any other document that can serve as a transport document
(accompanying the materials). Are considered: intersite
transfers, subcontract transfers and subcontract returns.
The digital signature must guarantee that the following data is not changed
once the document is issued (validated):
 Creation date and time;
 Modification date and time
 Document amount
 Document number
Digitally signed documents cannot be deleted and for each document type it is
required to have a dedicated sequential number

The Java Bridge Server must be installed.

32/54
How to guide – Portuguese legislation

Setup
Related functions
Setting up connection parameters and key
management
 GESDKJ (Connection
parameters)
Once the Java Bridge is installed, you need to complete the connection
parameters in order to make it work.
 GESDKK (Key Management)

The “SAFT-PT” code is mandatory.


In addition, you need to verify that the key version is properly created as
follows:

Setting up sequential numbers


The sequential numbers submitted for electronic signature need to have a
specific structure. Related functions
They need to be chronological numbers.  GESANM (Structure of the
They need to be set up so as to easily distinguish the serial number of the sequencial number)
sequential number (alphanumeric structure) from the sequential number itself
(numeric structure). These 2 parts must be divided by a slash (/):
Example of a correct structure:

33/54
How to guide – Portuguese legislation

34/54
How to guide – Portuguese legislation

SAFT-PT Configuration
Definition(s)
The law mentioned above regarding certification also includes the obligation by SAF-T
the software to export the SAF-T.
Standard Audit File for Tax.

For additional information please click here.

This standard format comes with export rules and data that was not obvious in
the system before.

Setup
Related functions
Setting up all document types
 GESTSV (customer invoice
Additional fields were created to store information regarding these legal types)

requirements.
GESTPV (Supplier invoice
The fields below are common to all document types.
types)
 GESTSD (Delivery document
Temporary and final sequential numbers types)

These numbers are not available for the customer or supplier invoice types  GESTRE (Sales return
because it is the automatic journal that will determine the associated sequential document types)
numbers.
 GESTPN (Purchase returns
For the other document types, we are able to assign a temporary sequential document types)

number and a final sequential number. The reason is that sometimes, the same
sequential number is shared between documents and sometimes it is quite GESTSG (Miscellaneous
complicated to make these sequential numbers chronological. stock document types)
Under these circumstances, we are now able to separate the needs of the logic  GESTTN (Transport notes)
procedure and the needs of having electronic signatures based on
chronological sequences. The reason is that the digital signature is generated
only when the final sequence number has been assigned.

Record type
For the purpose of control measurements performed by the government and for
SAFT purposes as well, according to the law, we need to be able to distinguish
the source of the documents.
The possible sources are:

35/54
How to guide – Portuguese legislation

This new local menu is available in all sets of document types and contains 4
possibilities:
1/ Normal
This is the default value and should be selected if none of the 3 values below is
applied.
2/ Manual document recovery.
Documents that were created manually on paper (because the system was not
operational for some reason) and were reintroduced later in the system.
3/ Backup document recovery
Documents that were lost because of an incomplete backup (as an example,
we had to use a backup from yesterday and we lost all documents that we had
already managed today) and we need to reenter them in the system.
4/ External document
Documents originally created in third party software and then entered in our
software (and X3 does not need to generate the digital signature).

For manual document recovery and backup document recovery types, the
user will also have to enter the original document number. For that purpose,
there is one field at document level (ORIDOCNUM for invoices, MANDOC for
the other document types).

Setting up the customer document types


Related functions
SAF-T document type
 GESTPV (Supplier invoice
A new field called SAF-T document type is available in order to distinguish types)
between the various document types allowed:
 GESBPS (Suppliers)
 Invoice
 Simplified invoice*
 Debit note
 Credit note

36/54
How to guide – Portuguese legislation

* A simplified invoice is an invoice that can be issued with far less information
than a normal invoice. For example, the information on the customer, their fiscal
number and address is no longer mandatory on these document types.
On the other hand, the possibility to issue such a document type is quite limited
and depends on the following rules, knowing that this can only be applied to
customers based in Portugal (EECNUM starts with “PT”).
The rules are the following:

 If the company is a retail company ([F:CPY]ACTTYP) and the


customer is a final consumer ([F:BPC]LEGETT=2) and the invoice
amount without VAT is less than 1000 €.

 If there is at least one of the invoice lines where the product is a


service, the limit of the amount of the invoice without VAT drops to
100 €

To control these values and any company’s main business, the “legal data”
function available in the company file contains the following fields: Related functions
 GESCPY (Company)

Self-invoice
A new field called Self invoice is also available to define if the current
document type refers or not to an auto-invoice.
If this flag is set to 2, these document types will not be exported to SAFT.
A self-invoice is an invoice whereby the customer sends the invoice to
themselves. In this case, we need to internally enter the document whose digital
signature was generated by the customer. The communication process handles
this situation differently.

Number of days for next invoice


The goal of the Number of days for next invoice field is to limit and control
errors made by the users when entering the document date. Once the
sequential number of the documents is chronological, if a user creates an
invoice with the wrong date, this will be a problem since the process cannot be
reversed. So, if the user tries to create a document (invoice) with a date later
than Date$+ number of days, the system will generate a warning message.

37/54
How to guide – Portuguese legislation

Setting up the supplier document types Related functions


SAF-T document type  GESTPV (Supplier invoice
A new field called SAF-T document type is available in order to distinguish types)
between the various document types allowed:
 GESBPS (Suppliers)
 Invoice
 Simplified invoice
 Debit note
 Credit note

Self-invoice
A self-invoice means that we are acting for the supplier who has the obligation
to create an invoice. So instead of the supplier, X3 will create the invoice for
them (on purchase side). Because the supplier did not create the invoice, there
are 2 options for SAF-T:
1/ The file is directly delivered to the government with these invoices.
2/ The file is directly delivered to the supplier and they communicate it
to the government.
The main rules are quite similar to GESTSV.
When we generate a self-billing invoice, it is mandatory to have a unique
sequence number by supplier. For that purpose, the complement used for the
sequence number is set in a dedicated field in the supplier file, in the
“Management” tab

The sequence number must contain the complement in the structure. For
example:

38/54
How to guide – Portuguese legislation

Setting up the product and product category types


Related functions

Additional fields were created to store information regarding these legal data.
GESITM (Products)
There are 4 possibilities but it will only be possible to select the following:
 None
 GESITG (Products category)
 Product
 Service
 Others (Fixed asset included)
This will define the product type once SAFT is issued.

Setting up VAT exemption reasons Related functions


All VAT tax codes linked to a VAT exemption must be associated with an
exemption reason available via the “Legal data” button.  GESTVT (Tax rates);

39/54
How to guide – Portuguese legislation

Setting up the company responsible for the fiscal


communication Related functions
There are some companies which use their own resources to generate the  GESCPY (Company);
whole invoice process, and all the required documents, in the name of other
companies. In this situation, there are specific data in the SAFT file that need to
be exported and are associated with the details of the company which provides
that service.
For that purpose, there is an additional field in the “Legal data” button available
in the company file to specify which company is providing that service:

Process in Sage ERP X3


Related functions

Posting documents
 GESSST – Subcontracting
transferences;
Once a document is electronically signed, it cannot be modified, mainly the
fields contributing to the signature (mentioned above).  GESSTR - Subcontracting
returns;
The digital signature is usually performed during the “posting” phase for the
functions which are already fitted with this button.  GESSCS – Stock changes
Other functions were modified in order to integrate an additional button enabling  GESSIS - Inter-site
the user to enable the document blocking control. transferences;
Therefore, concerning the intersite transfers, subcontracting transfers,
subcontracting returns and stock changes, if the KPO activity code is active and
the PORDKS general parameter is active, a new “Signature” button is enabled:

Related functions
 GESTPN (Purchase returns
This will generate the digital signature and prevent the user from modifying any document types)
element on the current record.

Concerning the purchase returns document types, the button “Validation” is


enabled.

Related functions
Reversing entry journals  GESGAS (Entry jounals)
The reversal of a document digitally signed with a entry journal in general
ledger is not allowed by the Portuguese law.

40/54
How to guide – Portuguese legislation

The main reason is linked to the sequential numbers: all documents with a
document type requiring a digital signature must be consistent with the
sequential numbers and all documents must be signed (which will not happen
by reversing an entry journal).

The “reversal” menu options and the “Reversal date” field will be disabled in the
case of reversing entry journals.

41/54
How to guide – Portuguese legislation

SAFT Generation

Setup
Related parameters
Before extracting the SAFT file for the first time, it is mandatory to set up the  SAFTPRIRN (Net price
transaction origin by tax code. rounding)
 PORPYR (Local pyramid)
 SAFTACCRET(Root account
for threshold tax)
 LEDTYPS – Ledger type

Related functions
 GESVCL (Tax classification)

For each tax level, the origin of the transaction needs to be defined as being
either Mainland, Azores or Madeira. For each tax level, the tax code level needs
to be defined for SAFT purposes.

Process in Sage ERP X3


Related functions
A dedicated function will enable the generation of the Xml file.  FUNSAFTEXT (SAF-T
extraction)
In this function – SAF-T extraction – the type of SAFT to be exported can be
selected:

 SAT-T PT Integrated – The file is only extracted when requested


by the government. It also include common tables, invoices and
general ledger

 SAT-T PT Invoicing – The file is extracted when requested by the


government. It only includes invoices

 SAT-T PT Accounting – The file is extracted when requested by


the government. It only includes the general ledger

 SAT-T PT Self-billing – The file includes purchase auto-invoices


when requested by the supplier or the government

42/54
How to guide – Portuguese legislation

 SAT-T PT AT communication– The file is communicated every


month with the invoices of the previous month (the product table
is not exported)

 SAT-T PT Self-billing AT – The file is communicated every month


with the auto-invoices from the previous period (the product table
is not exported)

 SAT-T PT Shipping documents AT – This type is used to


communicate in advance the transport that will occur (please see
information below)

In addition, the supplier filter will only be enabled if the SAFT type is associated
with the supplier auto-invoice (Self-billing and self-billing AT)
The site and document fields are only applied if the communication relates to
transport notes (please see information below)

43/54
How to guide – Portuguese legislation

Law 50001
Description
These features derive from law 50.0001/2013 and are related to the continuous
compliance with software certification compliance.
This law has been revoked by law 8632/2014. Only those requirements updated
and considered as being mandatory are described below and implemented in
the software.

Prerequisites

Except for the control of the credit note amount, all features are linked to the
KPO activity code.

Default “final consumer” (LEGETT) and fiscal


number mandatory (EECNUM)
With the new concept of simplified invoice type, the definition of a business Related functions
partner which is a final consumer became very important.
 GESBPC (Customers)
In order to limit entering incorrect data, the LEGETT field from the customer
table is defaulted according to the following rules:
 If the fiscal number is “PT123456789” or “PT999999990” (these are
invalid fiscal numbers used by the government to define entities that
are not submitted to VAT).
 The Business Partner is Portuguese (country = PT).

44/54
How to guide – Portuguese legislation

On the other hand, it is not possible to leave the EECNUM field blank if the
business partner is Portuguese (Country =”PT”).

Modification of the business partner’s fiscal number


Related functions
If documents have already been issued for a given customer, the fiscal number  GESBPC (Customers)
(EECNUM) can no longer be changed.
So, if a given Business Partner has:
 customer invoices, shipping notes or sales returns (with a posting date
later than 2012, the date of the SAFT law), and
 the country of origin is Portugal,
then, the fiscal number (stored in the EECNUM field) can no longer be
changed.

The control is performed in the LASTCUSMVT table. For a given customer,


and for records from a Portuguese company, if the IFFTYP field displays the
values 7, 8, 9 or 10, X3 considers that transactions already take place with this
customer and therefore it will not be possible to modify this customer’s fiscal
number.

Modification of the product description


If there are documents issued for a given product code, the descriptions can no Related functions
longer be modified. This impacts ITMDES1, ITMDES2 and ITMDES3 from the
ITMMASTER table.
 GESITM (Products)

45/54
How to guide – Portuguese legislation

This control is performed for all the digitally signed documents (SINVOICED,
SDELIVERYD, SRETURND, SCHGD, PINVOICED and PRETURND), where
the company legislation is POR and the document date is later than 2012.

For all the products that are included in the transactions described in the
paragraph above, it will not be possible to change the product descriptions

Sales credit notes


The law 50001 introduced 2 (two) different requirements regarding credit notes: Related functions
1/ A credit note amount cannot be larger than the original invoice.  GESSIH (Sales invoice)
2/ A credit note must be linked to an original document or an application  GESBIC (AP/AR invoices)
period must be specified.

1/ Credit note amount versus invoice amount


Related parameters
According to the Portuguese legislation, it is not possible to issue a credit note
linked to an invoice of a smaller amount. Therefore, the CTLCRENOT  CTLCRENOT (Credit memo
parameter must be set with a “blocking” control. invoice control)
Generically speaking, the control is based on the following rules:  CRENOTTHR (Control
 When a credit line impacts an invoice line, the system will control that Threshold)
the sum of all the credit note lines linked to this invoice line will not be
larger than the invoice line amount or quantity.
 The sum of all the credit note lines linked to an invoice cannot be larger
than the global invoice amount.

46/54
How to guide – Portuguese legislation

2/ Credit note not linked to an original document => the date range for the
credit note must be entered.
If the credit note is not linked to an original document, the credit note period
fields must be entered.
This control is set once an attempt is made to post the credit note.

47/54
How to guide – Portuguese legislation

Transport notes
Description
There are some situations where companies need to transfer products from one Related functions
place to another (using public ways). Yet, these products are not part of the
normal distribution flow (example of a broken PC that needs to be delivered to
 GESTTN (transport notes
the maintenance company). types)

A new function – Transport note – is available for products with no impact on  GESTNH (transport note)
the core business. So, generically speaking, the features related with this
function are as follows:
 FUNCFMTNH (transport note
validation)
 There is no link with an existing document.
 There is no invoice generation from transport notes.
 No credit control and credit updates apply for this function.
 No stock management: the products can be managed in stock but it will no
generate any stock movement for transport notes.
 No control on stock availability will be run even if there is no stock for a
product managed in stock.
 There is no accounting interface.
 No picking from the left list. A transport note is directly created with no
allocation to orders, shortages, etc. Only direct transport notes are possible.
 There is no return management for transport notes.
But:
 It is possible to select a Business Partner, whether it is a customer or a
supplier.

The TRSNE or KPO activity codes must be active in order to set up the
TRSNE activity code which is the one that supports all these features.

The transport note validation can be:

 A single validation by clicking the “Validation” button (function


GESTNH).

 A mass validation (FUNCFMTNH function) where filters can be


entered.

48/54
How to guide – Portuguese legislation

Transport communication
Description
All the products shipped by any company, irrespective of the reason why they Related parameters
are being shipped, need to be digitally signed and communicated to the
government in advance in order to have an authorization code to proceed with
 TSTCOMAT – AT test mode
the transport.  USRCOMAT – AT user
This is supported by the legal compliance with the law 197/2012, 198/2012,
160/2013 and 161/2013 regarding mandatory requirements for January/2013.
 AUTCOMAT – Automatic
sending.
In order to comply with the law for all these communications, the following fields
were added to the functions:
 ARVDATAUT – Autom.
Arrival date
 Departure date  DBCOMAT – AT debug


mode.
Arrival date

 Departure hour

 Arrival hour

 Truck license plate

 Trailer license plate

 Global document checkbox (to identify a global document)

 Global document number (Please see FAQ 1);

 Date of the Global document

 Manual document (Please see FAQ 2)

 Transport code (cannot be updated) (Please see FAQ 3)

These fields are located according in various functions according to the context:

 GESTNH, GESSDH, GESSRH functions


“Add. info” tab:

49/54
How to guide – Portuguese legislation

 GESPNH function
“Add. info” button

 GESSIS, GESSST, GESSTR functions


“Communication/Sending” menu

50/54
How to guide – Portuguese legislation

 GESSRL and GESSRS functions


“Management” tab

After being digitally signed, the transport notes need to be communicated to the
government so that the products can be transported.

Process in Sage ERP X3


The transport communication can be achieved using Web services or SAF-T.

Communication process using SAF-T Related functions


This communication can be a mass process where filtering criteria can be  FUNSAFTEXT (SAF-T
applied to adapt the record to the intended communication. extraction)

51/54
How to guide – Portuguese legislation

If the user chooses this communication method (SAF-T), it means the


government will return the file with the assigned transport codes for the records
the user had previously sent.
Therefore, these codes need to be imported using these functions:
Related functions
 FUNIMPCDTSA (Import SAF-T
transport code)
Communication)

Communication process using Web services


Related functions
Each function used to generate a product transportation (the ones mentioned
above), has a dedicated button in order to communicate via Web services:  FUNTRNDOC (Transport
communication to AT)
Communication)

This communication can be a mass process where filtering criteria can be


applied to adapt the record to the intended communication.

52/54
How to guide – Portuguese legislation

Another function is available to the user for the management of transport Related functions
documents which have been communicated and which need to be
communicated (CONSTDC).  CONSTDC (Transport doc.
After applying the filters and clicking Search, the records will be loaded to the communication)
screen below. Communication)

Besides inquiring the transport codes and the communication status, it is also
possible to perform the communication by:

 Selecting the records by clicking on the first column “Send marked”.

 Right-clicking on the line and selecting “Send document”.

53/54
How to guide – Portuguese legislation

FAQ
What is a global document?
This new law introduced a new concept in the transport of goods: the situation
of a transport, at delivery time, for a final costumer(s) which is not known.
A global document relates to a transport that will be performed for a customer
that is unknown at the time of departure.
Example:
A company sells bread and cakes and delivers them to the customer’s
site. When the truck leaves the company, it carries 1.000 units of bread but at
this point, we do not know how many quantities will be sold to each customer:
Once the actually purchased quantities are delivered to each customer, the
detail/normal shipping note is created and it must be linked to the global
document.

What is a manual document?


A contingency plan needs to be in place in case the IT system does not work for
some reason. It means that the transport will not be done in the system and a
paper document will be used instead. On such situations, we need to
communicate the paper document number later along with the system internal
number.
This communication will not be achieved with X3. It needs to be done directly in
the AT portal.

What is the transport code?


The AT communication field is used to store the internal code returned by the
government. Under normal conditions, this code is returned by the government
using Web services. On the other hand, if the transport code was
communicated on paper or, if, for any reason, this code was not returned by a
normal way but was communicated on the phone, it must be entered manually.
No product can be transported via public way without this code.

54/54

You might also like