--- title: "How to configure the Purchases extension?" slug: "1619602435" tags: ["Purchases"] updated: 2026-08-18T08:01:17Z published: 2026-08-18T08:01:17Z canonical: "help.ila.cegid.com/1619602435" 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 Purchases extension? - [x] PT - [ ] ES - [ ] AO - [ ] CV - [ ] MZ - [ ] ST - [ ] GW - [x] Professional - [x] Executive - [ ] Public Sector - [ ] Omnia - [x] Evolution --- To ensure the correct import of purchases from e-Fatura, Recibos Verdes, Recibos de Renda, System Folders, and Cegid Docs, a **set of settings** related to their 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 purchases are integrated through import.** > [!NOTE] > When the [pending purchase document folders are set](https://help.ila.cegid.com/primavera/docs/1619602306), Recibos de Renda and Recibos Verdes documents in PDF format will be **saved** during document import, with these files being placed in the documents' inbox folder. > > 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. --- ## Configuring the Extension To configure the purchases extension, follow these steps: **Step 1: Create a model** 1. Go to **Application | Settings Group | Extensions | Purchases**; **Note**: Alternatively, you can go to **Desktop | [Client] | Purchases Actions Menu | Configure**; 2. Click **New**; **Note**: You can select an existing model and click **Edit**, or double-click the row. If you want to replicate an existing model, simply click **Duplicate**; 3. The **Model Client** field will show the default model company; however, you can select another company for the configuration you want to create; 4. Enter the desired name in the **Model** field; 5. 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 desired options (you can change them later, in the **Purchases Import** menu, before each import): - e-Fatura; - Recibos Verdes; - Recibos de Renda; - System Folders; - Cegid Docs; 2. In the **Expenses outside the scope of professional activity** field, choose one of the following options to handle documents imported from e-Fatura that don't belong to the client's professional activity: - **Ignore:** the documents will not be imported; - **Discard:** the documents will be imported but placed in the **Discarded** status; - **Import:** the documents will be imported and placed in the **Pending** status; 3. When the **System Folders** option is 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; 4. 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; 5. When the **Recibos Verdes** option is enabled, set which of the following options should be used for the document's date: - Issue Date; - Service Date; 6. When the **Recibos de Renda** option is enabled, set which of the following options should be used for the document's date: - Receipt Date; - Issue Date; 7. 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.); 8. 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 the posting process, 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 the following cases: - **With Attachment**: automatic posting will only be performed if the document has an attachment; - **With AT Data**: automatic posting will only be performed if the document has AT (e-Fatura) data; - **With Attachment and AT Data;** 9. 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; 10. 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; 11. 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/2024 would get a posting date of 03/31/2024, if March was the reference month set in the desktop; 12. If you have integration with Cegid Docs, you can choose whether you want documents to be updated in the archive at the time of posting, by enabling the **Update Cegid Docs** option. If they aren't, you can update this information later in the [Document Synchronization](https://help.ila.cegid.com/primavera/docs/1715618569) menu; **Note:** with this option enabled, document integration will be slower. In addition to having to generate the posting in the ERP's accounting, you'll also need to update or send the documents to the **Legal Archive** folder in Cegid Docs; 13. If you want to enable automatic balancing, 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. 14. Choose one of the following balancing options: - **Balancing Account:** the document is automatically balanced and the balancing difference is entered in the account set in this field. 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); - **Balance to VAT Account:** the document is automatically balanced and the balancing difference is entered in the VAT account; **Note:** the import parameters set here will be used in automatic imports. **Step 3: Set the supplier creation parameters** 1. Enable the **Create Suppliers in the ERP** option if you want supplier 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 suppliers: **- Tax ID:** the supplier's code will be their tax identification number; **- Sequence:** a sequential numeric code will be assigned to the supplier. If this option is selected, you must specify, in the **Mask** field, the number 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. The allowed characters are: **#** (numeric sequence), **D** (Tax Area token), and **H** (Country token). An example of filling in the **Mask** field would be **DH####**; **- Formula:** you can customize the entity coding rules using all the tokens, fields, and formulas available in PAA; 3. Depending on the rule type selected, different fields will be shown: - **Sequence** or **Mask**: fill in the **Mask** field according to one of the examples mentioned above; - **Formula**: specify the formula for building the supplier's code in the **Formula** field. 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 specify the **No. of Digits** to assign to the supplier's code; 4. Set the **Minimum Value** and **Maximum Value** for the supplier's code. 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 new suppliers' data to be filled in with tax data, whenever that information is public. If you don't enable this option, the SIC will still be looked up, since this information may be needed for the ECHO Posting Assistant's suggestions; 6. Fill in the **Paym. Term**, **Currency**, **Tax Area**, **Oper. Location**, **Postal Code**, and **Country** fields with the values to use when creating the supplier's record, in case no information is available; 7. In the **ERP Code** field, specify the ERP's one-time supplier code. **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 Cash Management 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 suppliers: **- Sequence:** a sequential numeric token will be assigned to the supplier; **- Same as Code:** the accounting connection token will be the same as the supplier's code set previously; **- Fixed Token:** the same accounting connection token, common to all clients, 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, different fields will be shown: - **Formula:** specify the formula for building the supplier's code in the **Formula** 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 suppliers; 6. Set the **Minimum Value** and **Maximum Value** for the connection tokens. 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 suppliers' accounts in the Chart of Accounts. **Step 5: Set the discount account mappings** In the **Financial Discount** field, set the discount account in the Chart of Accounts. **Step 6: Set the mappings between taxes and withholding accounts** In this section, you must set the mappings between the different tax types and their respective accounts in the Chart of Accounts. - **Tax Type:** You can associate three tax types: **- IRS:** Personal Income Tax; **- IRC:** Corporate Income Tax; **- IS:** Stamp Duty. - **Description:** Description of the tax type; - **Source:** Data source you want to associate the account with. For each tax type, the sources to consider in this setting are the following: - e-Fatura - Purchases; - Recibos Verdes [the Portuguese self-employed invoicing platform] - Purchases; - Recibos de Renda [the Portuguese rent receipts platform] - Purchases; - Documents - Purchases; - Documents - Payments; - **Withholding Account:** The tax type's account in the Chart of Accounts. **Step 7: Set the document type mappings** In this section, you must set the configurations for the different tax document types. - **Tax Document Type:** Tax document type; - **Document Type:** Internal document type corresponding to the tax document type; - **Template:** Set the Template to use for each tax document type (applicable when the ECHO Posting Assistant is not used); - **Nature:** Set the nature of the Tax Document Type. For example, when we set the tax document type **FT** as having nature **D**, it means that, **when the document is posted, the cost account will be debited**; - **Generate Settlement:** Document types with this option enabled will be 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. For example, 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 FT document issued by that entity**; - **Ignore:** Document types with this option enabled will be ignored during import, so there is no need to discard them afterward. **Step 8: 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 9: Select clients** In the **Clients** area, specify the clients you want to apply the configured model to. **Step 10: Finalize the configuration** 1. Clicking **Save** or **Save and Exit** will apply the configuration 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 You can enable the e-Fatura, Recibos Verdes, and e-Arrendamento purchases extension per client or in batch. To enable the extension, follow these steps: **Enabling the extension 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 **Purchases** extension; 4. Specify the configuration model you want to use for this extension; 5. Click **Save** or **Save and Exit**. **Enabling the extension in batch** 1. Go to **APPLICATION | Tables Group | Extensions**; 2. Select the **Purchases** 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 Suppliers with formulas When a **Formula** 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 suppliers using the **Formula** option. **Example 1: Code equal to the Tax ID** This formula is equivalent to selecting **Tax ID** in the **Rule Type** field. - **Formula:** [NIFOrigem] - **No. of Digits:** 0 (no sequence) **Example 2: Sequential code** This formula is equivalent to selecting the **Sequence** option in the **Rule Type** field. The following example is for a numeric sequence with four digits. - **Formula:** not filled in - **No. of Digits:** 4 **Example 3: Mask** This formula is equivalent 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 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 supplier'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], '')**.