Documentação Geral
Motor de cálculo – Cálculo do valor gross considerando o valor da margem de lucro para casos com impAtiv=1
Cálculo do valor gross considerando o valor da margem de lucro para casos com impAtiv=1
Por Henrique Moreira
Hoje no motor de cálculo para os casos em que é enviado “impAtiv=1”, é considerado o valor enviado no campo “vProduni” como o valor gross, ou seja, já com os tributos embutidos, onde a partir dele é calculado as operações.
Porém, foi feita uma implementação que, quando for recebida na requisição da chamada a informação “impAtiv=1” e o bloco Margem de lucro, receber no campo “modalidade-1”, o motor irá calcular com a margem enviada no próprio campo “margem” dentro do bloco “margemLucro”, o valor do “nvProdUni” e retornará na response, da forma que segue:
NvProdUni' = 'vProdUni'+('vProdUni'*('margemLucro'/100))
A partir do valor obtido, será calculado o valor das operações.
Abaixo segue exemplo de cálculo e retorno:
Requisição motor: |
|
|
|
Retorno requisição: |
|
Cálculo do valor retornado:
NvProdUni' = 'vProdUni'+('vProdUni'*('margemLucro'/100))
NvProdUni' = 120 +(120*(40/100))
NvProdUni' = 168.00
Gross value calculation considering the profit margin for cases with impAtiv=1
By Henrique Moreira
Currently, in the Sysyax engine, for cases where “impAtiv=1” is sent, the value provided in the “vProduni” field is considered the gross value, meaning that taxes are already included, and operations are calculated based on this value.
However, an implementation has been made so that when the request contains the information “impAtiv=1” and the Profit Margin block is included, with the “modalidade=1” field, the engine will calculate the value of “nvProdUni” using the margin sent in the “margem” field within the “margemLucro” block. It will then return the result in the response as follows:
NvProdUni' = 'vProdUni'+('vProdUni'*('margemLucro'/100))
Based on the obtained value, the value of operations will be calculated.
Below is an example of the calculation and response:
Request to the Engine: |
|
|
|
Response to the Request: |
|
Returned Value Calculation:
NvProdUni' = 'vProdUni'+('vProdUni'*('margemLucro'/100))
NvProdUni' = 120 +(120*(40/100))
NvProdUni' = 168.00
Versão do documento: 78 | Publicação: 11/14/2024 |