Added Default store as a column to the shopping list (closes #957)

This commit is contained in:
Bernd Bestel
2020-12-20 10:26:02 +01:00
parent 268b8e87d7
commit 76e4a1578c
4 changed files with 12 additions and 4 deletions

View File

@@ -7,7 +7,8 @@ SELECT
sl.*,
p.name AS product_name,
plp.price * IFNULL(qucr.factor, 1.0) AS last_price_unit,
plp.price * IFNULL(qucr.factor, 1.0) * sl.amount AS last_price_total
plp.price * IFNULL(qucr.factor, 1.0) * sl.amount AS last_price_total,
st.name AS default_shopping_location_name
FROM shopping_list sl
LEFT JOIN products p
ON sl.product_id = p.id
@@ -16,4 +17,6 @@ LEFT JOIN quantity_unit_conversions_resolved qucr
AND p.qu_id_stock = qucr.from_qu_id
AND sl.qu_id = qucr.to_qu_id
LEFT JOIN products_last_purchased plp
ON sl.product_id = plp.product_id;
ON sl.product_id = plp.product_id
LEFT JOIN shopping_locations st
ON p.shopping_location_id = st.id;