Added total calories as a column to stock overview (references #1058)

This commit is contained in:
Bernd Bestel
2020-11-11 22:38:01 +01:00
parent 0a600d3277
commit 0c8b6c55c1
3 changed files with 12 additions and 3 deletions

View File

@@ -20,7 +20,9 @@ SELECT
sc.is_aggregated_amount,
sc.amount_opened_aggregated,
sc.amount_aggregated,
p.calories
p.calories AS product_calories,
sc.amount * p.calories AS calories,
sc.amount_aggregated * p.calories AS calories_aggregated
FROM (
SELECT *
FROM stock_current
@@ -55,7 +57,9 @@ SELECT
sc.is_aggregated_amount,
sc.amount_opened_aggregated,
sc.amount_aggregated,
p.calories
p.calories AS product_calories,
sc.amount * p.calories AS calories,
sc.amount_aggregated * p.calories AS calories_aggregated
FROM (
SELECT *
FROM stock_current