Documentação Geral

Motor de cálculo – Operação de devolução – alterações diversas


     

    Operação de devolução – alterações diversas

    Por Fernanda Penhorate

     

    Fizemos algumas alterações no motor de cálculo para atender uma demanda da operação de devolução, porém como trata-se de pedido específico essas alterações funcionam apenas para clientes e parceiros que ativem uma configuração no motor de cálculo, chamada “FederalDevolucao”.

    Antes de explicar o que a implementação trouxe de alteração é importante lembrar que nosso motor de cálculo possui 2 formas de calcular a operação de devolução: utilizando a regra do cockpit ou enviando na chamada o xml da nota originária. Essa alteração aplica-se, no momento, apenas a operação de devolução utilizando as regras do cockpit.

     

    1ª alteração: abertura do bloco do IPI:

    Na operação de devolução o bloco do IPI não é apresentado, e sim o bloco “impostoDevol”, porém com essa configuração passamos a apresentar o bloco do IPI, e não apresentamos o bloco “impostoDevol”.

    A indicação da marcação “finNFe=4” na tag “genérico” do bloco cabeçalho da chamada, faz o motor calcular a operação como devolução, e com essa implementação, havendo IPI retorna o bloco:

     

    2ª alteração: Troca do CST de IPI, PIS e COFINS:

    Ainda com a configuração “FederalDevolucao” ativa, teremos os seguintes retornos:

    - Para operações de devolução o CST de IPI será:

    CST=49 se o CFOP do retorno no motor começar com “1” ou “2” (exemplo, 1202, 1403, etc.);

    CST=99 se o CFOP do retorno no motor começar com “5” ou “6” (exemplo, 5101, 6102, etc.).

     

    CFOP 2410, deve retornar CST IPI = 49:

     

    CFOP 6202, deve retornar CST IPI = 99:

     

    - Para operações de devolução o CST de PIS e COFINS será:

    CST=49 se o CFOP do retorno no motor começar com “5” ou “6” (exemplo, 5101, 6102, etc.);

    A alteração indicada abaixo é aplicada de forma geral, ou seja, todos que utilizarem o retorno do motor de cálculo para operações de devolução, utilizando regra do cockpit, receberão a alteração indicada abaixo:

     

    3ª Alteração: de-para de CFOP

    Uma breve explicação de como funciona o retorno do motor de cálculo em relação ao CFOP da operação de devolução:

    Por se tratar de devolução precisamos trocar o CFOP da regra. Pois, a regra do cockpit está com CFOP operação de venda, compra, transferência, e como o motor converte essa regra em devolução é necessário fazer a troca desse CFOP para um CFOP de devolução correspondente com a operação.

    Por essa razão, quando há necessidade incluímos mais CFOP no de-para para fazer a troca, e agora incluímos:

    Se chamada no motor com tpnf=1 (saída), devolução de saída:

    - Se a regra do cockpit estiver com CFOP 6.109 troca o CFOP no motor para 2.203;

    - Se a regra do cockpit estiver com CFOP 6.110 troca o CFOP no motor para 2.204.

     

    Se chamada no motor com tpnf=0 (entrada), devolução de entrada:

    Se a regra do cockpit estiver com CFOP_entrada = 1556 troca o CFOP_saida = 5556

    Se a regra do cockpit estiver com CFOP_entrada = 2556 troca o CFOP_saida = 6556

    Se a regra do cockpit estiver com CFOP_entrada = 1407 troca o CFOP_saida = 5413

    Se a regra do cockpit estiver com CFOP_entrada = 2407 troca o CFOP_saida = 6413

    Se a regra do cockpit estiver com CFOP_entrada = 1551 troca o CFOP_saida = 5553

    Se a regra do cockpit estiver com CFOP_entrada = 2551 troca o CFOP_saida = 6553

    Se a regra do cockpit estiver com CFOP_entrada = 1406 troca o CFOP_saida = 5412

    Se a regra do cockpit estiver com CFOP_entrada = 2406 troca o CFOP_saida = 6412

    Se a regra do cockpit estiver com CFOP_entrada = 1653 troca o CFOP_saida = 5662

    Se a regra do cockpit estiver com CFOP_entrada = 1653 troca o CFOP_saida = 5662

    Se a regra do cockpit estiver com CFOP_entrada = 2653 troca o CFOP_saida = 6662

     


     

    Systax Engine – Return Operation – Several Changes

    By Fernanda Penhorate

     

    We made some changes to the Systax Engine to meet a demand regarding return operations. However, since this is a specific request, these changes only work for clients and partners who activate a configuration in the Systax Engine, called "FederalDevolucao".

    Before explaining what the implementation brought in terms of changes, it is important to note that our Systax Engine has two ways to calculate the return operations: by using rules on the Cockpit or by sending the original note's XML on the request. This change currently applies only to the return operation using the Cockpit rules.

     

    1st change: Opening of the IPI block:

    In the return operations, the IPI block is not presented, but rather the "impostoDevol" block. However, with this new configuration, we start presenting the IPI block, and we no longer present the "impostoDevol" block.

    The indication of the "finNFe=4" marking in the "generic" tag of the header block of the request makes the Systax Engine calculate the operation as a return, and with this implementation, if IPI is involved, the block is returned:

     

    2nd change: Replacement of IPI, PIS, and COFINS CST:

    Even with the "FederalDevolucao" configuration active, we will have the following returns:

     

    - For return operations, the IPI CST will be:

    CST=49 if the CFOP in the engine's return starts with "1" or "2" (e.g., 1202, 1403, etc.);

    CST=99 if the CFOP in the engine's return starts with "5" or "6" (e.g., 5101, 6102, etc.).

     

    CFOP 2410 should return IPI CST = 49:

     

    CFOP 6202 should return IPI CST = 99:

     

    - For return operations, the PIS and COFINS CST will be:

    CST=49 if the CFOP in the engine's return starts with "5" or "6" (e.g., 5101, 6102, etc.).

     

    The next change is applied in a general way, meaning that everyone using the engine's return for return operations using the Cockpit rules will receive the following:

     

    3rd Change: Mapping of CFOP

    A brief explanation of how the engine's return works regarding the CFOP of the return operation:

    Since it is a return of goods, we need to change the CFOP on the rule. The Cockpit rules have CFOP for sales, purchases, transfers, etc., and as the engine converts these rules for the engine’s return, it is necessary to change the original CFOP to a corresponding return CFOP for the operation.

    Because of that, when needed, we include more CFOP in the mapping to make the exchange, and now we have included:

    - If engine request has with tpnf=0 (input), return of input:

    If the cockpit rule has CFOP_input = 1556, change CFOP_output = 5556.

    If the cockpit rule has CFOP_input = 2556, change CFOP_output = 6556.

    If the cockpit rule has CFOP_input = 1407, change CFOP_output = 5413.

    If the cockpit rule has CFOP_input = 2407, change CFOP_output = 6413.

    If the cockpit rule has CFOP_input = 1551, change CFOP_output = 5553.

    If the cockpit rule has CFOP_input = 2551, change CFOP_output = 6553.

    If the cockpit rule has CFOP_input = 1406, change CFOP_output = 5412.

    If the cockpit rule has CFOP_input = 2406, change CFOP_output = 6412.

    If the cockpit rule has CFOP_input = 1653, change CFOP_output = 5662.

    If the cockpit rule has CFOP_input = 2653, change CFOP_output = 6662.

    Voltar


Versão do documento: 56 Publicação: 3/8/2024 8