diff --git a/changelog/60_UNRELEASED_2020-xx-xx.md b/changelog/60_UNRELEASED_2020-xx-xx.md index 50277ece..ffef84ce 100644 --- a/changelog/60_UNRELEASED_2020-xx-xx.md +++ b/changelog/60_UNRELEASED_2020-xx-xx.md @@ -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) diff --git a/migrations/0105.sql b/migrations/0105.sql index dbbc2b2a..77746b75 100644 --- a/migrations/0105.sql +++ b/migrations/0105.sql @@ -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 diff --git a/public/viewjs/stockoverview.js b/public/viewjs/stockoverview.js index 74a03c8d..0d127611 100755 --- a/public/viewjs/stockoverview.js +++ b/public/viewjs/stockoverview.js @@ -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 } ], }); diff --git a/views/stockoverview.blade.php b/views/stockoverview.blade.php index 8c04975e..fe73997b 100755 --- a/views/stockoverview.blade.php +++ b/views/stockoverview.blade.php @@ -160,6 +160,7 @@ Hidden location Hidden status Hidden product group + {{ $__t('Calories') }} @include('components.userfields_thead', array( 'userfields' => $userfields @@ -366,6 +367,9 @@ xx{{ $currentStockEntry->product_group_name }}xx + + {{ $currentStockEntry->calories }} + @include('components.userfields_tbody', array( 'userfields' => $userfields,