Developer forum

Forum » Integration » Prices shown without VAT

Prices shown without VAT

Thomas Overgaard Nielsen
Reply

Hi all

I am having difficulties getting prices to show including VAT when Liveintegration is in effect.

Prices in the DB are excluding VAT
When live integration is off, prices in productlist/product is shown including VAT.
However whenever I enable Liveintegration, prices are shown excluding VAT.
Once a product is added to the cart, price is shown including VAT again.

In my website settings, I have set prices to be shown including VAT
In Liveintegration I have selected the appropriate webshop.
Live product lookup returns prices without VAT

If I play around with price modifiers in the productlist template, I get:

Ecom:Product.Price.PriceWithVAT: 10.800
Ecom:Product.Price.PriceWithoutVAT: 10.800
Ecom:Product.Price.VATPercent: 25
Ecom:Product.Price.VAT: 2.700

(10.800 is the price excluding VAT)

Any ideas?


Replies

 
Jonas Krarup Dam
Reply

Hi Thomas,

When you are using the Live Integration, the values on the order are shown as they are returned from the remote system.

the logic for this can be found in the OrderHandler.cs file in the LiveIntegration project, and it looks like this:

---------

                    order.Price.Currency = Helpers.CurrentCurrency;                    

                    order.Price.PriceWithVAT = Convert.ToDouble(orderNode.SelectSingleNode("column [@columnName='OrderPriceWithVAT']").InnerText);

                    order.PriceBeforeFees.PriceWithVAT = order.Price.PriceWithVAT;

 

                    order.Price.VAT = Convert.ToDouble(orderNode.SelectSingleNode("column [@columnName='OrderPriceVAT']").InnerText);

                    order.PriceBeforeFees.VAT = order.Price.VAT;

 

                    order.Price.PriceWithoutVAT = order.Price.PriceWithVAT - order.Price.VAT;

                    order.PriceBeforeFees.PriceWithoutVAT = order.Price.PriceWithVAT;

 

                    order.SalesDiscount = Convert.ToDouble(orderNode.SelectSingleNode("column [@columnName='OrderSalesDiscount']").InnerText);

--------------

This means that all the values should be comming from the remote system.

Have you made any changes to the live integration?
If not, it sounds strange, and I would like to know which site is causing the problems, so that I can take a look at the data that is being sent back and forth between your remote system and Dynamicweb.

 

Regards, Jonas

 

 
Thomas Overgaard Nielsen
Reply

Hi Jonas

The values in the cart/on the order are shown correctly.
It is prices in the product list/on a product which are shown incorrectly (without VAT)

We do agree, that prices returned as response to a GetProductsInfo request are supposed to be excluding VAT, right?

Regards Thomas

 
Jonas Krarup Dam
Reply
This post has been marked as an answer

Hi Thomas,

 

Sorry, I missed that we where talking about the product list.

The example implemenation for the live integration only retrieves one value for the price when showing a list.

It isn't defined on the dynamicweb side if that value is with or without VAT - you should decide this with your ERP developer, to ensure that you are getting the value you need.

If you need values with and without VAT from the remote system, you need to extend the LiveIntegration project to support this. You can do so in the PrepareProductInfoProvider.cs file, where you should extend the ProcessResponse() method to add additional data to the cached PriceInfo Dictionary, and in the FindPrice() method, where you should pull the info from the PriceInfo object, and add it to the PriceRaw object that is actually used when rendering the price for the product.

 

Regards, Jonas

 

Votes for this answer: 1
 
Thomas Overgaard Nielsen
Reply

Hi Jonas

Thanks for replying.

Well in that case, everything is working per design. On second thought it is pretty obvious, that prices with and without VAT would need additional info from the ERP.
An implementation providing both prices and obeying the website-setting specifying whether prices are shown with or without VAT would make sense to me.
But looking into the LiveIntegration project, that seems pretty straight forward to implement.

Thanks for pointing out the direction.

Regards Thomas

 

You must be logged in to post in the forum