DARKF3D3 Posted April 2, 2019 Share Posted April 2, 2019 On PS1.6 I was using this query to get total sale of a month grouped by day. Now I'm on PS1.7 and I'm now sure this is still correct. I have have this doubt because on Back office dashboard total sale are about 10/15% lower (both them calculated including VAT). SELECT DATE(o.invoice_date), COUNT(*) as countOrders, SUM((SELECT SUM(od.product_quantity) FROM ps_order_detail od WHERE o.id_order = od.id_order)) as countProducts, SUM(o.total_paid_tax_incl / o.conversion_rate) as totalSales FROM ps_orders o WHERE o.valid = 1 AND o.invoice_date BETWEEN '2019/01/01' and '2019/01/31' GROUP BY DATE(o.invoice_date) Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now