on 2017 Aug 15 5:20 PM
Hi Experts,
Could you please guide me, how I can remove the tax on delivery cost.
OOTB Scenario:
Add product to the cart (product has gross pricing - price 1000$ which includes tax 100$)
Verifty subtotal = total = 1000$
Navigate to checkout page, select delivery address, Select delivery mode (standard delivery 50 $ gross price)
Verify subtotal = 1000$, delivery charge = 50$, total = 1050$
Below the order total, you can see 'Your order contains 105$ tax'
Technically what is happening, (Service: DefaultCalculationService, Method: getTaxCorrectionFactor)
Check if total & subtotal are same ? (1050 != 1000)
If not, loadfactor = total / subtotal. (loadfactor = 1.05)
The taxvalue is multiplied by this loadfactor (tax = 100 * 1.05 = 105)
Is there a way, I can get rid of tax being applied on delivery cost ?
Overriding the standard method is the last option I am thinking to take. As this is pretty much practical scenario where we don't want to charge tax on delivery cost, has anyone faced this ? What's the resolution ?
-Regards, Nitin
Hi Nitin,
I assume you are using B2C accelerator. i.e. it shows all prices and costs as Gross. Because this is meant to show the customer the final price/cost he has to pay including any applicable taxes. Since the product prices and delivery costs are configured as 'Gross', it displays them as total prices which includes taxes, taxes are calculated accordingly and shown.
I am not sure how you want to handle tax calculations on delivery costs in your usecase. Are you going to display only net cost for delivery?
I assume you will handle that somehow.
During the checkout, the displayed delivery modes are provided by
deliveryService.getSupportedDeliveryModeListForOrder(..)
which returns only the delivery modes that are applicable for the country AND 'gross' (because the Order is 'Gross'). So if you configure the ZoneDeliveryMode as 'Net', then it will not be shown.
Even after you extend this to show all delivery modes, the CalculationService will reset all additional costs during calculation. If the price/cost is net, then taxes will be applied on top,if Gross, the taxes are adjusted on the price/cost.
I am afraid, it is not possible to change this behavior with any simple configuration. You may have to extend the DefaultCalculationService (possible resetAdditionalCosts() method)
Best
Shanmugaraja
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank you very much and really appreciate the answer in detail!
Before the delivery mode is selected, product: 1000$ subtotal:1000$ total:1000$ "order contains 100$ tax" Now after the delivery mode is selected, delivery cost of 50$ is applied. This is gross price, including tax. WHY there is a need to adjust the tax ? If the tax needs to be adjusted, why only considering tax on product ? If the product is exempted from tax, or it has zero tax, there would not be any tax on delivery cost. Can I maintain tax on delivery cost OOTB? or it will always consider the tax applied on product?
When you say the product price is 100 (net), then the final cost of the Product is 100+taxes and taxes will be calculated based on the tax rate(which is based on delivery zones).
When you say the product price is 100(gross), this is final price for the customer including all taxes. i.e. net price of the Product is ~90.90 (assuming 10% tax rate). i.e. it is just showing how much is the tax amount out of the total price(100).
Even delivery cost incur taxes, so similar logic is applied here as well.
If a Product is tax-free, then you need to set the correct taxgrou/rate to that Product.
Instead, you can use the normal taxe modes(Gross),do not extend DeliveryService. Just extend the DefaultCalculationService as below:
From:
protected void calculateTotals(final AbstractOrderModel order, final boolean recalculate,
final Map<TaxValue, Map<Set<TaxValue>, Double>> taxValueMap) throws CalculationException
{
if (recalculate || orderRequiresCalculationStrategy.requiresCalculation(order))
{
..
..
// taxes
final double totalTaxes = calculateTotalTaxValues(//
order, recalculate, //
digits, //
getTaxCorrectionFactor(taxValueMap, subtotal, total, order), //
taxValueMap);//
To:
protected void calculateTotals(final AbstractOrderModel order, final boolean recalculate,
final Map<TaxValue, Map<Set<TaxValue>, Double>> taxValueMap) throws CalculationException
{
if (recalculate || orderRequiresCalculationStrategy.requiresCalculation(order))
{
..
..
// taxes
final double totalTaxes = calculateTotalTaxValues(//
order, recalculate, //
digits, //
getTaxCorrectionFactor(taxValueMap, subtotal, total - order.getDeliveryCost().doubleValue(), order), //
taxValueMap);//
This will make sure the tax correction factor will NOT consider the delivery costs
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
On the ZoneDeliveryMode you can configure whether your pricing is net or gross, it's OOTB functionality
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
31 | |
2 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.