Documentação Geral

Parametrização Fiscal – Passo D0207 – Retorno de Natureza de Operação do cenário ao final, após troca do passo D0034


     

    Passo D0207 – Retorno de Natureza de Operação do cenário ao final, após troca do passo D0034

    Por Carlos Dupim Jr.

     

    No cálculo do debug, existe o passo D0034, que localiza uma regra de ID tributo 97 no Admin Regras. Essa regra faz com que a Natureza de Operação do cenário seja substituída pela que a regra contém, realizando assim a busca e o cálculo com base nela.

    No final do cálculo, deveria então realizar a “destroca”, voltando a aplicar a Natureza original para a entrega dos resultados aos clientes.

    No entanto, em chamado atribuído à equipe de Produtos, foi verificado que essa “destroca” não estava ocorrendo.

    Assim, foi criado o passo D0207 que, ao final do cálculo do debug, realiza novamente a substituição da Natureza de Operação, para assim retornar aos clientes.

    Esse passo funciona em 2 etapas.

    A primeira é o preenchimento da tabela “aplicacao_calculo” com os parâmetros do cenário (por ora, foi criado parâmetro que atende à situação específica tratada no chamado):

     

     

    Em seguida, no debug irá observar as condições:

    • Possui o passo D0034?
    • O registro da tabela “aplicacao_calculo” bate com os parâmetros do cenário (UF Origem, UF Destino, Ex Origem, Ex Destinação, Natureza Operação, etc.)?

     

    Atendendo às duas condições, puxa então o passo D0207 e realiza a troca no final da operação.

     

    Segue um debug de exemplo:

    https://sp.systax.com.br/webservice/debug.php?config=2424064&id_cli=481446&prod=81656154&get=1&origem_prod=1

    Vale ressaltar que a mudança não aparece no debug em si, mas sim no retorno do cliente. Então o debug apresentará ao final a Natureza do passo D0034 que utilizou para o cálculo da operação.

     


     

    D0207 step – Return of original Nature of the Operation from the scenario at the end, after exchange by the D0034 step

    By Carlos Dupim Jr.

     

    On the preview calculation (debug), there’s the D0034 step, which finds a tax rule with Tax ID 97. This rule switches the Nature of the Operation from the scenario for the one written in the rule, proceeding the calculation based on that new nature.

    By the end of the calculation, there should be a switch back to the original nature from the scenario to then be delivered to clients.

    However, after analyzing an internal ticket opened to the Products Team, it was noted that this switch back was not happening.

    So, the D0207 step was created, so that by the end of the calculation preview, it will once again switch the Nature of the Operation, so that clients can have the correct tax return.

    This step works in 2 stages:

    First one is creating a new registry in the “aplicacao_calculo” table, with parameters equal to the ones in the scenario (for now, there were only included parameters to resolve the specific issue from the ticket):

     

     

    Next, the calculation preview will observe the following conditions:

    • Is the D0034 step on the list of applied steps?
    • Does the registry on the “aplicacao_calculo” table match with the scenario’s parameters (State of Origin, State of Destination, Sender, Receiver, Nature of the Operation, etc.)?

     

    If so, then it applies the D0207 step and makes the switch at the end of the calculation.

    Here’s an example:

    https://sp.systax.com.br/webservice/debug.php?config=2424064&id_cli=481446&prod=81656154&get=1&origem_prod=1

    Worth pointing out that the exchange won’t be shown in the preview itself, but in the final return sent to clients, so at the very end of the preview screen it will be showing the Nature of the Operation from the D0034 step.

    Voltar


Versão do documento: 60 Publicação: 5/3/2024 6