Forgot to save before pushing last commit...

This commit is contained in:
Bernd Bestel 2019-01-05 21:14:23 +01:00
parent 0d145bbf1e
commit a72afa7174
No known key found for this signature in database
GPG Key ID: 71BD34C0D4891300

View File

@ -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