mirror of
https://github.com/grocy/grocy.git
synced 2025-04-29 17:45:39 +00:00
Add calories as a column to stock overview (references #1058)
This commit is contained in:
parent
e7491fd8d1
commit
7c8a17ce78
@ -101,6 +101,7 @@
|
||||
- Tables are horizontally scrollable (instead of collapsing columns which don't fit)
|
||||
- Table columns can now be shown/hidden (new little eye icon on the top left corner on each table)
|
||||
- There are also new columns on some pages, hidden by default
|
||||
- Stock overview: Value, product group, calories
|
||||
- Dialogs are now used everywhere where appropriate instead of jumping between pages (for exampel when adding/editing shopping list items)
|
||||
- Added a "Clear filter"-button on all pages (with filters) to quickly reset applied filters
|
||||
- The data path (previously fixed to the `data` folder) is now configurable, making it possible to run multiple grocy instances from the same directory (with different `config.php` files / different database, etc.) (thanks @fgrsnau)
|
||||
|
@ -19,7 +19,8 @@ SELECT
|
||||
(SELECT name_plural FROM quantity_units WHERE quantity_units.id = p.qu_id_purchase) AS qu_purchase_unit_name_plural,
|
||||
sc.is_aggregated_amount,
|
||||
sc.amount_opened_aggregated,
|
||||
sc.amount_aggregated
|
||||
sc.amount_aggregated,
|
||||
p.calories
|
||||
FROM (
|
||||
SELECT *
|
||||
FROM stock_current
|
||||
@ -43,7 +44,7 @@ SELECT
|
||||
sc.value as value,
|
||||
sc.product_id AS product_id,
|
||||
sc.best_before_date AS best_before_date,
|
||||
EXISTS(SELECT id FROM stock_missing_products_including_opened WHERE id = sc.product_id) AS product_missing,
|
||||
EXISTS(SELECT id FROM stock_missing_products WHERE id = sc.product_id) AS product_missing,
|
||||
(SELECT name FROM quantity_units WHERE quantity_units.id = p.qu_id_stock) AS qu_unit_name,
|
||||
(SELECT name_plural FROM quantity_units WHERE quantity_units.id = p.qu_id_stock) AS qu_unit_name_plural,
|
||||
p.name AS product_name,
|
||||
@ -53,13 +54,14 @@ SELECT
|
||||
(SELECT name_plural FROM quantity_units WHERE quantity_units.id = p.qu_id_purchase) AS qu_purchase_unit_name_plural,
|
||||
sc.is_aggregated_amount,
|
||||
sc.amount_opened_aggregated,
|
||||
sc.amount_aggregated
|
||||
sc.amount_aggregated,
|
||||
p.calories
|
||||
FROM (
|
||||
SELECT *
|
||||
FROM stock_current
|
||||
WHERE best_before_date IS NOT NULL
|
||||
UNION
|
||||
SELECT id, 0, 0, 0, 0, null, 0, 0, 0
|
||||
SELECT id, 0, 0, 0, null, 0, 0, 0
|
||||
FROM stock_missing_products
|
||||
WHERE id NOT IN (SELECT product_id FROM stock_current)
|
||||
) sc
|
||||
|
@ -9,7 +9,8 @@
|
||||
{ 'visible': false, 'targets': 7 },
|
||||
{ 'visible': false, 'targets': 8 },
|
||||
{ 'visible': false, 'targets': 2 },
|
||||
{ 'visible': false, 'targets': 4 }
|
||||
{ 'visible': false, 'targets': 4 },
|
||||
{ 'visible': false, 'targets': 9 }
|
||||
],
|
||||
});
|
||||
|
||||
|
@ -160,6 +160,7 @@
|
||||
<th class="d-none">Hidden location</th>
|
||||
<th class="d-none">Hidden status</th>
|
||||
<th class="d-none">Hidden product group</th>
|
||||
<th>{{ $__t('Calories') }}</th>
|
||||
|
||||
@include('components.userfields_thead', array(
|
||||
'userfields' => $userfields
|
||||
@ -366,6 +367,9 @@
|
||||
<td class="d-none">
|
||||
xx{{ $currentStockEntry->product_group_name }}xx
|
||||
</td>
|
||||
<td>
|
||||
<span class="locale-number locale-number-generic">{{ $currentStockEntry->calories }}</span>
|
||||
</td>
|
||||
|
||||
@include('components.userfields_tbody', array(
|
||||
'userfields' => $userfields,
|
||||
|
Loading…
x
Reference in New Issue
Block a user