From c1ac9e8a45f0b3771f9d6ea098d1afe006d8eead Mon Sep 17 00:00:00 2001 From: Bernd Bestel Date: Mon, 21 Dec 2020 20:43:10 +0100 Subject: [PATCH] Optimized/clarified new "Hide product from stock overview" option (references #906) --- changelog/60_3.0.0_2020-12-22.md | 3 ++- localization/strings.pot | 5 ++++- migrations/0103.sql | 2 +- migrations/0105.sql | 4 ++-- migrations/0122.sql | 4 ++-- views/productform.blade.php | 29 ++++++++++++++++------------- 6 files changed, 27 insertions(+), 20 deletions(-) diff --git a/changelog/60_3.0.0_2020-12-22.md b/changelog/60_3.0.0_2020-12-22.md index 89032d59..238323b1 100644 --- a/changelog/60_3.0.0_2020-12-22.md +++ b/changelog/60_3.0.0_2020-12-22.md @@ -55,7 +55,8 @@ - On the purchase page the amount field is now displayed above/before the due date for better `TAB` handling (thanks @kriddles) - Changed that when `FEATURE_FLAG_STOCK_BEST_BEFORE_DATE_TRACKING` is disabled, products now get internally a due date of "never overdue" (aka `2999-12-31`) instead of today (thanks @kriddles) - Products can now be disabled to keep the history/journal, but hide it everywhere, without deleting it (new product option "Active", deleting a product now explicitly also deletes its journal and all other references) (thanks @kriddles for the initial work on this) -- Products can now be hidden from the stock overview page (new product option "Show on stock overview page", enabled by default, so no changed behavior when not configured) +- Products can now be hidden from the stock overview page, even if they are in-stock (new product option "Never show on stock overview", disabled by default, so no changed behavior when not configured) + - That's maybe useful for parent products you only use as a kind of "container" - The due date is now also prefilled on the inventory page based on the products "Default due days" (was only done on the purchase page before) - On the stock journal page, it's now visible if a consume-booking was spoiled - It's now tracked who made a stock change (currently logged in user, visible on the stock journal page) (thanks @fipwmaqzufheoxq92ebc) diff --git a/localization/strings.pot b/localization/strings.pot index e9af4110..539e6606 100644 --- a/localization/strings.pot +++ b/localization/strings.pot @@ -1997,7 +1997,7 @@ msgstr "" msgid "Show disabled" msgstr "" -msgid "Show on stock overview page" +msgid "Never show on stock overview" msgstr "" msgid "None" @@ -2068,3 +2068,6 @@ msgstr "" msgid "Link" msgstr "" + +msgid "The stock overview page lists all products which are currently in-stock or below their min. stock amount - enable this to hide this product there always" +msgstr "" diff --git a/migrations/0103.sql b/migrations/0103.sql index 421720b0..e93c6e98 100644 --- a/migrations/0103.sql +++ b/migrations/0103.sql @@ -70,7 +70,7 @@ CREATE TABLE products ( cumulate_min_stock_amount_of_sub_products TINYINT DEFAULT 0, due_type TINYINT NOT NULL DEFAULT 1 CHECK(due_type IN (1, 2)), quick_consume_amount REAL NOT NULL DEFAULT 1, - show_on_stock_overview TINYINT NOT NULL DEFAULT 1 CHECK(show_on_stock_overview IN (0, 1)), + hide_on_stock_overview TINYINT NOT NULL DEFAULT 0 CHECK(hide_on_stock_overview IN (0, 1)), row_created_timestamp DATETIME DEFAULT (datetime('now', 'localtime')) ); diff --git a/migrations/0105.sql b/migrations/0105.sql index 19066995..c20cf5f7 100644 --- a/migrations/0105.sql +++ b/migrations/0105.sql @@ -38,7 +38,7 @@ FROM ( ) sc LEFT JOIN products p ON sc.product_id = p.id -WHERE p.show_on_stock_overview = 1; +WHERE p.hide_on_stock_overview = 0; CREATE VIEW uihelper_stock_current_overview AS @@ -80,4 +80,4 @@ FROM ( ) sc LEFT JOIN products p ON sc.product_id = p.id -WHERE p.show_on_stock_overview = 1; +WHERE p.hide_on_stock_overview = 0; diff --git a/migrations/0122.sql b/migrations/0122.sql index e17412f2..f52452ba 100644 --- a/migrations/0122.sql +++ b/migrations/0122.sql @@ -44,7 +44,7 @@ LEFT JOIN products_last_purchased plp ON sc.product_id = plp.product_id LEFT JOIN products p ON sc.product_id = p.id -WHERE p.show_on_stock_overview = 1; +WHERE p.hide_on_stock_overview = 0; DROP VIEW uihelper_stock_current_overview; CREATE VIEW uihelper_stock_current_overview @@ -92,4 +92,4 @@ LEFT JOIN products_last_purchased plp ON sc.product_id = plp.product_id LEFT JOIN products p ON sc.product_id = p.id -WHERE p.show_on_stock_overview = 1; +WHERE p.hide_on_stock_overview = 0; diff --git a/views/productform.blade.php b/views/productform.blade.php index 4f0b6b9d..5fcee16c 100644 --- a/views/productform.blade.php +++ b/views/productform.blade.php @@ -62,19 +62,6 @@ -
-
- show_on_stock_overview == 1) checked @endif class="form-check-input custom-control-input" type="checkbox" id="show_on_stock_overview" name="show_on_stock_overview" value="1"> - -
-
- @php $prefillById = ''; if($mode=='edit') { $prefillById = $product->parent_product_id; } @endphp @php $hint = ''; @@ -413,6 +400,22 @@ 'entity' => 'products' )) +
+
+ hide_on_stock_overview == 1) checked @endif class="form-check-input custom-control-input" type="checkbox" id="hide_on_stock_overview" name="hide_on_stock_overview" value="1"> + +
+
+ {{ $__t('Save & continue to add quantity unit conversions & barcodes') }}