Professional Documents
Culture Documents
How to guide
Portuguese legislation
Version 1
March 2015
How to guide – Portuguese legislation
Contents
OVERVIEW....................................................................................................................................... 1
Setup............................................................................................................................................................ 3
Description ............................................................................................................................................... 10
Prerequisites ............................................................................................................................................ 10
Setup.......................................................................................................................................................... 10
Description ............................................................................................................................................... 14
Prerequisites ............................................................................................................................................ 14
IES ..................................................................................................................................................... 16
Description ............................................................................................................................................... 16
How to guide – Portuguese legislation
Setup.......................................................................................................................................................... 16
Description ............................................................................................................................................... 23
Prerequisites ............................................................................................................................................ 23
Setup.......................................................................................................................................................... 23
INTRASTAT ................................................................................................................................... 25
Description ............................................................................................................................................... 25
Prerequisites ............................................................................................................................................ 25
Description ............................................................................................................................................... 27
Setup.......................................................................................................................................................... 28
Description ............................................................................................................................................... 32
Setup.......................................................................................................................................................... 33
Setup.......................................................................................................................................................... 35
Setup.......................................................................................................................................................... 42
Description ............................................................................................................................................... 44
Prerequisites ............................................................................................................................................ 44
Description ............................................................................................................................................... 48
Description ............................................................................................................................................... 49
FAQ ................................................................................................................................................... 54
Overview
This document describes Portuguese localization for Sage ERP X3,
including how to set up and use EU VAT specific rules for
Portugal:
1/54
How to guide – Portuguese legislation
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.
Definition
IES (INFORMAÇÃO
EMPRESARIAL SIMPLIFICADA)
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
Because setup may depend on the company activity, you can set up
VAT declarations for each company.
5/54
How to guide – Portuguese legislation
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
7/54
How to guide – Portuguese legislation
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)
8/54
How to guide – Portuguese legislation
P-VATPORBAS
P-PERVAT
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)
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 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.
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.
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
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
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
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
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.
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
20/54
How to guide – Portuguese legislation
Although the IES declaration contains many annexes, only the following
annexes are currently being taken in consideration:
Balance 04A
Provisions 0522A
IRC 0526A
Impairments 05281A
Results 0531A
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
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
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
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)
25/54
How to guide – Portuguese legislation
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
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
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
Each time the record is created or modified, the record in the new
table is created and updated with the status: ‘Entered’.
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.
30/54
How to guide – Portuguese legislation
Payment status
Entered
Status updated to
‘Communicated’
Reversed
SAFT
31/54
How to guide – Portuguese legislation
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)
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.
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).
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:
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.
37/54
How to guide – Portuguese legislation
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
39/54
How to guide – Portuguese legislation
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.
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.
42/54
How to guide – Portuguese legislation
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.
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”).
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
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.
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
These fields are located according in various functions according to the context:
49/54
How to guide – Portuguese legislation
GESPNH function
“Add. info” button
50/54
How to guide – Portuguese legislation
After being digitally signed, the transport notes need to be communicated to the
government so that the products can be transported.
51/54
How to guide – Portuguese legislation
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:
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.
54/54