From 362b3f85086912bd6b8a927b292e3dc1a0084c4c Mon Sep 17 00:00:00 2001 From: Bernd Bestel Date: Sat, 19 Dec 2020 17:25:13 +0100 Subject: [PATCH] Added min. stock amount column to stock overview (closes #856) --- changelog/60_3.0.0_2020-12-22.md | 2 +- grocy.openapi.json | 2 +- migrations/0122.sql | 6 ++++-- public/viewjs/stockoverview.js | 2 ++ views/stockoverview.blade.php | 4 ++++ 5 files changed, 12 insertions(+), 4 deletions(-) diff --git a/changelog/60_3.0.0_2020-12-22.md b/changelog/60_3.0.0_2020-12-22.md index 6d9a50c8..2b20c935 100644 --- a/changelog/60_3.0.0_2020-12-22.md +++ b/changelog/60_3.0.0_2020-12-22.md @@ -141,7 +141,7 @@ - All tables are now customizable (new little eye icon on the top left corner on each table) - Table columns be shown/hidden - There are also new columns on some pages, hidden by default - - Stock overview: Value, product group, calories, last purchased, last price + - Stock overview: Value, product group, calories, last purchased, last price, min. stock amount - Products list: Default store - Row grouping can be customized to use any available column (thanks @edenhaus) - Table states (visible columns, sorting, column order and so on) are now saved server side (in user settings) means that this stays the same when using different browsers diff --git a/grocy.openapi.json b/grocy.openapi.json index 6323195f..4025fc0b 100644 --- a/grocy.openapi.json +++ b/grocy.openapi.json @@ -4375,7 +4375,7 @@ }, "note": { "type": "string" - }, + } } }, "ExternalBarcodeLookupResponse": { diff --git a/migrations/0122.sql b/migrations/0122.sql index 8141f972..e17412f2 100644 --- a/migrations/0122.sql +++ b/migrations/0122.sql @@ -27,7 +27,8 @@ SELECT p.quick_consume_amount, p.due_type, plp.purchased_date AS last_purchased, - plp.price AS last_price + plp.price AS last_price, + p.min_stock_amount FROM ( SELECT * FROM stock_current @@ -74,7 +75,8 @@ SELECT p.quick_consume_amount, p.due_type, plp.purchased_date AS last_purchased, - plp.price AS last_price + plp.price AS last_price, + p.min_stock_amount FROM ( SELECT * FROM stock_current diff --git a/public/viewjs/stockoverview.js b/public/viewjs/stockoverview.js index f9d06977..6ad12360 100755 --- a/public/viewjs/stockoverview.js +++ b/public/viewjs/stockoverview.js @@ -13,12 +13,14 @@ { 'visible': false, 'targets': 10 }, { 'visible': false, 'targets': 11 }, { 'visible': false, 'targets': 12 }, + { 'visible': false, 'targets': 13 }, { "type": "num", "targets": 3 }, { "type": "html-num-fmt", "targets": 9 }, { "type": "html-num-fmt", "targets": 10 }, { "type": "html", "targets": 5 }, { "type": "html", "targets": 11 }, { "type": "html-num-fmt", "targets": 12 }, + { "type": "num", "targets": 13 } ].concat($.fn.dataTable.defaults.columnDefs) }); diff --git a/views/stockoverview.blade.php b/views/stockoverview.blade.php index eb8ab17d..9f3e6452 100755 --- a/views/stockoverview.blade.php +++ b/views/stockoverview.blade.php @@ -168,6 +168,7 @@ {{ $__t('Calories') }} {{ $__t('Last purchased') }} {{ $__t('Last price') }} + {{ $__t('Min. stock amount') }} @include('components.userfields_thead', array( 'userfields' => $userfields @@ -380,6 +381,9 @@ {{ $currentStockEntry->last_price }} + + {{ $currentStockEntry->min_stock_amount }} + @include('components.userfields_tbody', array( 'userfields' => $userfields,