# Gestão de devolução

# Gestão da devolução

<span lang="PT-BR" style="font-size: 11.0pt; mso-bidi-font-size: 12.0pt; font-family: 'Calibri',sans-serif; mso-ascii-theme-font: minor-latin; mso-hansi-theme-font: minor-latin; mso-bidi-theme-font: minor-latin; mso-fareast-language: PT-BR;">Para atender as necessidades dos clientes que realizam devolução via XML enviada no TaaS ou no motor de cálculo, criamos a tela de “Gestão de Devolução”.</span><span lang="PT-BR" style="font-size: 11.0pt; mso-bidi-font-size: 12.0pt; font-family: 'Calibri',sans-serif; mso-ascii-theme-font: minor-latin; mso-hansi-theme-font: minor-latin; mso-bidi-theme-font: minor-latin; mso-fareast-language: PT-BR;"> </span>

<span lang="PT-BR" style="font-size: 11.0pt; mso-bidi-font-size: 12.0pt; font-family: 'Calibri',sans-serif; mso-ascii-theme-font: minor-latin; mso-hansi-theme-font: minor-latin; mso-bidi-theme-font: minor-latin; mso-fareast-language: PT-BR;">Com o apoio das informações preenchidas nessa tela, permite que o cliente envie na chamada do TaaS ou do motor de cálculo, o arquivo XML da nota fiscal de venda ou compra e retona o cálculo da devolução considerando as informações do XML e realizando as trocas de CFOP e CST conforme definido na tabela de Gestão de Devolução.</span><span lang="PT-BR" style="font-size: 11.0pt; mso-bidi-font-size: 12.0pt; font-family: 'Calibri',sans-serif; mso-ascii-theme-font: minor-latin; mso-hansi-theme-font: minor-latin; mso-bidi-theme-font: minor-latin; mso-fareast-language: PT-BR;"> </span>

<span lang="PT-BR" style="font-size: 11.0pt; mso-bidi-font-size: 12.0pt; font-family: 'Calibri',sans-serif; mso-ascii-theme-font: minor-latin; mso-hansi-theme-font: minor-latin; mso-bidi-theme-font: minor-latin; mso-fareast-language: PT-BR;">O funcionamento dessa rotina consiste no seguinte fluxo:</span><span lang="PT-BR" style="font-size: 11.0pt; mso-bidi-font-size: 12.0pt; font-family: 'Calibri',sans-serif; mso-ascii-theme-font: minor-latin; mso-hansi-theme-font: minor-latin; mso-bidi-theme-font: minor-latin; mso-fareast-language: PT-BR;"> </span>

<span lang="PT-BR" style="mso-bidi-font-size: 12.0pt; line-height: 107%; font-family: Wingdings; mso-fareast-font-family: Wingdings; mso-bidi-font-family: Wingdings; color: windowtext; mso-fareast-language: PT-BR;"><span style="mso-list: Ignore;">Ø<span style="font: 7.0pt 'Times New Roman';"> </span></span></span><span lang="PT-BR" style="mso-bidi-font-size: 12.0pt; line-height: 107%; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin; color: windowtext; mso-fareast-language: PT-BR;">Na chamada do TaaS deve ser enviado na tag **“referenceIDXML”** ou na chamada do motor de cálculo deve ser enviado na tag “Cdata” o XML da nota fiscal original (de compra ou venda) convertido ou não em Base 64;</span>

<span lang="PT-BR" style="mso-bidi-font-size: 12.0pt; line-height: 107%; font-family: Wingdings; mso-fareast-font-family: Wingdings; mso-bidi-font-family: Wingdings; color: black; mso-themecolor: text1; mso-fareast-language: PT-BR;"><span style="mso-list: Ignore;">Ø<span style="font: 7.0pt 'Times New Roman';"> </span></span></span><span lang="PT-BR" style="mso-bidi-font-size: 12.0pt; line-height: 107%; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin; color: windowtext; mso-fareast-language: PT-BR;">deverá ser enviado nas tags "itemCode" e "quantity", respectivamente, o código do item </span><span lang="PT-BR" style="mso-bidi-font-size: 12.0pt; line-height: 107%; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin; color: black; mso-themecolor: text1; mso-fareast-language: PT-BR;">que será devolvido, além da quantidade (que poderá ser total ou parcial),</span>

