Say you have a sales tax of 5.125% and an item with a unit price of $0.34. If you buy 100 of those items and have 'Round tax at the order item level' on, then the tax amount will be $2.00. If you turn the 'Round tax at the order item level off', the tax is $1.7425. Then, when trying to capture payment using Braintree (I haven't tested other payment gateways) you'll get an error because the 'Amount' is invalid. Commerce sends an amount that isn't rounded ($35.7425).

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

ryross created an issue. See original summary.

MegaChriz’s picture

flocondetoile’s picture

If you round tax at the order level then you should get errors too, in the case the order contains several order item with a tax rate different. May be the tax should be rounded at the level of the order item, but on the total price, not on the unit price of the order item. Thoughts ?

bojanz’s picture

Title: Tax should be rounded at the order level, not the order item level » Order-level adjustment rounding is not performed
Version: 8.x-2.0 » 8.x-2.x-dev
Priority: Normal » Major
Issue tags: -tax, -price adjustments

Clarifying the title. We already have a setting on the tax type about order item / order rounding, the problem is just that the order part is not implemented.

mortona2k’s picture

This is just a hack to round the order total.

mortona2k’s picture

This one rounds each adjustment before adding to total.

bojanz’s picture

Assigned: Unassigned » bojanz

#2943961: Create a AdjustmentTransformer service for combining/sorting/rounding adjustments has added the necessary API functions for this, now we just need to use them.

  • bojanz committed de2a698 on 8.x-2.x
    Issue #2928828 by mortona2k, bojanz: Order-level adjustment rounding is...
bojanz’s picture

Status: Active » Fixed

Done. Thanks, everyone.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.