From a6ffe8480aa3e4560dc816b95d2b240c8c7981dc Mon Sep 17 00:00:00 2001 From: Bernd Bestel Date: Sat, 13 Nov 2021 16:45:55 +0100 Subject: [PATCH] Show stock QU hint also for the energy field on the product edit page (closes #1682) --- changelog/53_2.5.1_2019-09-28.md | 2 +- localization/strings.pot | 2 +- public/viewjs/productform.js | 1 + views/productform.blade.php | 19 ++++++++++++++----- 4 files changed, 17 insertions(+), 7 deletions(-) diff --git a/changelog/53_2.5.1_2019-09-28.md b/changelog/53_2.5.1_2019-09-28.md index 7b852cbf..d30a9db6 100644 --- a/changelog/53_2.5.1_2019-09-28.md +++ b/changelog/53_2.5.1_2019-09-28.md @@ -3,7 +3,7 @@ - Fixed that the "X products are already expired" count on the stock overview page was wrong - Fixed that after product actions (consume/purchase/etc.) on the stock overview page the highlighting of the row was maybe wrong - After product actions (consume/purchase/etc.) on the stock overview page on a sub product, now also the parent product (row) is refreshed -- It's now possible to accumulate min. stock amounts on parent product level (new option per product, means the sub product will never be "missing" then, only the parent product) +- It's now possible to accumulate min. stock amounts on parent product level (new option per product, means the sub product will never be missing then, only the parent product) - On the purchase page there is now an option to select that the price is the total price (for the whole amount) - below the price field, defaults to "Unit price" (as it was until now), when set to "Total price", the entered price will be divided by the amount before posting - "Average shelf life" on the product card now displays just "Unlimited" when the resulting value would be > 200 years (for products which never expire, as they have a best before date of 2999-12-31) diff --git a/localization/strings.pot b/localization/strings.pot index 999d8d6f..0b6798e9 100644 --- a/localization/strings.pot +++ b/localization/strings.pot @@ -1411,7 +1411,7 @@ msgstr "" msgid "Accumulate sub products min. stock amount" msgstr "" -msgid "If enabled, the min. stock amount of sub products will be accumulated into this product, means the sub product will never be \"missing\", only this product" +msgid "If enabled, the min. stock amount of sub products will be accumulated into this product, means the sub product will never be missing, only this product" msgstr "" msgid "Are you sure to remove this conversion?" diff --git a/public/viewjs/productform.js b/public/viewjs/productform.js index 42854796..96ffb660 100644 --- a/public/viewjs/productform.js +++ b/public/viewjs/productform.js @@ -187,6 +187,7 @@ $('.input-group-qu').on('change', function(e) $("#tare_weight_qu_info").text($("#qu_id_stock option:selected").text()); $("#quick_consume_qu_info").text($("#qu_id_stock option:selected").text()); + $("#energy_qu_info").text($("#qu_id_stock option:selected").text()); Grocy.FrontendHelpers.ValidateForm('product-form'); }); diff --git a/views/productform.blade.php b/views/productform.blade.php index 3251c40e..bc398eb9 100644 --- a/views/productform.blade.php +++ b/views/productform.blade.php @@ -170,7 +170,7 @@   + title="{{ $__t('If enabled, the min. stock amount of sub products will be accumulated into this product, means the sub product will never be missing, only this product') }}"> @@ -428,6 +428,7 @@ 'decimals' => $userSettings['stock_decimal_places_amounts'], 'value' => $value, 'hint' => $__t('Per stock quantity unit'), + 'contextInfoId' => 'energy_qu_info', 'isRequired' => false, 'additionalCssClasses' => 'locale-number-input locale-number-quantity-amount' )) @@ -485,12 +486,20 @@ id="default_print_stock_label" name="default_print_stock_label"> + {{ + $no_label + }}>{{ $__t('No label') }} + {{ + $single_label + }}>{{ $__t('Single label') }}