Documentação Geral
TaaS – Busca da regra pelo código interno de Serviço
Busca da regra pelo código interno de Serviço
Por Pedro Silva e Fernanda Almeida
Como é de conhecimento geral, o TaaS é a solução de integração do engine para que os cálculos dos tributos do SAP sejam feitos em um serviço externo.
Atualmente os cálculos de tributos decorrentes de prestação de serviços são feitos por meio do envio das tags “servTypeExec” e “servTypeFrom” informadas na request. Essas tags correspondem às informações do código de serviço da Lei Complementar 116/03.
O TaaS envia o código e o motor busca no cockpit a regra correspondente à esse código considerando os demais parâmetros enviados na request. O motor executa o cálculo e devolve para o TaaS nos campos correspondentes.
Para atender as necessidades dos clientes que utilizam o TaaS e que possuem regras distintas com o mesmo código de serviço da Lei, implementamos uma configuração no TaaS onde o cliente define se quer fazer a busca pelo código do produto (tag = itemCode) ou pelo código do item da lei.
A configuração “buscacodservicointerno” uma vez ativada define que o motor de cálculo priorize a busca por uma regra na tabela de tributos municipais e na tabela de tributos federais, onde tenham o mesmo código de serviço interno.
Caso a configuração não esteja ativa, o motor de cálculo vai realizar a busca da regra na tabela de tributos municipais conforme os parâmetros enviados na chamada, ou seja, pelo código do produto ou pelo código do serviço da lei na tabela de tributos municipais e quando o motor de cálculo buscar a regra na tabela de tributos federais, a busca será feita pelo código do subitem lei da regra municipal, ou seja o sistema não vai considerar o código do serviço interno para realizar a busca.
A configuração é ativada ou desativada internamente na programação do TaaS.
No exemplo abaixo, enviamos apenas a tag “itemCode”:
Portanto, o motor busca a regra da tabela tributos municipais considerando o código de serviço interno:
Executa também, a busca da regra na tabela de tributos federais considerando o código de serviço interno:
O resultado do cálculo considera as 2 regras encontradas:
No caso da configuração estar desativada, nesse exemplo, enviamos somente o código do serviço interno:
O motor busca a regra da tabela tributos municipais considerando o código de serviço interno e identifica o código subitem da lei:
Após encontrar a regra da tabela de tributos municipais, executa a busca pelo código subitem da lei na tabela de tributos federais:
E resulta no cálculo, combinando as 2 regras:
Considerações: As configurações implementadas são importantes para dar ao cliente a opção de realizar as chamadas conforme sua necessidade, ou seja, buscando pelo código do serviço interno ou pelo código da lei, de acordo com a necessidade do negócio e da definição do recebimento das regras no cockpit.
How to make a call that contains credit
By Pedro Silva and Fernanda Almeida
As is commonly known, TaaS is the engine integration solution that allows tax calculations from SAP to be performed by an external service.
Currently, tax calculations arising from service provision are made through the sending of the tags “servTypeExec” and “servTypeFrom” in the request. These tags correspond to the service code information from Complementary Law 116/03.
TaaS sends the code, and the engine searches for the corresponding rule in the cockpit based on the other parameters sent in the request. The engine performs the calculation and returns it to TaaS in the corresponding fields.
To meet the needs of clients using TaaS who have different rules with the same service code from the law, we implemented a configuration in TaaS where the client can choose whether to search by product code (tag = itemCode) or by the item code from the law.
The configuration “buscacodservicointerno,” once activated, defines that the calculation engine prioritizes searching for a rule in both the municipal tax table and the federal tax table, where the same internal service code exists.
If the configuration is not active, the calculation engine will search for the rule in the municipal tax table based on the parameters sent in the request, i.e., by the product code or by the service code from the law in the municipal tax table.
When the engine searches for the rule in the federal tax table, the search will be done using the subitem code from the municipal law rule, meaning the system will not consider the internal service code to perform the search.
The configuration is activated or deactivated internally in the TaaS programming.
In the example below, we only sent the “itemCode” tag.”:
Therefore, the engine searches for the rule in the municipal tax table considering the internal service code:
It also performs the search for the rule in the federal tax table considering the internal service code:
The calculation result considers the 2 rules found:
If the configuration is disabled, in this example, we only send the internal service code:
The engine searches for the rule from the municipal tax table considering the internal service code and identifies the sub-item code of the law:
After finding the rule in the municipal tax table, search for the subitem code of the law in the federal tax table:
And results in the calculation, combining the 2 rules:
Considerations: The implemented configurations are important to provide the client with the option to make requests according to their needs, that is, by searching for the internal service code or the law code, depending on the business requirements and the definition of how the rules are received in the cockpit.
Versão do documento: 82 | Publicação: 1/10/2025 |