<span lang="PT-BR" style="font-family: Wingdings; mso-fareast-font-family: Wingdings; mso-bidi-font-family: Wingdings; color: black; mso-themecolor: text1; mso-fareast-language: PT-BR;"><span style="mso-list: Ignore;">Ø<span style="font: 7.0pt 'Times New Roman';"> </span></span></span><span lang="PT-BR" style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin; color: black; mso-themecolor: text1; mso-fareast-language: PT-BR;">Nas chamadas do TaaS também é enviado a tag **“referenceIDItem”**, essa marcação serve para indicar qual é o item da NF que está sendo devolvido. </span>

<span lang="PT-BR" style="mso-bidi-font-size: 12.0pt; line-height: 107%; font-family: Wingdings; mso-fareast-font-family: Wingdings; mso-bidi-font-family: Wingdings; color: black; mso-themecolor: text1; mso-fareast-language: PT-BR;"><span style="mso-list: Ignore;">Ø<span style="font: 7.0pt 'Times New Roman';"> </span></span></span><span lang="PT-BR" style="mso-bidi-font-size: 12.0pt; line-height: 107%; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin; color: black; mso-themecolor: text1; mso-fareast-language: PT-BR;">A chamada enviada pelo TaaS vai passar pela determinação e perfil e enviar a requisição para o motor de cálculo que utilizará as informações da nota fiscal para executar os cálculos e devolver o resultado;</span>

<span lang="PT-BR" style="mso-bidi-font-size: 12.0pt; line-height: 107%; font-family: Wingdings; mso-fareast-font-family: Wingdings; mso-bidi-font-family: Wingdings; color: black; mso-themecolor: text1; mso-fareast-language: PT-BR;"><span style="mso-list: Ignore;">Ø<span style="font: 7.0pt 'Times New Roman';"> </span></span></span><span lang="PT-BR" style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin; color: black; mso-themecolor: text1; mso-fareast-language: PT-BR;">o motor receberá os campos de "cprod" e "qtrib" e considerará as informações do XML para devolução<span style="mso-tab-count: 1;"> </span>;</span>

<span lang="PT-BR" style="mso-bidi-font-size: 12.0pt; line-height: 107%; font-family: Wingdings; mso-fareast-font-family: Wingdings; mso-bidi-font-family: Wingdings; color: black; mso-themecolor: text1; mso-fareast-language: PT-BR;"><span style="mso-list: Ignore;">Ø<span style="font: 7.0pt 'Times New Roman';"> </span></span></span><span lang="PT-BR" style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin; color: black; mso-themecolor: text1; mso-fareast-language: PT-BR;">mesmo que seja enviado um determinado valor na tag "unitPrice" o mesmo será desconsiderado no cálculo, pois será usado exclusivamente o valor unitário da NF</span>

<span lang="PT-BR" style="mso-bidi-font-size: 12.0pt; line-height: 107%; font-family: Wingdings; mso-fareast-font-family: Wingdings; mso-bidi-font-family: Wingdings; color: black; mso-themecolor: text1; mso-fareast-language: PT-BR;"><span style="mso-list: Ignore;">Ø<span style="font: 7.0pt 'Times New Roman';"> </span></span></span><span lang="PT-BR" style="mso-bidi-font-size: 12.0pt; line-height: 107%; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin; color: black; mso-themecolor: text1; mso-fareast-language: PT-BR;">Os campos de CFOP e CST serão retornados conforme a informação da tabela de “Gestão de Devolução” no cockpit;</span>

