mirror of
https://github.com/grocy/grocy.git
synced 2026-04-04 20:06:16 +02:00
Fixes blank/missing items in spending report
Use left (outer) join when connecting product to optional product group
This commit is contained in:
parent
99f448dd64
commit
4b668a00ec
|
|
@ -44,7 +44,7 @@ class StockReportsController extends BaseController
|
||||||
FROM products_price_history pph
|
FROM products_price_history pph
|
||||||
JOIN products p
|
JOIN products p
|
||||||
ON pph.product_id = p.id
|
ON pph.product_id = p.id
|
||||||
JOIN product_groups pg
|
LEFT JOIN product_groups pg
|
||||||
ON p.product_group_id = pg.id
|
ON p.product_group_id = pg.id
|
||||||
WHERE $where
|
WHERE $where
|
||||||
GROUP BY p.id, p.name, pg.id, pg.name
|
GROUP BY p.id, p.name, pg.id, pg.name
|
||||||
|
|
@ -61,7 +61,7 @@ class StockReportsController extends BaseController
|
||||||
FROM products_price_history pph
|
FROM products_price_history pph
|
||||||
JOIN products p
|
JOIN products p
|
||||||
ON pph.product_id = p.id
|
ON pph.product_id = p.id
|
||||||
JOIN product_groups pg
|
LEFT JOIN product_groups pg
|
||||||
ON p.product_group_id = pg.id
|
ON p.product_group_id = pg.id
|
||||||
WHERE $where
|
WHERE $where
|
||||||
GROUP BY pg.id, pg.name
|
GROUP BY pg.id, pg.name
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user