From 76e4a1578c3812cc275827d2f0a5080e10eb817b Mon Sep 17 00:00:00 2001 From: Bernd Bestel Date: Sun, 20 Dec 2020 10:26:02 +0100 Subject: [PATCH] Added Default store as a column to the shopping list (closes #957) --- changelog/60_3.0.0_2020-12-22.md | 4 ++-- migrations/0123.sql | 7 +++++-- public/viewjs/shoppinglist.js | 1 + views/shoppinglist.blade.php | 4 ++++ 4 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 953c92e6..193922df 100644 --- a/changelog/60_3.0.0_2020-12-22.md +++ b/changelog/60_3.0.0_2020-12-22.md @@ -147,9 +147,9 @@ - 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, min. stock amount + - Stock overview: Value, Product group, Calories, Last purchased, Last price, Min. stock amount - Products list: Default store - - Shopping list: Last price (Unit), Last price (Total) + - Shopping list: Last price (Unit), Last price (Total), 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 - Dialogs are now used everywhere where appropriate instead of jumping between pages (for example when adding/editing shopping list items) diff --git a/migrations/0123.sql b/migrations/0123.sql index 57269277..5fb74102 100644 --- a/migrations/0123.sql +++ b/migrations/0123.sql @@ -7,7 +7,8 @@ SELECT sl.*, p.name AS product_name, plp.price * IFNULL(qucr.factor, 1.0) AS last_price_unit, - plp.price * IFNULL(qucr.factor, 1.0) * sl.amount AS last_price_total + plp.price * IFNULL(qucr.factor, 1.0) * sl.amount AS last_price_total, + st.name AS default_shopping_location_name FROM shopping_list sl LEFT JOIN products p ON sl.product_id = p.id @@ -16,4 +17,6 @@ LEFT JOIN quantity_unit_conversions_resolved qucr AND p.qu_id_stock = qucr.from_qu_id AND sl.qu_id = qucr.to_qu_id LEFT JOIN products_last_purchased plp - ON sl.product_id = plp.product_id; + ON sl.product_id = plp.product_id +LEFT JOIN shopping_locations st + ON p.shopping_location_id = st.id; diff --git a/public/viewjs/shoppinglist.js b/public/viewjs/shoppinglist.js index 4bba444b..ec3ec452 100644 --- a/public/viewjs/shoppinglist.js +++ b/public/viewjs/shoppinglist.js @@ -7,6 +7,7 @@ { 'visible': false, 'targets': 3 }, { 'visible': false, 'targets': 5 }, { 'visible': false, 'targets': 6 }, + { 'visible': false, 'targets': 7 }, { "type": "num", "targets": 2 }, { "type": "html-num-fmt", "targets": 5 }, { "type": "html-num-fmt", "targets": 6 } diff --git a/views/shoppinglist.blade.php b/views/shoppinglist.blade.php index da8d7998..c2dcbb3d 100644 --- a/views/shoppinglist.blade.php +++ b/views/shoppinglist.blade.php @@ -164,6 +164,7 @@ Hidden status {{ $__t('Last price (Unit)') }} {{ $__t('Last price (Total)') }} + {{ $__t('Default store') }} @include('components.userfields_thead', array( 'userfields' => $userfields @@ -243,6 +244,9 @@ {{ $listItem->last_price_total }} + + {{ $listItem->default_shopping_location_name }} + @include('components.userfields_tbody', array( 'userfields' => $userfields,