On odd numbered subtotals, the subtotal minus discount is off by +1cent. This is due to a rounding issue on the line item that gets inserted into the db table {uc_order_line_items}. Patch to follow soon.

CommentFileSizeAuthor
#1 patch.patch601 bytesjaydubb181
screen2.jpg37.26 KBjaydubb181

Comments

jaydubb181’s picture

StatusFileSize
new601 bytes

Here's a patch that will resolve this issue.

jaydubb181’s picture

Status: Active » Needs review
longwave’s picture

Status: Needs review » Fixed

I can see the problem - 8.95 - 0.895 = 8.055, the last two when rounded for display become 0.90 and 8.06 - but uc_order_line_items stores prices to 5dp on purpose so more precision is available.

I suspect there are similar issues in other modules, suggesting this should somehow be fixed elsewhere in Ubercart, but for now I have applied your patch with a change to round it to the store precision (set at /admin/store/settings/store/edit/format under "Currency format") rather than 2.

Status: Fixed » Closed (fixed)

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