<span lang="PT-BR" style="font-family: Wingdings; mso-fareast-font-family: Wingdings; mso-bidi-font-family: Wingdings; color: black; mso-themecolor: text1; mso-fareast-language: PT-BR;"><span style="mso-list: Ignore;">Ø<span style="font: 7.0pt 'Times New Roman';"> </span></span></span><span lang="PT-BR" style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin; color: black; mso-themecolor: text1; mso-fareast-language: PT-BR;">Para calcular os valores referente o Pis e Cofins:<span style="mso-tab-count: 2;"> </span></span>

<span lang="PT-BR" style="font-size: 11.0pt; font-family: 'Calibri',sans-serif; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: Calibri; mso-fareast-theme-font: minor-latin; mso-hansi-theme-font: minor-latin; mso-bidi-theme-font: minor-latin; color: black; mso-themecolor: text1; mso-fareast-language: PT-BR;">Quando tem o bloco de Pis e Cofins na NF:<span style="mso-tab-count: 1;"> </span></span>

<span lang="PT-BR" style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin; color: black; mso-themecolor: text1; mso-fareast-language: PT-BR;">- O motor utiliza o vBC/quantidade total \* quantidade devolvida</span>

<span lang="PT-BR" style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin; color: black; mso-themecolor: text1; mso-fareast-language: PT-BR;">- aplica as alíquotas de Pis e Cofins que também foram enviadas no documento</span>

<span lang="PT-BR" style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin; color: black; mso-themecolor: text1; mso-fareast-language: PT-BR;">- calcula os valores e devolve nas tags correspontes ("rate", "value" e "taxable")</span>

<span lang="PT-BR" style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin; color: black; mso-themecolor: text1; mso-fareast-language: PT-BR;">Quando não tem o bloco de Pis e Cofins<span style="mso-spacerun: yes;"> </span>na NF:<span style="mso-tab-count: 1;"> </span></span>

<span lang="PT-BR" style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin; color: black; mso-themecolor: text1; mso-fareast-language: PT-BR;"><span style="mso-spacerun: yes;"> </span>O motor de cálculo irá calcular a base de cálculo que basicamente deve ser (valor unitário x quantidade devolvida)</span>

<span lang="PT-BR" style="font-family: Wingdings; mso-fareast-font-family: Wingdings; mso-bidi-font-family: Wingdings; color: black; mso-themecolor: text1; mso-fareast-language: PT-BR;"><span style="mso-list: Ignore;">Ø<span style="font: 7.0pt 'Times New Roman';"> </span></span></span><span lang="PT-BR" style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin; color: black; mso-themecolor: text1; mso-fareast-language: PT-BR;">O TaaS deverá receber esse valor nas tags "otherBaseAmount" ou "exemptedBaseAmount", de acordo com o CST previsto nas definições do TaaS;</span>

<span lang="PT-BR" style="font-family: Wingdings; mso-fareast-font-family: Wingdings; mso-bidi-font-family: Wingdings; color: black; mso-themecolor: text1; mso-fareast-language: PT-BR;"><span style="mso-list: Ignore;">Ø<span style="font: 7.0pt 'Times New Roman';"> </span></span></span><span lang="PT-BR" style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin; color: black; mso-themecolor: text1; mso-fareast-language: PT-BR;">Nas devoluções, o motor não considera o parâmetro "gross or net", <span style="mso-spacerun: yes;"> </span>portanto, não há diferenciação entre cálculo net ou gross.</span><span lang="PT-BR" style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin; color: black; mso-themecolor: text1; mso-fareast-language: PT-BR;"> </span>

<span lang="PT-BR" style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin; color: black; mso-themecolor: text1; mso-fareast-language: PT-BR;"> </span>

<span lang="PT-BR" style="font-size: 11.0pt; line-height: 107%; font-family: 'Calibri',sans-serif; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: Calibri; mso-fareast-theme-font: minor-latin; mso-hansi-theme-font: minor-latin; mso-bidi-theme-font: minor-latin; color: black; mso-themecolor: text1; mso-fareast-language: PT-BR;">Marcações no Cockpit – Configuração do Tax Engine:</span>

