--- title: "How to configure the SAF-T extension?" slug: "1619602503" tags: ["SAF-T"] updated: 2026-08-18T08:26:19Z published: 2026-08-18T08:26:19Z canonical: "help.ila.cegid.com/1619602503" stale: true --- > ## Documentation Index > Fetch the complete documentation index at: https://help.ila.cegid.com/llms.txt > Use this file to discover all available pages before exploring further. # How to configure the SAF-T extension? - [x] PT - [ ] ES - [x] AO - [ ] CV - [ ] MZ - [ ] ST - [ ] GW - [x] Professional - [x] Executive - [ ] Public Sector - [ ] Omnia - [x] Evolution --- To ensure the correct import of data from a billing SAF-T file, a **set of settings** related to the import must be configured. These settings must be made **before the first import** or whenever there is a need to **change the import parameters**, and must also be done for clients whose **sales are integrated through SAF-T file import**. > [!NOTE] > Settings that need to be read from the ERP will be read from the [Model Company](https://help.ila.cegid.com/primavera/docs/1602867503); however, the information entered does not have to come from this company. You just need to make sure all the data entered in the configuration is common to all clients that share the [same model](https://help.ila.cegid.com/primavera/docs/1619605180). --- ## Configuring the Extension To configure the sales SAF-T extension, follow these steps: **Step 1: Create a model** 1. Go to **Application | Settings Group | Extensions | SAF-T** or **Desktop | [Client] | Banks Actions Menu | Configure**; 2. Select an existing model and click **Edit**, or double-click the row; 3. Click **Duplicate**; 4. The **Model Client** field will show the default model company; however, you can select another company for the configuration you want to create; 5. Enter the desired name in the **Model** field; 6. Select the **Default Model** option if you want the model to be automatically assigned to new clients. Only one default model can exist per extension. **Step 2: Set the Processing Parameters** 1. In the **Import** area, enable the options you want to have already selected in the import menu (these options can be changed later, in the **Sales Import** menu, before each import): - **System Folders**: when enabled, you can choose which version of the QR code reader to use, or whether you want to use all of them. All versions allow you to set the number of iterations (minimum of 1 and maximum of 20) and scan all pages of the document. The difference between the versions is technological, with version 2 using a more advanced component; **Note**: this option may affect import performance; - **Cegid Docs**; 2. In the **Documents without Data** field, you can select one of the following options: - **Import**: the document is imported and takes on the **Pending** status (current behavior). In this case, you can manually *match* it with the e-Fatura document when posting the document; - **Discard**: the document is imported and takes on the **Discarded** status; - **Ignore**: the document is ignored and is not imported by the application; 3. Enable the **Automatic Posting** option if you want documents to be **automatically posted to the ERP's accounting during import**. If an error occurs during posting, the documents will be placed as a **Draft** in the accounting postings and **will need to be finalized manually in the ERP**. In this situation, it's advisable to configure automatic balancing for the documents. You should decide whether automatic posting should always be performed, or only in cases where there's an attachment; 4. Enable the **Normalize Document No.** option if you want the document number to be normalized by checking patterns (DocType Series/DocNo) or standardized types (FT, FS, FR, NC, ND, etc.); 5. Set the **Withholding Year** to consider for the documents' withholdings: - **Year of the Posting Date:** the withholding year to consider will be the year of the posting date; - **Year of the Document Date:** the withholding year to consider will be the year of the document date; 6. Set the **Posting Date** to consider when posting the documents: - **Document Date:** the Posting Date to consider will be the same as the Document Date; - **Last Day of the Month of the Document Date:** the Posting Date to consider will be the last day of the month of the Document Date; 7. Enable the **Reference Month for docs. from previous periods** option if you want the Posting Date to be the last day of the Reference Month set in the Desktop, when the document belongs to a previous period. For example, a document dated 02/15/2021 would get a posting date of 03/31/2021, if March was the reference month set in the desktop; 8. Choose one of the following options: - **Balance to VAT Account:** the document is automatically balanced and the balancing difference is entered in the **VAT account;** - **Balancing Account:** the document is automatically balanced and the balancing difference is entered in the **account set** in this step. If the non-deductible VAT percentage **is 100%** and this account is not filled in, the balancing will be applied to the VAT base (the account that has the VAT class associated with it); 9. Specify the **Maximum Value** that will be automatically balanced. For example, if the maximum value is set to 0.01, documents will only be balanced if the balancing error is equal to or less than this value. If the error is 0.02, the documents will not be balanced. **Step 3: Set the Customer Creation Parameters** 1. Enable the **Create Customers in the ERP** option if you want customer records to be created in the ERP. If you choose not to create the entities in the ERP, they will be mapped to the one-time entity, and postings will be made to it; 2. Set the **Rule Type** to use for coding new customers: **- Tax ID:** the customer's code will be their tax identification number; **- Sequence:** a sequential numeric code will be assigned to the customer. If this option is selected, you must specify, in the **Mask** field, the no. of digits of the code using the **#** character. For example, the mask **####** will return a sequential 4-digit code (0001, 0002, 0003, ..., 9999); **- Mask:** in addition to the previous example, this also allows you to use additional tokens in its construction, such as: **#** (numeric sequence), **D** (Tax Area token), and **H** (Country token). Example of filling in the **Mask** field: **DH####**; **- Customer ID:** the customer code specified in the SAF-T file's customer table will be assigned; **- Formula:** this option lets you customize the entity coding rules using all the tokens, fields, and formulas available in PAA; 3. Depending on the option selected in the previous step, different fields will be shown: - **Sequence** or **Mask:** fill in the **Mask** field according to one of the examples given above; - **Formula:** specify the formula for building the customer's code. Clicking the **...** button opens the formula editor, where you can customize the code using the tokens, fields, and formulas provided by the application. You must also specify the **No. of Digits** to assign to the customer's code; 4. Set the **Minimum Value** and **Maximum Value** for the customer's code (optional). When filled in, the sequential code will start numbering from the minimum value and will not exceed the maximum value. If the value is set to **0**, there is no minimum limit set; 5. Enable the **Search public Entity data** option if you want the customer data specified in the file to be replaced by tax data, whenever that information is public; 6. Fill in the **Paym. Term**, **Currency**, **Tax Area**, **Oper. Location**, **Postal Code**, and **Country** fields with the values to use when creating the customer's record, in case there is no information in the file; 7. In the **ERP Code** field, specify the One-Time Customer's code in the ERP; 8. Set the document grouping rule in the **One-Time Customer Docs.** field: **- Do Not Group:** the documents will not be grouped; **- One document per line:** the documents will be grouped, and the posting will distinguish each document by showing one line per sales document; **- By document totals:** the documents will be grouped, but, in this case, there will only be one line with the sum of the documents' totals and their respective VAT totals in the accounting posting. Only documents issued to the One-Time Customer on the same **Day**, for the same **Tax Document Type** and **Series**, will be grouped. The External Document Number of a grouped document will have the format **TaxDocType Series/YYYYMMDD** (for example: FR 2024/20240131); 9. Enable the **Post to Third-Party Account** option if you want the one-time customer's balances to be posted to its own third-party account. Otherwise, the posting will be made through the revenue account, against cash/bank; 10. In the "One-Time Customer Names" table, set the names of the third parties you want to be treated as one-time customers. **Step 4: Set the Accounting Connection Parameters** 1. Enable the **Integrates with Current Accounts** option if you want the account to create open items in the Logistics module. When the account is posted in the accounting postings, you must make sure a posting document set to integrate with current accounts is used; otherwise, the open item will not be created; 2. In the **Account Type** field, set the account type to use when creating the open item; 3. In the **Status** field, set the current account's status when the account is integrated with Cash Management (when it creates open items); 4. Set the **Rule Type** to use for the accounting connection token of new customers: **- Sequence:** a sequential numeric token will be assigned to the customer; **- Same as Code:** when selected, the accounting connection token will be the same as the customer's code set previously; **- Fixed Token:** the same accounting connection token, common to all customers, will be set; **- Formula:** you can customize the accounting connection tokens using all the tokens, fields, and formulas available in PAA; 5. Depending on the rule type selected previously, different fields will be shown: - **Formula**: specify the formula for building the customer's code in the respective field. Clicking the **...** button opens the formula editor, where you can customize the token using the tokens, fields, and formulas provided by the application; - **Fixed Value:** specify, in the **Fixed Value** field, the accounting connection token to assign to all customers; 6. Set the **Minimum Value** and **Maximum Value** for the connection tokens (optional). When filled in, the sequential numbering will start at the minimum value and will not exceed the maximum value. If the value is set to **0**, there is no minimum limit set; **Note**: This field is available when the **Sequence** or **Formula** options are selected; 7. In the **Third-Party Seg.** field, set the third-party segment to consider when creating the customers' accounts in the Chart of Accounts. **Step 5: Set the Item Creation Parameters** 1. Enable the **Create Items in the ERP** option if you want items to be created in the ERP; 2. Fill in the **Item Type**, **VAT Code**, and **Unit** fields with the values to consider when creating the item, in case there is no information in the file. **Step 6: Set the Discount Account Mappings** In the **Financial Discount** field, set the discount account in the Chart of Accounts. **Step 7: Set the Mappings between Taxes and Withholding Accounts** In this section, set the mappings between the SAF-T file's tax types and their respective accounts in the Chart of Accounts. - **Tax Type:** Specify the tax type you want to map; - **Description:** Description of the tax type; - **Source:** Data source you want to associate with the account. For each tax type, the sources to consider in this setting are the following: - Invoice - Sales. - Receipts - Sales; - Documents - Sales; - Documents - Receipts; - **Withholding Account:** The tax type's account in the Chart of Accounts. **Step 8: Set the Document Type Mappings** 1. Specify the **Tax Document Type**; 2. Set the internal **Document Type** corresponding to the tax document type; 3. Set the **Template** to use for each tax document type. This option is only applicable when the ECHO Posting Assistant is not used; 4. Set the **Nature** of the Tax Document Type. For example, setting the tax document type **FT** as having nature **C** means that, when the document is posted, **the revenue account will be credited**; 5. Enable the **Generate Settlement** option so that document types are automatically settled when the document is posted. However, if an entity is set to generate a settlement, that setting will override the document's setting, meaning that if a tax document of type **FT** is not configured to generate a settlement, but the entity that issued the document has settlement enabled, a settlement will be generated for the issued FT document; 6. Enable the **Ignore** option to discard the document types during import. **Step 9: Set the Mappings between SAF-T and ERP Item Types** In this section, set the mappings between the item types specified in the SAF-T file and the corresponding ERP item types: - **SAF-T Item Type:** Item type specified in the SAF-T file; - **Description:** Description of the SAF-T file's item type; - **ERP Item Type:** Description of the ERP's item type. **Step 10: Set the Statuses to Apply to Documents** 1. In the **Import with Errors** field, set the status for when there are errors during import; 2. In the **Successful Import** field, set the status for when the import is completed successfully; 3. In the **Import Canceled** field, set the status for a canceled pending document; 4. In the **Posting with Errors** field, set the document's status for when there are errors during posting; 5. In the **Successful Posting** field, set the document's status for when posting is completed successfully; 6. In the **Posting Canceled** field, set the status for a canceled posted document. **Step 11: Select the Desired Clients** In the **Clients** area, specify the clients you want to apply the configured model to. **Step 12: Finalize the configuration** 1. Clicking **Save** or **Save and Exit** will apply these settings to all selected clients; 2. If another extension in the same category is already active, PAA may disable it and enable the new extension. To do this, simply indicate that you want to enable the new extension in the dialog box that appears after clicking **Save**; 3. The clients will automatically have the extension enabled. --- ## Enabling the Extension After making all the necessary settings, you must enable the SAF-T sales extension in batch or per client. To enable the SAF-T extension, follow these steps: **Enabling per client** 1. Go to **Application | Home Group | Clients**; 2. Select the desired client and click **Edit**, or double-click the Client's row; 3. On the **Settings** tab, under **Data Sources**, enable the **SAF-T** extension; 4. Specify the configuration model you want to use for this extension; 5. Click **Save** or **Save and Exit**. **Enabling in batch** 1. Go to **Application | Tables Group | Extensions**; 2. Select the **SAF-T** extension and click **Edit**, or double-click the row; 3. In the **Clients** grid, select the clients where you want to enable the extension; 4. Specify the configuration model you want to use for this extension for each client; 5. Click **Save** or **Save and Exit**. If another extension in the same category is already active, PAA may disable it and enable the new extension. To do this, simply indicate that you want to enable the new extension in the dialog box that appears after clicking **Save** or **Save and Exit**. > [!WARNING] > Only one extension can be active per category. --- ## Examples of Coding Customers with formulas When the **Formula** rule type is used to create entities, **two fields** need to be configured to set the code creation rule. This code consists of two parts: - **Fixed prefix:** set in the **Formula** field; - **Number of digits of the code:** set in the **No. of Digits** field. For this type of rule, at least one of these fields must be filled in. Below are some examples of coding customers using the **Formula** option. **Example 1: Code equal to the Tax ID** This formula corresponds to selecting **Tax ID** in the **Rule Type** field. - **Formula:** [NIFOrigem] - **No. of Digits:** 0 (no sequence) **Example 2: Sequential code** This formula corresponds to selecting the **Sequence** option in the **Rule Type** field. This example assumes a numeric sequence with four digits. - **Formula:** not filled in - **No. of Digits:** 4 **Example 3: Mask** This formula corresponds to selecting the **Mask** option in the **Rule Type** field. The following example shows a code made up of the **Tax Area**, **Country**, and a numeric sequence with four digits. - **Formula:** [D] + [H] - **No. of Digits:** 4 **Example 4: Code equal to the CustomerID** This formula corresponds to selecting **CustomerID** in the **Rule Type** field. - **Formula:** [OrigemUQ] - **No. of Digits:** 0 (no sequence) **Example 5: Code equal to the last six digits of the Tax ID** - **Formula:** SafeSubString([NIFOrigem], 3, 6) - The result will be the six digits of the Tax ID, counting from the digit in the third position - **No. of Digits:** 0 (no sequence) --- ## Examples of creating Tokens with formulas Below are three examples of creating accounting connection tokens using the **Formula** option. **Example 1: Token equal to the customer's code** This formula is equivalent to selecting the **Same as Code** option in the **Rule Type** field. - **Formula:** [CodigoPRI] **Example 2: Sequential number** This formula is equivalent to selecting the **Sequence** option in the **Rule Type** field. In this case, one will be added to the highest existing value in the ERP. - **Formula:** [NumeradorTokenEntidade] **Example 3: Fixed Token** In this case, simply set the desired fixed value in the **Formula** field. - **Formula:** '1234' > [!WARNING] > Accounting connection tokens can only consist of digits. So, when you choose the **Same as Code** option or use the entity's code in the Formula, you must make sure it consists only of numbers. > > For example, if you want to use the entity's Tax ID as the **CBL Token** and the entity is intra-Community, in the token's configuration, you should select formula as the rule type and use the following formula to remove the country letters from the Tax ID: **Replace([NIFOrigem], [PaisOrigem], '')**.