Posted on 28/01/2022 15:24:15
Hi Soren,
yes, the VatPercent field is a calculated field and it uses the Order VAT and PriceWithoutVat fields values for calculation.
In the standard Live Integration code those values are set in those lines of code:
var orderPriceNode = orderNode.SelectSingleNode("column [@columnName='OrderPrice']");
if (orderPriceNode == null)
{
orderPriceNode = orderNode.SelectSingleNode("column [@columnName='OrderPriceWithVat']");
}
if (orderPriceNode != null)
{
order.Price.PriceWithVAT = Helpers.ToDouble(orderPriceNode.InnerText);
}
var orderPriceWithoutVatNode = orderNode.SelectSingleNode("column [@columnName='OrderPriceWithoutVat']");
if (orderPriceWithoutVatNode != null)
{
order.Price.PriceWithoutVAT = Helpers.ToDouble(orderPriceWithoutVatNode.InnerText);
}
if (order.Price.PriceWithVAT > 0 && order.Price.PriceWithoutVAT > 0)
{
order.Price.VAT = order.Price.PriceWithVAT - order.Price.PriceWithoutVAT;
}
So you can check your custom Live Integration code in the OrderHandler.cs and also you need to check what prices are in the response from NAV codeunit:
if the order prices are correct With/Without VAT in the response and also the xml tags form the NAV response and in the OrderHandler.cs.
On the screenshot you made it shows that the order price with Vat and price without VAT is the same number, so that is why VAT percent is 0.
BR, Dmitrij