mirror of
https://github.com/grocy/grocy.git
synced 2025-08-18 03:25:50 +00:00
Added total calories as a column to stock overview (references #1058)
This commit is contained in:
@@ -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
|
||||
|
@@ -10,7 +10,8 @@
|
||||
{ 'visible': false, 'targets': 8 },
|
||||
{ 'visible': false, 'targets': 2 },
|
||||
{ 'visible': false, 'targets': 4 },
|
||||
{ 'visible': false, 'targets': 9 }
|
||||
{ 'visible': false, 'targets': 9 },
|
||||
{ 'visible': false, 'targets': 10 }
|
||||
],
|
||||
});
|
||||
|
||||
|
@@ -161,6 +161,7 @@
|
||||
<th class="d-none">Hidden status</th>
|
||||
<th class="d-none">Hidden product group</th>
|
||||
<th>{{ $__t('Calories') }}</th>
|
||||
<th>{{ $__t('Calories') }} ({{ $__t('Per stock quantity unit') }})</th>
|
||||
|
||||
@include('components.userfields_thead', array(
|
||||
'userfields' => $userfields
|
||||
@@ -367,6 +368,9 @@
|
||||
<td class="d-none">
|
||||
xx{{ $currentStockEntry->product_group_name }}xx
|
||||
</td>
|
||||
<td>
|
||||
<span class="locale-number locale-number-generic">{{ $currentStockEntry->product_calories }}</span>
|
||||
</td>
|
||||
<td>
|
||||
<span class="locale-number locale-number-generic">{{ $currentStockEntry->calories }}</span>
|
||||
</td>
|
||||
|
Reference in New Issue
Block a user