Code: Select all
$results = $database->getRows("select name, model, sum(quantity) as quantity, sum((total + tax) * quantity) as total from order_product group by model order by total desc");
Where the query says --
Code: Select all
sum((total + tax) * quantity) as total from order_product
Changing the query to --
Code: Select all
$results = $database->getRows("select name, model, sum(quantity) as quantity, sum(total) as total from order_product group by model order by total desc");
Since there are a variety of ways that tax can be applied (eg. fixed amount, percentage, applied to the product, applied to the total order), it makes it difficult to suggest a fix. But it does beg the question, is it necessary to include taxation in this particular report?
Fido-X.