When you have non-product line items (such as shipping or custom fees) in an order and they have inclusive taxes, altering the prices from the order admin UI does not recalculate their taxes (unlike with product line items).

This is because the recalculation function commerce_tax_commerce_line_item_rebase_unit_price() checks that the first component name is "base_price", which is not true for non-product line items even though they too need recalculating.

Attached patch simply removes the check. I can't think of any situation where the check would be needed, myself, is there one?

CommentFileSizeAuthor
tax-non-product-alter-inclusive-taxes.patch782 bytesAnssiH

Comments

AnssiH created an issue. See original summary.

Status: Needs review » Needs work

The last submitted patch, tax-non-product-alter-inclusive-taxes.patch, failed testing.

AnssiH’s picture

Status: Needs work » Needs review

Hmm, the test works fine locally. The log suggests there was an issue enabling the 'menu' module, which should be entirely unrelated to the patch. Re-marking as Needs review, feel free to tell me if I'm wrong and the failure is real :)

rszrama’s picture

Category: Bug report » Task

It's hard to say. I believe the restriction here is because core Drupal Commerce only knows how to tax product line items, which always do have a base_price component. The solution might rather be to add related support in the other line item type defining modules for rebasing unit prices.

chris matthews’s picture

The 3 year old patch to commerce_tax.module applied cleanly to the latest commerce 7.x-1.x-dev, but needs additional reviews.