I cannot seem to get the tax right on my query when there are multiple quantities of the same product. You can see by the attached image what I am referring to. I am also including the query so hopefully you can help me correct the error. Everything works fine on this query with the exception above. Thanks.
SELECT
O.order_number,
DATE_FORMAT(DATE_ADD('1970-01-01', INTERVAL O.order_created SECOND), '%d %b %y') AS OrderCreated,
IF(O.order_shipping_price <> 0.00, FORMAT(O.order_shipping_price, 2), '-') AS Shipping,
IF(O.order_discount_price <> 0.00, FORMAT(O.order_discount_price, 2), '-') AS Discount,
FORMAT(O.order_full_price, 2) AS TotalPrice,
County.zone_name AS County,
State.zone_name AS State,
FORMAT(SUM(OP.order_product_tax), 2) AS Tax
FROM
#__hikashop_order O LEFT JOIN #__hikashop_address A
ON O.order_billing_address_id = A.address_id
LEFT JOIN #__hikashop_zone County
ON A.address_state = County.zone_namekey
LEFT JOIN #__hikashop_zone State
ON A.address_country = State.zone_namekey
LEFT JOIN #__hikashop_order_product OP
ON O.order_id = OP.order_id
WHERE
DATE_ADD('1970-01-01', INTERVAL O.order_created SECOND) BETWEEN '2013-07-01 00:00:00' AND '2013-07-31 23:59:59'
GROUP BY
O.order_id
ORDER BY
O.order_created ASC