Reports->sales->orders
Posted: Thu Mar 31, 2016 5:31 pm
Hi,
We are facing a big issue in reports 2.1.0.2 almost latest version if we have too many customers , orders and products. It shows Internal Server Error when we opens this link admin/index.php?route=report/sale_order ... same query used on dashboard also so sometime we are not able to login also. What i figured out there is some issue in admin/model/report/sale in following query
$sql = "SELECT MIN(o.date_added) AS date_start, MAX(o.date_added) AS date_end, COUNT(*) AS `orders`, SUM((SELECT SUM(op.quantity) FROM `" . DB_PREFIX . "order_product` op WHERE op.order_id = o.order_id GROUP BY op.order_id)) AS products, SUM((SELECT SUM(ot.value) FROM `" . DB_PREFIX . "order_total` ot WHERE ot.order_id = o.order_id AND ot.code = 'tax' GROUP BY ot.order_id)) AS tax, SUM(o.total) AS `total` FROM `" . DB_PREFIX . "order` o";
if i remove SUM of sum queries then it starts working. same issue was in older versions also forum.opencart.com/viewtopic.php?f=20&t=20611 . Kindly help me if someone know this issue.
Thanks in advance.
We are facing a big issue in reports 2.1.0.2 almost latest version if we have too many customers , orders and products. It shows Internal Server Error when we opens this link admin/index.php?route=report/sale_order ... same query used on dashboard also so sometime we are not able to login also. What i figured out there is some issue in admin/model/report/sale in following query
$sql = "SELECT MIN(o.date_added) AS date_start, MAX(o.date_added) AS date_end, COUNT(*) AS `orders`, SUM((SELECT SUM(op.quantity) FROM `" . DB_PREFIX . "order_product` op WHERE op.order_id = o.order_id GROUP BY op.order_id)) AS products, SUM((SELECT SUM(ot.value) FROM `" . DB_PREFIX . "order_total` ot WHERE ot.order_id = o.order_id AND ot.code = 'tax' GROUP BY ot.order_id)) AS tax, SUM(o.total) AS `total` FROM `" . DB_PREFIX . "order` o";
if i remove SUM of sum queries then it starts working. same issue was in older versions also forum.opencart.com/viewtopic.php?f=20&t=20611 . Kindly help me if someone know this issue.
Thanks in advance.