Added an upper limit for stock_decimal_places_* settings (references #2508)

This commit is contained in:
Bernd Bestel 2025-01-17 19:48:14 +01:00
parent 4300da8f64
commit 1daa15a303
No known key found for this signature in database
GPG Key ID: 71BD34C0D4891300
3 changed files with 8 additions and 0 deletions

View File

@ -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) - 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 - 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 - 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 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 - 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

4
migrations/0246.sql Normal file
View File

@ -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;

View File

@ -197,6 +197,7 @@
'additionalAttributes' => 'data-setting-key="stock_decimal_places_amounts"', 'additionalAttributes' => 'data-setting-key="stock_decimal_places_amounts"',
'label' => 'Decimal places allowed for amounts', 'label' => 'Decimal places allowed for amounts',
'min' => 0, 'min' => 0,
'max' => 10,
'additionalCssClasses' => 'user-setting-control' 'additionalCssClasses' => 'user-setting-control'
)) ))
@ -207,6 +208,7 @@
'additionalAttributes' => 'data-setting-key="stock_decimal_places_prices_input"', 'additionalAttributes' => 'data-setting-key="stock_decimal_places_prices_input"',
'label' => 'Decimal places allowed for prices (input)', 'label' => 'Decimal places allowed for prices (input)',
'min' => 0, 'min' => 0,
'max' => 10,
'additionalCssClasses' => 'user-setting-control' 'additionalCssClasses' => 'user-setting-control'
)) ))
@ -215,6 +217,7 @@
'additionalAttributes' => 'data-setting-key="stock_decimal_places_prices_display"', 'additionalAttributes' => 'data-setting-key="stock_decimal_places_prices_display"',
'label' => 'Decimal places allowed for prices (display)', 'label' => 'Decimal places allowed for prices (display)',
'min' => 0, 'min' => 0,
'max' => 10,
'additionalCssClasses' => 'user-setting-control' 'additionalCssClasses' => 'user-setting-control'
)) ))