Allow adjustment types to be declared as "taxable"

Created on 5 December 2019, almost 5 years ago
Updated 18 December 2023, 11 months ago

Picking up from the work done on https://www.drupal.org/project/commerce/issues/2897190

The taxation logic is currently hard-coded to include only fee and discount adjustments, making it impossible for new adjustment types to be taxed.

Given that there's API available for adding new adjustment types, I think it makes sense to allow them to specify what kind of services they support (e.g. tax), rather than being forced to create custom tax adjustment processors and reduplicating logic in a custom module.

It also makes the custom logic less cumbersome as you can check against the adjustment type rather than using fee and then checking against the label or source ID to see if it's of the type we added.

📌 Task
Status

Needs review

Version

2.0

Component

Tax

Created by

Live updates comments and jobs are added and updated live.
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.

  • 🇭🇷Croatia valic Osijek

    Landing from a related issue, I hit a problem with tax and a new adjustment type.

    I'm unsure if #5 and depending on weight vs. adding taxable is a more considerable change.

    But as I see it, both are BC, because we would need to change how the price is collected prior to applying taxes
    $adjusted_total_price = $order_item->getAdjustedTotalPrice(['promotion', 'fee']);

    #5 with weight could be a more straightforward approach. Still, I am unsure if contrib modules are considered tax when declaring the weight of adjustment (I did not think of taxes when creating the adjustment type with weight 10).

    Adding taxable property seems as more self-documented approach.

  • 🇮🇱Israel jsacksick

    When getting the adjusted total price, even if we'd consider other adjustment types, it'd still be dependent on the priority of order processors... In other words, if an adjustment hasn't been added yet by a processor, the adjustments it may add won't be considered by the tax logic as these wouldn't be present.

Production build 0.71.5 2024