PT
ES
AO
CV
MZ
Professional
Executive
Public Sector
Omnia
Evolution
To automate and speed up the entry of postings that are periodically made in accounting, you can use posting templates, that is, base posting models for the various document types imported through any extension.
Available Templates
The posting templates tell the application how the documents should be posted to make a correct posting in the ERP's accounting, defining the accounts to be used, the debit and credit values, the VAT reflections, the cost centers, the journal, the document, among others.
PAA has some templates already configured and ready to apply in one of these categories:
Banks;
Purchases;
Investments;
Receipts;
Sales.
You can edit them or create additional templates to adapt them to the office's needs. Posting templates are available for the Banks, Purchases, Sales, and SAF-T extensions.
It's recommended that you use your own coding when creating templates, instead of continuing with the numbering assigned initially. As new features are developed, new templates may appear with a code sequential to the initial one, which means PAA may not be able to create templates and, as a result, may cause errors when the product is updated.
Configuring templates
In the posting template settings, it's important to specify the extensions, documents, and client groups that can use it, as well as define the document posting models.
To create or edit posting templates, follow these steps:
Step 1: Create or edit a template
Go to APPLICATION | Settings Group | Templates;
Click New, or select an existing template and click Duplicate;
To change an existing template, select the desired template and click Edit or double-click the row;
In the Code field, enter the desired code;
In the Description field, enter the template's name.
Step 2: Configure the template
The System Template field is read-only. If it's selected, the template cannot be edited;
Enable the ECHO Template option if you want the template to be used by the ECHO Assistant;
Enable the Recalculate VAT option if you want VAT to be calculated on the total base amount. The VAT recalculation is carried out before the automatic balancing.
If this option is not enabled, VAT will be calculated line by line and added up at the end (see example below);In the Data Sources area, specify the extensions that can use the template;
In the Document Types area, specify the document types that can use the template;
In the Client Groups area, specify the client groups that can use the template.
The following example shows a calculation with the Recalculate VAT option enabled and disabled. This is a document originating from a SAF-T file with two item lines at a 6% rate and another at a 23% rate:
Recalculate VAT enabled:
Line 1: Base (RED) = €3.77
Line 2: Base (RED) = €8.70
Line 3: Base (NOR) = €10.00
Total Base (RED) = 3.77 + 8.70 = €12.47
Total VAT (RED) = 12.47 * 0.06 = €0.75
Total Base (NOR) = 10.00
Total VAT (NOR) = 10.00 x 0.23 = €2.30
Total VAT = 0.75 + 2.30 = €3.05
Recalculate VAT disabled:
Line 1: VAT (RED) = 3.77 x 0.06 = €0.23
Line 2: VAT (RED) = 8.70 x 0.06 = €0.52
Line 3: VAT (NOR) = 10.00 x 0.23 = €2.30
Total VAT = 0.23 + 0.52 + 2.30 = €3.05
Step 3: Configure the posting
The grids in the Posting Configuration area let you define the document posting models, automating their entry. To do this:
In the upper grid, fill in the data relating to the accounting posting header, such as Journal, Document, etc.;
In the lower grid, fill in the accounting posting lines, such as accounts, VAT classes, description, values, among others;
To finish the configuration, click Save or Save and Exit.
In both grids, you can customize the posting rules and conditions using tokens, fields, and formulas available in PAA. These conditions can be applied to the entire row, if the condition is set in the Condition column, applied to a specific cell, or both.
You can associate these templates directly with entities on their record in PAA. This way, in the Template column on the Third Parties tab, you can pin a previously created template for that customer/supplier.
Using the ECHO template
The ECHO Posting Assistant uses the ERP accounting postings from all clients to automate the posting of documents imported by PAA. It also suggests postings based on the entities' SIC code when there is no record of any posting in the system.
The ECHO Assistant still uses templates to preset the accounting postings; however, only one template is used for any document type. This is a more complex template from a configuration standpoint, and it's a system template, meaning it cannot be deleted or changed.
To create or assign templates, follow these steps:
Creating an ECHO template
To create an ECHO template, follow the same steps described in the Configuring templates section, enabling the ECHO Template option in the template settings.
Whenever you want to create an ECHO template, you should duplicate the system ECHO template to speed up the setup.
Assigning an ECHO template to a client group
To enable the ECHO Assistant, select the Use ECHO Assistant option in Client Groups; it will then be used for all clients belonging to the group.
Each client group always has the system ECHO template assigned. By clicking Configure Template, you can edit the original ECHO template; when you save, a new template with the changes made will be saved and automatically assigned to the group.
Alternatively, you can also assign an ECHO template from the Templates menu. To do this, simply specify, in the Client Groups area, which groups will use it. The same template can be used in more than one group; however, each group can only have one ECHO template assigned.
Whenever a group has the Use ECHO Assistant option enabled and has no ECHO template assigned, the system ECHO template will be automatically assigned.
ECHO template conditions
To learn more about how this template works, some explanatory notes on the ECHO template's conditions are presented below.
To identify the document's origin, the token [Origem.Codigo] is used in the header and the lines. This token can have the following values:
SAFT: identifies a document originating from the SAF-T extension;
VEN: identifies a document originating from the Sales extension;
COM: identifies a document originating from the Purchases extension;
BNC: identifies a document originating from the Banks extension.
When applying this validation in the "Condition" column, the row will only be displayed if that condition is met. In the header and posting grids, all conditions must include this validation, except when the row applies to all data sources.
Document header
The headers of Purchases, Sales, SAF-T, and Banks documents consist of various pieces of information, namely:
Purchases or Sales documents
Column | Condition | Explanation |
Condition | [Origem.Codigo] IN ('COM', 'VEN') | - [Origem.Codigo] IN ('COM','VEN'): the document originates from the Purchases or Sales extension. |
Journal | [Entidade.Diario] | - [Entidade.Diario]: this will insert the journal used in the entity's previous postings. If there is no history, a journal will be suggested based on the prefix of the expense or revenue account used, configured in the Document Type table. |
Document | [Entidade.DocumetoCBL] | - [Entidade.DocumetoCBL]: this will insert the accounting document used in the entity's previous postings. If there is no history, a document will be suggested based on the prefix of the expense or revenue account used, configured in the Document Type table. |
Description | [DadosOrigem.Documento.DocumentoCBLDescricao] + ' - ' + [Documento.NumDocExterno] | The posting's description will be the accounting document's description, followed by the document's external number. |
SAF-T documents
Column | Condition | Explanation |
Condition | [Origem.Codigo] = 'SAFT' AND NOT [TipoDocumento.TipoDocLiq] | - [Origem.Codigo] = 'SAFT': the document originates from a SAF-T file; |
Journal | [TipoDocumento.Diario] + Iif([Documento.GerarLiquidacao], Iif([Documento.D] = '1', '6', Iif([Documento.D] = '2', '7', '8')), [Documento.D]) | - [TipoDocumento.Diario]: inserts the Document Type's journal token; |
Document | [TipoDocumento.Diario] + Iif([Documento.GerarLiquidacao], Iif([Documento.D] = '1', '6', Iif([Documento.D] = '2', '7', '8')), [Documento.D]) + [TipoDocumento.Documento] | - [TipoDocumento.Diario] + Iif([Documento.GerarLiquidacao], Iif([Documento.D] = '1', '6', Iif([Documento.D] = '2', '7', '8')), [Documento.D]): Explanation described previously; |
Description | [DadosOrigem.Documento.DocumentoCBL | The posting's description will be the accounting document's description, followed by the document's external number. |
Decoding examples:
Decoding a document of type FT, not configured to generate a settlement and issued in the domestic market:
- Journal: "5" + "1" = "51"
- Document: "5 "+ "1" + "1" = "511"
- Description: "Vendas MN - n/Fatura" + " - " + "FA 2021/1" = "Vendas MN - n/Fatura - FA 2021/1"Decoding a document of type FR, configured to generate a settlement and issued in the intra-Community market:
- Journal: "5" + "7" = "57"
- Document: "5" + "7" + "1" = "571"
- Description: "V.Dinheiro MI - n/V.D." + " - " + "FR 2021/1" = "V.Dinheiro MI - n/V.D. - FR 2021/1"
SAF-T documents of the settlement type
A document is considered to be of the settlement type when the Settlement Doc. Type option is enabled in the Document Type table.
Column | Condition | Explanation |
Condition | [Origem.Codigo] = 'SAFT' AND [TipoDocumento.TipoDocLiq] | - [Origem.Codigo] = 'SAFT': the document originates from a SAF-T file; |
Journal | Iif([Documento.MeiosPagamentoNumLinhas] = 0, Iif([Cliente.ContaMFLDefeito] = [Cliente.ContaCaixa], '2', '3') + [TipoDocumento.Diario], [MeioPagamento.Diario]) | - Iif([Documento.MeiosPagamentoNumLinhas] = 0, Iif(...) + [TipoDocumento.Diario], [MeioPagamento.Diario]): if the document has payment methods, the following condition will be applied; otherwise, the Payment Method's journal will be inserted; |
Document | Iif([Documento.MeiosPagamentoNumLinhas] = 0, Iif([Cliente.ContaMFLDefeito] = [Cliente.ContaCaixa], '2' + [TipoDocumento.Diario] + '2', '3' + [TipoDocumento.Diario] + [TipoDocumento.Documento]), [MeioPagamento.DocumentoCBL]) | - Iif([Documento.MeiosPagamentoNumLinhas] = 0, Iif(...), [MeioPagamento.DocumentoCBL]): if the document has payment methods, the following condition will be applied, otherwise, the Payment Method's document will be inserted; |
Description | [DadosOrigem.Documento.Documento | The posting's description will be the accounting document's description, followed by the document's external number. |
Decoding examples:
Decoding a document of type RG with bank transfer as the payment method:
- Journal: "3" + "1" = "31"
- Document: "3" + "1" + "1" = "311"
- Description: "Bancos - Depósitos" + " - " + "RE 2021/1" = "Bancos - Depósitos - RE 2021/3"Decoding a document of type RG, with no payment method specified and with the cash account set as the default account to use:
- Journal: "2" + "1" = "21"
- Document: "2" + "1" + "2" = "212"
- Description: "Caixa A - Recebimentos" + " - " + "RE 2021/1" = "Caixa A - Recebimentos - RE 2021/3"
Bank documents
Column | Condition | Explanation |
Condition | [Origem.Codigo] = 'BNC' | - [Origem.Codigo] = 'BNC': the document originates from a bank posting. |
Journal | [LinhaExtrato.Diario] | - [LinhaExtrato.Diario]: the journal can be assigned to the posting's row in two ways: |
Posting Grid
In the posting grid, you can identify a set of elements related to the entity, revenue, and expense accounts, and the nature of each row, as well as generate settlements and handle withholdings.
Identifying the third party's account
Column | Condition | Explanation |
Account | [Entidade.Conta] | - [Entidade.Conta]: this token returns the third party's main account based on its entity type. The account prefixes and their respective tokens must be configured in the Client Group. |
Identifying the row's nature
The posting row's nature is identified based on the document's origin and its tax type. This mapping is done in the settings of each extension, on the Mappings tab and in the Document Types area, where the nature must be set for each tax document type.
For example, setting the FT tax document type in the Purchases extension as nature D means that, when the document is posted, the cost account will be debited.
Based on this setting, the ECHO template will place the values as debit or credit, as shown in the example in the following table. The values to enter in each of the template's rows vary depending on the result you want to achieve in each one.
Column | Condition | Explanation |
Debit | Iif([Documento.Natureza] = 'D', [...], 0) | If the document's nature is Debit, a value or expression represented by [...] will be applied; otherwise, 0 will be inserted. |
Credit | Iif([Documento.Natureza] = 'C', [...], 0) | If the document's nature is Credit, a value or expression represented by [...] will be applied; otherwise, 0 will be inserted. |
Identifying the revenue account for documents originating from the SAF-T extension
In the SAF-T extension, revenue accounts and their VAT classes are built based on the Item Type and the Tax Area. You must make sure the items are filled in with the correct Item Type on the Items tab in the Client File, or on the Items tab of the SAF-T importer.
In the ECHO template, these accounts are identified as follows:
Column | Condition | Explanation |
Condition | [Origem.Codigo] = 'SAFT' ... | The column's condition must always start by specifying that it should only apply to documents originating from SAF-T. Additional conditions can be defined. |
Account | '7' + Iif([Linha.TipoArtigoSAFT] = 'S', '2', '1') | - '7': the first digit to be inserted to indicate that this is a revenue account; |
VAT | Iif([Cliente.GrupoCliente.ITemplateSubDivisao | - Iif([Cliente.GrupoCliente.ITemplateSubDivisao |
For sales, two conditions are shown, since if the document is of type NC, the revenue account and its VAT class should be different. Determining which row should be used is done by checking the document's nature specified in the "Condition" column of each row ([Documento.Natureza] = 'D' or [Documento.Natureza] = 'C').
Decoding examples:
Decoding an item of type Goods (item type P) in the Domestic tax area and without VAT account subdivision:
- Account: "7" + "1" + "1" + "1" + "" = "7111"
- VAT: "131" + "1" + "323" + "1" = "13113231"Decoding an item of type Service (item type S) in the Domestic tax area and with VAT account subdivision (subdivision token "3"):
- Account: "7" + "2" + "1" + "1" + "3" = "72113"
- VAT: "" = "13123231"
Since a VAT subdivision is applied, it's assumed that the VAT class defined in the chart of accounts for the specified revenue account should be used. By not filling in this value, that VAT class will be inserted.
Identifying the revenue account for documents originating from the Sales extension
In the Sales extension, revenue accounts and their VAT classes are suggested based on posting history. In the ECHO template, these accounts are identified by the following tokens:
[Linha.EntidadeContaProveito]: returns the revenue account based on the third party's history;
[Linha.EntidadeContaProveitoCIVA]: returns the VAT class used together with the previous revenue account.
However, since a default item type is set in the Sales extension configuration, this will be used as a suggestion for the third party's first sales document posting, if it doesn't yet have any history. The condition to apply in both the "Account" column and the "VAT" column is identical to the condition for a document originating from the SAF-T extension, but with an additional validation.
In the ECHO template, these accounts are identified as follows:
Column | Condition | Explanation |
Condition | [Origem.Codigo] = 'VEN' ... | The column's condition must always start by specifying that it should only apply to documents originating from Sales. Additional conditions can be defined. |
Account | Iif([Linha.EntidadeContaProveito] = '', '7' + Iif([Linha.TipoArtigoSAFT] = 'S', '2', '1') + [Linha.O] + [Documento.D] + Iif([Cliente.GrupoCliente.ITemplateSubDivisao | - Iif([Linha.EntidadeContaProveito] = '' , [...] , [Linha.EntidadeContaProveito]): if the entity has no history, the condition set in [...] will be applied. Otherwise, the revenue account most frequently used for the third party will be inserted. |
VAT | Iif([Linha.EntidadeContaProveitoCIVA] = '', Iif([Cliente.GrupoCliente.ITemplateSubDivisao | - Iif([Linha.EntidadeContaProveitoCIVA] = '' , [...] , [Linha.EntidadeContaProveitoCIVA]): if the entity has no history, the condition set in [...] will be applied. Otherwise, the VAT class used with the revenue account most frequently used for the third party will be inserted. |
For sales, two conditions are shown, since if the document is of type NC, the revenue account and its VAT class should be different. Determining which row should be used is done by checking the document's nature specified in the "Condition" column of each row ([Documento.Natureza] = 'D' or [Documento.Natureza] = 'C').
Identifying the expense account for documents originating from the Purchases extension
In the Purchases extension, expense accounts and their VAT classes are suggested based on posting history. In the ECHO template, these accounts are identified by the following tokens:
[Linha.EntidadeContaGasto]: returns the expense account based on the third party's history;
[Linha.EntidadeContaGastoCIVA]: returns the VAT class used together with the previous cost account.
In the ECHO template, these accounts are identified as follows:
Column | Condition | Explanation |
Condition | [Origem.Codigo] = 'COM' ... | The column's condition must always start by specifying that it should only apply to documents originating from Purchases. Additional conditions can be defined. |
Account | [Linha.EntidadeContaGasto] | - [Linha.EntidadeContaGasto]: the cost account most frequently used for the third party will be inserted. If it has no history, a cost account may be suggested based on the entity's postings for other clients, or based on its SIC code. |
VAT | [Linha.EntidadeContaGastoCIVA] | - [Linha.EntidadeContaGastoCIVA]: the VAT class used with the cost account most frequently used for the third party will be inserted. If it has no history, the VAT class associated with the account in the chart of accounts will be suggested, even if it has wildcards. The assistant will try to fill in the wildcards based on the line's VAT rate; however, you should always validate this suggestion. |
Generating settlements
You can configure automatic settlements; the template reads this configuration and applies the defined rules. Below are some examples of settlements applied in the ECHO template.
Example 1: Settlement of purchase documents
Column | Condition | Explanation |
Condition | [Origem.Codigo] = 'COM' AND ([Documento.GerarLiquidacao] OR [Entidade.GerarLiquidacao] OR [TipoDocumento.TipoDocLiq]) |
|
Account | Iif([Entidade.ContaLiquidacao] = '', [Cliente.ContaMFLDefeito], [Entidade.ContaLiquidacao]) | If the third party does not have the Settlement Acct. field filled in, the default liquid financial resources account will be inserted (configured in the Client File). Otherwise, the settlement account set on the entity will be inserted |
Example 2: Cash Receipt
Column | Condition | Explanation |
Condition | [Origem.Codigo] = 'SAFT' AND ([Documento.GerarLiquidacao] OR [Entidade.GerarLiquidacao] OR [TipoDocumento.TipoDocLiq]) AND [LinhaMeioPagamento.MeioPagamento. |
|
Account | Iif([Entidade.ContaLiquidacao] = '', [Cliente.ContaCaixa], [Entidade.ContaLiquidacao]) | If the third party does not have the Settlement Acct. field filled in, the default cash account will be inserted (configured in the Client File). Otherwise, the settlement account set on the entity will be inserted |
Example 3: Non-Cash Receipt:
Column | Condition | Explanation |
Condition | [Origem.Codigo] = 'SAFT' AND ([Documento.GerarLiquidacao] OR [Entidade.GerarLiquidacao] OR [TipoDocumento.TipoDocLiq]) AND Len([MeioPagamento.Codigo]) > 0 AND NOT [LinhaMeioPagamento.Meio |
|
Account | Iif([Entidade.ContaLiquidacao] = '', [Cliente.ContaBanco], [Entidade.ContaLiquidacao]) | If the third party does not have the Settlement Acct. field filled in, the default bank account will be inserted (configured in the Client File). Otherwise, the settlement account set on the entity will be inserted |
For more information about payment methods, we recommend consulting the article How to configure payment methods?.
Handling withholdings
You can handle IRS, IRC and IS withholdings automatically or manually, by entering the corresponding values, which will only be posted once the document is settled.
The following shows how withholdings are handled in purchase documents:
Column | Condition | Explanation |
Condition | [Origem.Codigo] = 'COM' AND ([Documento.GerarLiquidacao] OR [Entidade.GerarLiquidacao] OR [TipoDocumento.TipoDocLiq]) |
|
Account | [Documento.ContaRETIRS] or [Documento.ContaRETIRC] or [Documento.ContaRETIS] | These tokens represent each of the respective tax accounts (set in the extensions' configuration, on the Mapping tab, in the Withholding Accounts area). |
Debit or Credit | Iif([Documento.RET] = 0, [Documento.TOT], [Documento.TOT] - [Documento.RET]), 0) | If the total withholdings equal 0, the document's total amount will be inserted. Otherwise, the difference between the document's total and the total withholdings will be inserted |
For more information about handling withholdings, we recommend consulting the article How to collect withholding tax when posting documents?.
Handling financial discounts
The ECHO template is set up to handle financial discounts for documents of type RC and RG originating from the Sales or SAF-T extension.
The following shows how financial discounts are handled in settlement-type documents originating from the SAF-T file:
Row with the third party's account
Column | Condition | Explanation |
Condition | [Origem.Codigo] IN ('SAFT', 'VEN') AND [TipoDocumento.TipoDocLiq] | - [Origem.Codigo] IN ('SAFT', 'VEN'): Indicates that the document's origin is Sales or SAF-T; - AND [TipoDocumento.TipoDocLiq]: and the document is of the settlement type (set in the Document Type table). |
Account | [Entidade.Conta] | Token for the third party's account. |
Debit or Credit | Iif([LinhaMeioPagamento.Valor] + [Documento.DES] = [Documento.TOT], [Documento.TOT], [Documento.TOT] + [Documento.DES]) | Although Cegid recommends that the total amount of the receipt be the total excluding discounts, some software vendors put the total amount received in the document's total, i.e., the value already net of discounts. The condition shown here works for both scenarios, always ensuring the correct posting without the need for manual adjustments.
|
Row with discount handling
Column | Condition | Explanation |
Condition | [Origem.Codigo] IN ('SAFT', 'VEN') AND [TipoDocumento.TipoDocLiq] |
|
Account | [Documento.ContaDESCFIN] | This token represents the financial discounts account in the Chart of Accounts (set in the extensions' configuration, on the Mapping tab, in the Discount Accounts area). |
Debit or Credit | [Linha.DES] | Token for the row's discount amount. |
Handling bank postings
In the ECHO template, bank posting tokens are identified by the following tokens:
[LinhaExtratoDetalhe.ContaBancariaCBL]: returns the bank account's chart-of-accounts account;
[LinhaExtratoDetalhe.ContaCBLPadrao]: returns the chart-of-accounts account associated with the assigned pattern, or a manually entered account.
As an example, in the ECHO template, the row that identifies the bank account's account is set as follows:
Column | Condition | Explanation |
Condition | [Origem.Codigo] = 'BNC' | - [Origem.Codigo] = 'BNC': Indicates that the document originates from the bank statement. |
Account | [LinhaExtratoDetalhe.ContaBancariaCBL] | The bank account's account. |
Debit | Iif([LinhaExtratoDetalhe.Natureza] = 'C' OR ([LinhaExtratoDetalhe.Natureza] = 'D' AND [LinhaExtratoDetalhe.MesmaNatureza]), [LinhaExtratoDetalhe.Valor], 0) |
Note: the condition for the credit column is similar to this one; only the natures change. |
Description | Iif([Configuracao.DescricaoIgualMovBNC], [LinhaExtratoDetalhe.Descricao], [LinhaExtrato.DocumentoCBLDescricao]) | Iif([Configuracao.DescricaoIgualMovBNC], [LinhaExtratoDetalhe.Descricao], [LinhaExtrato.DocumentoCBLDescricao]): if the Description same as bank posting option in the posting parameters is enabled (configurable in the Banks extension), the row's description will be the same as the posting's description in the bank statement; otherwise, the CBL document's description will be inserted. |
For more information about tokens, we recommend consulting the article Tokens available in PAA.