From a72afa7174576a0f1df9a3bd7312331aa8ade9dc Mon Sep 17 00:00:00 2001 From: Bernd Bestel Date: Sat, 5 Jan 2019 21:14:23 +0100 Subject: [PATCH] Forgot to save before pushing last commit... --- migrations/0047.sql | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/migrations/0047.sql b/migrations/0047.sql index 1cfa32a1..ccd60427 100644 --- a/migrations/0047.sql +++ b/migrations/0047.sql @@ -51,12 +51,14 @@ SELECT IFNULL(sc.amount, 0) AS stock_amount, 1 AS need_fulfilled, 0 AS missing_amount, - IFNULL(sl.amount, 0) AS amount_on_shopping_list, + IFNULL(sl.amount, 0) * p.qu_factor_purchase_to_stock AS amount_on_shopping_list, 1 AS need_fulfilled_with_shopping_list, rp.qu_id FROM recipes r JOIN recipes_pos rp ON r.id = rp.recipe_id +JOIN products p + ON rp.product_id = p.id LEFT JOIN ( SELECT product_id, SUM(amount + amount_autoadded) AS amount FROM shopping_list