Respect the store's tax setting

Created on 23 December 2020, almost 4 years ago
Updated 3 October 2023, about 1 year ago

There is no option for the shipping rate to set the amount with tax included/excluded. Currently the entered rate amount is handled as a price inclusive tax.
Let's respect the store's tax setting for entered prices.

🐛 Bug report
Status

Needs work

Version

2.0

Component

Code

Created by

🇧🇪Belgium timlie

Live updates comments and jobs are added and updated live.
  • Needs tests

    The change is currently missing an automated test that fails when run with the original code, and succeeds when the bug has been fixed.

Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • 🇬🇧United Kingdom guy_schneerson

    Found what looks like a related issue https://www.drupal.org/project/commerce_shipping/issues/3391283 The "Display taxes of this type inclusive in product prices" is used for more than just display Active

  • 🇷🇴Romania cslevy

    After the last update (2.8 -> 2.9) this patch isn't working properly. (The shipping is increased every time the order is saved)

    I created a new patch, which works, I'm not sure, if it's the correct way to handle this, or if works in all cases.

    Feel free to adjust/reroll.

  • 🇧🇪Belgium weseze

    There is something seriously wrong with the tax calculation in this module... I had to use patch #6 to make it work, but I also think this is not covering all cases. It just works for my specific case.

    I have the store setup with prices including EU tax rate.
    I have a custom tax resolver that checks user profile for tax rate. All orders are placed with logged in users and are B2B within the EU. So same country orders have to include tax, other countries don't.

    Problem 1:
    The shipping cost was set up without included TAX, but inherits from the store/tax settings (which say it should be included) There is no option to choose this per shipping method.... This is not incorrect, but confusing... I expected to able to chose this per shipping method.

    Problem 2:
    In the total calculation the shipping cost is shown before the tax cost. But the shipping cost shown already includes the tax... Very confusing for the end user. The same problem applies to the line-items, so this might by a commerce "design-choice".

    Problem 3:
    When my custom taxresolver returns a no-tax policy for the current user, the shipping cost is still calculated as the original entered amount, which includes tax. Taxes should be subtracted here, because customer does not pay taxes.

    So, I managed to fix the issue with patch #6, but it feels like this is going to be something that is going to break or need updating and testing on every commerce update...
    It is also technically wrong for me now, since shipping costs are entered as being prices with tax included, but now, with this patch, they are not... But it works because if you pay no taxes (0%) the tax amount subtracted is also 0...

Production build 0.71.5 2024