It appears that shipping tax is always rounded separately from the rest of the order. This is fine if the tax type is supposed to round at the order item level; however, if rounding at order level this can result in an incorrect price. The shipping tax type should honor the configuration of the tax type and round appropriately.

If this rounding order is intentional, we should provide an option to make it configurable on the shipping tax type.

CommentFileSizeAuthor
#5 3116764-5.patch823 bytesinit90
Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

rwanth created an issue. See original summary.

rwanth’s picture

Example:

OrderItem1: 6.66
OrderItem2: 5.55
Shipping: 4.44

An 8% tax rate:
0.5328
0.444
0.3552

Rounding at order item:
0.53 + 0.44 + 0.36 = 1.33

Round at order level (expected):
0.5328 + 0.444 + 0.3552 = 1.332, rounds to 1.33

Round at order level (actual):
round(0.5328 + 0.444) + round(0.3552)
0.98 + 0.36 = 1.34

init90 made their first commit to this issue’s fork.

init90’s picture

StatusFileSize
new823 bytes

I can confirm that issue described here is still valid.

init90’s picture

Status: Active » Needs review

jsacksick made their first commit to this issue’s fork.

  • jsacksick committed 196c26d9 on 8.x-2.x authored by init90
    Issue #3116764 by init90, rwanth: Shipping tax should honor tax type's...
jsacksick’s picture

Status: Needs review » Fixed

  • jsacksick committed 2bdf56b0 on 8.x-2.x
    Issue #3116764 followup: Round tax adjustments only when configured to...

Status: Fixed » Closed (fixed)

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