<span lang="PT-BR" style="font-family: Wingdings; mso-fareast-font-family: Wingdings; mso-bidi-font-family: Wingdings; color: black; mso-themecolor: text1; mso-fareast-language: PT-BR;"><span style="mso-list: Ignore;">ü<span style="font: 7.0pt 'Times New Roman';"> </span></span></span><span lang="PT-BR" style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin; color: black; mso-themecolor: text1; mso-fareast-language: PT-BR;">"**devolucaoParcialXML**" – Se estiver ativa, será retornado na chamada apenas o item que for indicado no campo itemCode ou cprod, ou seja os demais itens do XML ou base64, deverão ser desconsiderados;</span>

<span lang="PT-BR" style="font-family: Wingdings; mso-fareast-font-family: Wingdings; mso-bidi-font-family: Wingdings; color: black; mso-themecolor: text1; mso-fareast-language: PT-BR;"><span style="mso-list: Ignore;">ü<span style="font: 7.0pt 'Times New Roman';"> </span></span></span><span lang="PT-BR" style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin; color: black; mso-themecolor: text1; mso-fareast-language: PT-BR;">"**buscacProdXML**" – Se estiver ativa, deverá identificar no XML ou base64 enviado qual o cProd correspondente ao cProd enviado na chamada, devendo ignorar o ID enviado na chamada;</span>

<span lang="PT-BR" style="font-family: Wingdings; mso-fareast-font-family: Wingdings; mso-bidi-font-family: Wingdings; color: black; mso-themecolor: text1; mso-fareast-language: PT-BR;"><span style="mso-list: Ignore;">ü<span style="font: 7.0pt 'Times New Roman';"> </span></span></span><span lang="PT-BR" style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin; color: black; mso-themecolor: text1; mso-fareast-language: PT-BR;">"**FederalDevolucaoXML**" – Se estiver ativa, deverá buscar na tabela do Cockpit (Gestão de Devolução), um registro considerando:</span>

<span lang="PT-BR" style="font-family: 'Courier New'; mso-fareast-font-family: 'Courier New'; color: black; mso-themecolor: text1; mso-fareast-language: PT-BR;"><span style="mso-list: Ignore;">o<span style="font: 7.0pt 'Times New Roman';"> </span></span></span><span lang="PT-BR" style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin; color: black; mso-themecolor: text1; mso-fareast-language: PT-BR;">1. registro vigente e ativo na data do cálculo;</span>

<span lang="PT-BR" style="font-family: 'Courier New'; mso-fareast-font-family: 'Courier New'; color: black; mso-themecolor: text1; mso-fareast-language: PT-BR;"><span style="mso-list: Ignore;">o<span style="font: 7.0pt 'Times New Roman';"> </span></span></span><span lang="PT-BR" style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin; color: black; mso-themecolor: text1; mso-fareast-language: PT-BR;">2. Busca das linhas da tabela de acordo com as condições cadastradas;</span>

<span lang="PT-BR" style="font-family: 'Courier New'; mso-fareast-font-family: 'Courier New'; color: black; mso-themecolor: text1; mso-fareast-language: PT-BR;"><span style="mso-list: Ignore;">o<span style="font: 7.0pt 'Times New Roman';"> </span></span></span><span lang="PT-BR" style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin; color: black; mso-themecolor: text1; mso-fareast-language: PT-BR;">3. Se encontrar um registro, o retorno das tags "CFOP" e "CST" serão alterados, considerando as informações da tabela</span>

<span lang="PT-BR" style="font-size: 11.0pt; font-family: 'Calibri',sans-serif; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: Calibri; mso-fareast-theme-font: minor-latin; mso-hansi-theme-font: minor-latin; mso-bidi-theme-font: minor-latin; color: black; mso-themecolor: text1; mso-fareast-language: PT-BR;">Dessa forma o cliente tem autonomia para definir as informações de CFOP e CST na devolução.</span>