How can we place an order with the VAT deducted (excluded)?
The case is this. We have customers that can provide a VAT number and if the number is valid the VAT should be deducted (excluded) when placing an order. There’s no need to show the prices in the store without VAT. VAT amounts should still be on the order but the order total should be without VAT.
And payment authorization and capture and so on should be done with VAT excluded.
To change the site to display prices excluding VAT you can use the cartcontext if not already set on the channel.
cartContext.ChangeShowPricesWithVatAsync(false);
If you do this all prices should be displayed excluding VAT but the litium order always includes VAT. You can choose to show the total in the checkout excluding VAT.
Instead of order.GrandTotal you show GrantTotal - TotalVAT.
The payment provider will get both excluding and includ VAT price so it would be on their side how to charge the customer. I would assume that if using for example klarna checkout for bussiness the klarna charges excluding VAT.
Can you explain what VAT deducted (excluded) means in practice?
On an order you have Order.GrandTotal and Order.TotalVAT.
OrderGrandTotal always include VAT but if you deduct Order.TotalVAT you get order total without VAT. But you can not place and order without VAT information.
If the paymentprovider support this probably depends on you paymentprovider.
The thing is that in Sweden the companies buy stuff and pay the VAT and then do the deduction. In other parts of the world this is not how it works, if I understand correctly. The VAT is deducted (excluded) from the order directly so that the company doesn’t pay the VAT when placing the order.
However the order needs to have the VAT information on it because we need to report the VAT regularly to the countries VAT handling instances.
From that requirement the order in litium has all the information that you need.
Since you don’t need to show prices without VAT it is just perhaps the checkout you need to change if there is something there you want to display in another way. if you do not want to change the cart to “ShowPricesWithVat” = false then there are probably more things you want to change.
As for the payment, again it depend on the paymentprovider. They get the information to go both ways with the VAT payment.
How we display things on the web is not the issue here. That should be pretty easy to fix.
When it comes to how the order is created and how the payment is done I’m guessing we need some help from Litium here. @patric.forsgard@anusha.ganegoda maybe?
We’re using the Litium Adyen payment app and looking at what the app sends to Adyen when doing an authorisation the only amount sent is the total amount of the order, nothing about VAT, so Adyen could not possibly know how to do an authorisation of any other amount that the total.
This means that it all comes down to how the order is created in Litium.
So the questions to Litium are:
Is the Litium system built to handle VAT deduction?
If so…
Is this only possible in a B2B setup of Litium?
Can VAT deduction be done per order or customer in a B2C setup?
Just a correction about a thing a wrote above. I wrote “However the order needs to have the VAT information on it because we need to report the VAT regularly to the countries VAT handling instances”. Seems like this is not needed. Today we’re just placing an order with 0% VAT if the customer provides a valid VAT number.
Unfortunately, Litium does not have this functionality as at now, in the exact way it is described here. The reason is, the requirement is to show the VAT in the order, but not include the VAT in the total. The way to do this is to put a new negative row, that is equivalent to the total VAT amount. However, the row type should be “Tax”, so that it will not be attracting the VAT again. Litium does not have this row type and to treat VAT in this way as at now.
What if we skip the requirement that the VAT should still be shown on the order and just place a zero VAT order instead. Meaning that there will be no VAT amounts stated on the order. Where and how would be the correct way of doing that in Litium 8?
We’ve solved this by decorating IPriceCalculator.GetListPrices(). Basically this is the only code we need:
var prices = _parentCalculator.GetListPrices(calculatorArgs, itemArgs);
var vatRate = 0; // TODO: Get correct VAT rate for your use case
if (vatRate != null && vatRate >= 0)
{
foreach (var price in prices)
{
price.Value.VatRate = vatRate.Value;
price.Value.PriceIncludingVat = price.Value.PriceExcludingVat.IncludeVat(vatRate.Value);
#pragma warning disable CS0618 // Type or member is obsolete
price.Value.ListPriceWithVat = price.Value.ListPrice.IncludeVat(vatRate.Value);
#pragma warning restore CS0618 // Type or member is obsolete
}
}
return prices;
This however affects how VAT is displayed on the site. This can be solved by calculating the VAT separately when building the price model/product item/cart row. Either get the VAT rate for the product, or get the default VAT rate for the current country, which can then be used to calculate the VAT for that specific product and displayed separately from the ProductPriceModel view.
This seems to be working great, thanks. The VAT is not removed for the shipping cost though. Is there a similar interface as IPriceCalculator but for delivery/shipping cost calculation that we can decorate?
Noticed another thing as well. Looking in the database on the order rows the VatDetails still says amountIncludingVat and an amount. How do we get that to be correct?
Maybe @anusha.ganegoda have some input here? Would you say that the suggestion above is a recommended solution for this? Or is there an other recommended way to do this? That also works for the delivery/shipping cost and also makes the VatDetails on the order rows show the correct information?