diff --git a/changelog/77_UNRELEASED_xxxx-xx-xx.md b/changelog/77_UNRELEASED_xxxx-xx-xx.md index 687bb89c..30d5ada6 100644 --- a/changelog/77_UNRELEASED_xxxx-xx-xx.md +++ b/changelog/77_UNRELEASED_xxxx-xx-xx.md @@ -28,6 +28,7 @@ - Added a new stock setting (top right corner settings menu) "Show all out of stock products" to optionally also show all out of stock products on the stock overview page (defaults to disabled, so no changed behavior when not configured) - By default the stock overview page lists all products which are currently in-stock or below their min. stock amount - When this new setting is enabled, all (active) products are always shown +- The "Decimal places allowed" stock settings now have an upper limit of 10 (since such a high number makes not so much sense in reality and causes form validtion problems) - Fixed that a once set quantity unit on a product barcode could not be removed on edit - Fixed that when consuming a specific stock entry which is opened, and which originated from a before partly opened stock entry, the unopened one was wrongly consume instead diff --git a/migrations/0246.sql b/migrations/0246.sql new file mode 100644 index 00000000..3c164c3f --- /dev/null +++ b/migrations/0246.sql @@ -0,0 +1,4 @@ +UPDATE user_settings +SET value = '10' +WHERE key IN ('stock_decimal_places_amounts', 'stock_decimal_places_prices_input', 'stock_decimal_places_prices_display') + AND CAST(value AS INT) > 10; diff --git a/views/stocksettings.blade.php b/views/stocksettings.blade.php index b4ff05d4..5f8cdd96 100644 --- a/views/stocksettings.blade.php +++ b/views/stocksettings.blade.php @@ -197,6 +197,7 @@ 'additionalAttributes' => 'data-setting-key="stock_decimal_places_amounts"', 'label' => 'Decimal places allowed for amounts', 'min' => 0, + 'max' => 10, 'additionalCssClasses' => 'user-setting-control' )) @@ -207,6 +208,7 @@ 'additionalAttributes' => 'data-setting-key="stock_decimal_places_prices_input"', 'label' => 'Decimal places allowed for prices (input)', 'min' => 0, + 'max' => 10, 'additionalCssClasses' => 'user-setting-control' )) @@ -215,6 +217,7 @@ 'additionalAttributes' => 'data-setting-key="stock_decimal_places_prices_display"', 'label' => 'Decimal places allowed for prices (display)', 'min' => 0, + 'max' => 10, 'additionalCssClasses' => 'user-setting-control' ))