Remove "Allow partial units in stock" product option / unify number input validation messages

This commit is contained in:
Bernd Bestel 2020-11-16 19:10:29 +01:00
parent 95fc6a6faa
commit e85b21384f
No known key found for this signature in database
GPG Key ID: 71BD34C0D4891300
59 changed files with 191 additions and 336 deletions

View File

@ -40,6 +40,7 @@
- Products which are overdue are highlighted in grey (there is also a new filter button on the stock overview page for them) - Products which are overdue are highlighted in grey (there is also a new filter button on the stock overview page for them)
- Products which are expired (new option) are highlighted in red - Products which are expired (new option) are highlighted in red
- When creating a quantity unit conversion it's now possible to automatically create the inverse conversion (thanks @kriddles) - When creating a quantity unit conversion it's now possible to automatically create the inverse conversion (thanks @kriddles)
- The product option "Allow partial units in stock" was removed, partial amounts are now possible by default for all products
- On purchase there is now a warning shown, when the due date of the purchased product is earlier than the next due date in stock (enabled by default, can be disabled by a new stock setting (top right corner settings menu)) - On purchase there is now a warning shown, when the due date of the purchased product is earlier than the next due date in stock (enabled by default, can be disabled by a new stock setting (top right corner settings menu))
- The amount to be used for the "quick consume/open buttons" on the stock overview page can now be configured per product (new product option "Quick consume amount", defaults to 1) - The amount to be used for the "quick consume/open buttons" on the stock overview page can now be configured per product (new product option "Quick consume amount", defaults to 1)
- Products can now be duplicated (new button on the products list page, all fields will be preset from the copied product, except the name) - Products can now be duplicated (new button on the products list page, all fields will be preset from the copied product, except the name)
@ -127,6 +128,8 @@
- 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 - 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 exampel when adding/editing shopping list items) - Dialogs are now used everywhere where appropriate instead of jumping between pages (for exampel when adding/editing shopping list items)
- Added a "Clear filter"-button on all pages (with filters) to quickly reset applied filters - Added a "Clear filter"-button on all pages (with filters) to quickly reset applied filters
- Prefilled number inputs now use sensible decimal places (max. the configured decimals while hiding trailing zeros where appropriate, means if you never use partial amounts for a product, you'll never see decimals for it)
- Improved / more precise validation messages for number inputs
- The data path (previously fixed to the `data` folder) is now configurable, making it possible to run multiple grocy instances from the same directory (with different `config.php` files / different database, etc.) (thanks @fgrsnau) - The data path (previously fixed to the `data` folder) is now configurable, making it possible to run multiple grocy instances from the same directory (with different `config.php` files / different database, etc.) (thanks @fgrsnau)
- Via an environment variable `GROCY_DATAPATH` (higher priority) - Via an environment variable `GROCY_DATAPATH` (higher priority)
- Via an FastCGI parameter `GROCY_DATAPATH` (lower priority) - Via an FastCGI parameter `GROCY_DATAPATH` (lower priority)

View File

@ -3957,9 +3957,6 @@
"picture_file_name": { "picture_file_name": {
"type": "string" "type": "string"
}, },
"allow_partial_units_in_stock": {
"type": "boolean"
},
"row_created_timestamp": { "row_created_timestamp": {
"type": "string", "type": "string",
"format": "date-time" "format": "date-time"
@ -3987,7 +3984,6 @@
"product_group_id": "1", "product_group_id": "1",
"picture_file_name": "cookies.jpg", "picture_file_name": "cookies.jpg",
"default_best_before_days_after_open": "0", "default_best_before_days_after_open": "0",
"allow_partial_units_in_stock": "0",
"enable_tare_weight_handling": "0", "enable_tare_weight_handling": "0",
"tare_weight": "0.0", "tare_weight": "0.0",
"not_check_stock_fulfillment_for_recipes": "0", "not_check_stock_fulfillment_for_recipes": "0",
@ -4284,7 +4280,6 @@
"product_group_id": "1", "product_group_id": "1",
"picture_file_name": "cookies.jpg", "picture_file_name": "cookies.jpg",
"default_best_before_days_after_open": "0", "default_best_before_days_after_open": "0",
"allow_partial_units_in_stock": "0",
"enable_tare_weight_handling": "0", "enable_tare_weight_handling": "0",
"tare_weight": "0.0", "tare_weight": "0.0",
"not_check_stock_fulfillment_for_recipes": "0", "not_check_stock_fulfillment_for_recipes": "0",

View File

@ -405,12 +405,6 @@ msgstr ""
msgid "A location is required" msgid "A location is required"
msgstr "" msgstr ""
msgid "The amount cannot be lower than %s"
msgstr ""
msgid "This cannot be negative"
msgstr ""
msgid "A quantity unit is required" msgid "A quantity unit is required"
msgstr "" msgstr ""
@ -563,9 +557,6 @@ msgstr ""
msgid "Price" msgid "Price"
msgstr "" msgstr ""
msgid "The price cannot be lower than %s"
msgstr ""
msgid "Unit" msgid "Unit"
msgstr "" msgstr ""
@ -597,9 +588,6 @@ msgstr[1] ""
msgid "in singular form" msgid "in singular form"
msgstr "" msgstr ""
msgid "This cannot be lower than %s"
msgstr ""
msgid "Quantity unit" msgid "Quantity unit"
msgstr "" msgstr ""
@ -844,9 +832,6 @@ msgstr ""
msgid "Charge cycle successfully undone" msgid "Charge cycle successfully undone"
msgstr "" msgstr ""
msgid "This cannot be negative and must be an integral number"
msgstr ""
msgid "Disable stock fulfillment checking for this ingredient" msgid "Disable stock fulfillment checking for this ingredient"
msgstr "" msgstr ""
@ -1125,9 +1110,6 @@ msgid_plural "Not enough in stock, %s ingredients missing"
msgstr[0] "" msgstr[0] ""
msgstr[1] "" msgstr[1] ""
msgid "The amount cannot be lower than %1$s or equal %2$s"
msgstr ""
msgid "Not enough in stock, but already on the shopping list" msgid "Not enough in stock, but already on the shopping list"
msgstr "" msgstr ""
@ -1223,7 +1205,7 @@ msgstr ""
msgid "all locations" msgid "all locations"
msgstr "" msgstr ""
msgid "Here you can print a page per location with the current stock, maybe to hang it there and note the consumed things on it." msgid "Here you can print a page per location with the current stock, maybe to hang it there and note the consumed things on it"
msgstr "" msgstr ""
msgid "this location" msgid "this location"
@ -1265,9 +1247,6 @@ msgstr ""
msgid "Quantity unit to" msgid "Quantity unit to"
msgstr "" msgstr ""
msgid "This cannot be lower than %1$s and must be a valid number with max. %2$s decimal places"
msgstr ""
msgid "This cannot be equal to %s" msgid "This cannot be equal to %s"
msgstr "" msgstr ""
@ -1981,3 +1960,18 @@ msgstr ""
msgid "Add overdue/expired products" msgid "Add overdue/expired products"
msgstr "" msgstr ""
msgid "Products with tare weight enabled are currently not supported for transfer"
msgstr ""
msgid "This cannot be lower than %1$s or equal %2$s and needs to be a valid number with max. %3$s decimal places"
msgstr ""
msgid "This must be between %1$s and %2$s, cannot equal %3$s and needs to be a valid number with max. %4$s decimal places"
msgstr ""
msgid "This cannot be lower than %1$s and needs to be a valid number with max. %2$s decimal places"
msgstr ""
msgid "This must between %1$s and %2$s and needs to be a valid number with max. %3$s decimal places"
msgstr ""

View File

@ -61,7 +61,6 @@ CREATE TABLE products (
default_best_before_days_after_freezing INTEGER NOT NULL DEFAULT 0, default_best_before_days_after_freezing INTEGER NOT NULL DEFAULT 0,
default_best_before_days_after_thawing INTEGER NOT NULL DEFAULT 0, default_best_before_days_after_thawing INTEGER NOT NULL DEFAULT 0,
picture_file_name TEXT, picture_file_name TEXT,
allow_partial_units_in_stock TINYINT NOT NULL DEFAULT 0,
enable_tare_weight_handling TINYINT NOT NULL DEFAULT 0, enable_tare_weight_handling TINYINT NOT NULL DEFAULT 0,
tare_weight REAL NOT NULL DEFAULT 0, tare_weight REAL NOT NULL DEFAULT 0,
not_check_stock_fulfillment_for_recipes TINYINT DEFAULT 0, not_check_stock_fulfillment_for_recipes TINYINT DEFAULT 0,
@ -74,8 +73,8 @@ CREATE TABLE products (
); );
INSERT INTO products INSERT INTO products
(id, name, description, location_id, qu_id_purchase, qu_id_stock, qu_factor_purchase_to_stock, min_stock_amount, default_best_before_days, row_created_timestamp, product_group_id, picture_file_name, default_best_before_days_after_open, allow_partial_units_in_stock, enable_tare_weight_handling, tare_weight, not_check_stock_fulfillment_for_recipes, parent_product_id, calories, cumulate_min_stock_amount_of_sub_products, default_best_before_days_after_freezing, default_best_before_days_after_thawing, shopping_location_id) (id, name, description, location_id, qu_id_purchase, qu_id_stock, qu_factor_purchase_to_stock, min_stock_amount, default_best_before_days, row_created_timestamp, product_group_id, picture_file_name, default_best_before_days_after_open, enable_tare_weight_handling, tare_weight, not_check_stock_fulfillment_for_recipes, parent_product_id, calories, cumulate_min_stock_amount_of_sub_products, default_best_before_days_after_freezing, default_best_before_days_after_thawing, shopping_location_id)
SELECT id, name, description, location_id, qu_id_purchase, qu_id_stock, qu_factor_purchase_to_stock, min_stock_amount,default_best_before_days, row_created_timestamp, product_group_id, picture_file_name, default_best_before_days_after_open, allow_partial_units_in_stock, enable_tare_weight_handling, tare_weight, not_check_stock_fulfillment_for_recipes, parent_product_id, calories, cumulate_min_stock_amount_of_sub_products, default_best_before_days_after_freezing, default_best_before_days_after_thawing, shopping_location_id SELECT id, name, description, location_id, qu_id_purchase, qu_id_stock, qu_factor_purchase_to_stock, min_stock_amount,default_best_before_days, row_created_timestamp, product_group_id, picture_file_name, default_best_before_days_after_open, enable_tare_weight_handling, tare_weight, not_check_stock_fulfillment_for_recipes, parent_product_id, calories, cumulate_min_stock_amount_of_sub_products, default_best_before_days_after_freezing, default_best_before_days_after_thawing, shopping_location_id
FROM products_old; FROM products_old;
DROP TABLE products_old; DROP TABLE products_old;

View File

@ -290,10 +290,18 @@ a:not([href]) {
/* Hide the form validation feedback icons introduced in Bootstrap 4.2.0 - a colored border is enough */ /* Hide the form validation feedback icons introduced in Bootstrap 4.2.0 - a colored border is enough */
.form-control.is-invalid, .form-control.is-invalid,
.custom-control.is-invalid,
.was-validated .form-control:invalid, .was-validated .form-control:invalid,
.was-validated .custom-control:invalid,
.form-control.is-valid, .form-control.is-valid,
.was-validated .form-control:valid { .custom-control.is-valid,
background-size: 0 0; .was-validated .form-control:valid,
.was-validated .custom-control:valid {
background-image: none;
}
.was-validated .custom-select:valid,
.was-validated .custom-select:invalid {
background: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 4 5'%3e%3cpath fill='%23343a40' d='M2 0L0 2h4zm0 5L0 3h4z'/%3e%3c/svg%3e") no-repeat right .75rem center/8px 10px;
} }
/* There is a little too much padding on form inputs */ /* There is a little too much padding on form inputs */

View File

@ -548,32 +548,38 @@ function RefreshLocaleNumberDisplay(rootSelector = "#page-content")
{ {
$(rootSelector + " .locale-number.locale-number-currency").each(function() $(rootSelector + " .locale-number.locale-number-currency").each(function()
{ {
if (isNaN(parseFloat($(this).text()))) var text = $(this).text();
if (isNaN(text) || text.isEmpty())
{ {
return; return;
} }
$(this).text(parseFloat($(this).text()).toLocaleString(undefined, { style: "currency", currency: Grocy.Currency, minimumFractionDigits: 0, maximumFractionDigits: Grocy.UserSettings.stock_decimal_places_prices })); var value = parseFloat(text);
$(this).text(value.toLocaleString(undefined, { style: "currency", currency: Grocy.Currency, minimumFractionDigits: Grocy.UserSettings.stock_decimal_places_prices, maximumFractionDigits: Grocy.UserSettings.stock_decimal_places_prices }));
}); });
$(rootSelector + " .locale-number.locale-number-quantity-amount").each(function() $(rootSelector + " .locale-number.locale-number-quantity-amount").each(function()
{ {
if (isNaN(parseFloat($(this).text()))) var text = $(this).text();
if (isNaN(text) || text.isEmpty())
{ {
return; return;
} }
$(this).text(parseFloat($(this).text()).toLocaleString(undefined, { minimumFractionDigits: 0, maximumFractionDigits: Grocy.UserSettings.stock_decimal_places_amounts })); var value = parseFloat(text);
$(this).text(value.toLocaleString(undefined, { minimumFractionDigits: 0, maximumFractionDigits: Grocy.UserSettings.stock_decimal_places_amounts }));
}); });
$(rootSelector + " .locale-number.locale-number-generic").each(function() $(rootSelector + " .locale-number.locale-number-generic").each(function()
{ {
if (isNaN(parseFloat($(this).text()))) var text = $(this).text();
if (isNaN(text) || text.isEmpty())
{ {
return; return;
} }
$(this).text(parseFloat($(this).text()).toLocaleString(undefined, { minimumFractionDigits: 0, maximumFractionDigits: 2 })); var value = parseFloat(text);
$(this).text(value.toLocaleString(undefined, { minimumFractionDigits: 0, maximumFractionDigits: 2 }));
}); });
} }
RefreshLocaleNumberDisplay(); RefreshLocaleNumberDisplay();
@ -583,18 +589,18 @@ function RefreshLocaleNumberInput(rootSelector = "#page-content")
$(rootSelector + " .locale-number-input.locale-number-currency").each(function() $(rootSelector + " .locale-number-input.locale-number-currency").each(function()
{ {
var value = $(this).val(); var value = $(this).val();
if (isNaN(value)) if (isNaN(value) || value.toString().isEmpty())
{ {
return; return;
} }
$(this).val(parseFloat(value).toLocaleString("en", { minimumFractionDigits: 0, maximumFractionDigits: Grocy.UserSettings.stock_decimal_places_prices, useGrouping: false })); $(this).val(parseFloat(value).toLocaleString("en", { minimumFractionDigits: Grocy.UserSettings.stock_decimal_places_prices, maximumFractionDigits: Grocy.UserSettings.stock_decimal_places_prices, useGrouping: false }));
}); });
$(rootSelector + " .locale-number-input.locale-number-quantity-amount").each(function() $(rootSelector + " .locale-number-input.locale-number-quantity-amount").each(function()
{ {
var value = $(this).val(); var value = $(this).val();
if (isNaN(value)) if (isNaN(value) || value.toString().isEmpty())
{ {
return; return;
} }
@ -605,7 +611,7 @@ function RefreshLocaleNumberInput(rootSelector = "#page-content")
$(rootSelector + " .locale-number-input.locale-number-generic").each(function() $(rootSelector + " .locale-number-input.locale-number-generic").each(function()
{ {
var value = $(this).val(); var value = $(this).val();
if (isNaN(value)) if (isNaN(value) || value.toString().isEmpty())
{ {
return; return;
} }

View File

@ -133,8 +133,7 @@ $('.input-group-chore-period-type').on('change', function(e)
{ {
$("label[for='period_days']").text(__t("Period days")); $("label[for='period_days']").text(__t("Period days"));
$("#period_days").attr("min", "0"); $("#period_days").attr("min", "0");
$("#period_days").attr("max", "9999"); $("#period_days").attr("max", "999999");
$("#period_days").parent().find(".invalid-feedback").text(__t('This cannot be negative'));
$('#chore-period-type-info').attr("data-original-title", __t('This means the next execution of this chore is scheduled %s days after the last execution', periodDays.toString())); $('#chore-period-type-info').attr("data-original-title", __t('This means the next execution of this chore is scheduled %s days after the last execution', periodDays.toString()));
} }
else if (periodType === 'daily') else if (periodType === 'daily')
@ -154,7 +153,6 @@ $('.input-group-chore-period-type').on('change', function(e)
$("label[for='period_days']").text(__t("Day of month")); $("label[for='period_days']").text(__t("Day of month"));
$("#period_days").attr("min", "1"); $("#period_days").attr("min", "1");
$("#period_days").attr("max", "31"); $("#period_days").attr("max", "31");
$("#period_days").parent().find(".invalid-feedback").text(__t('The amount must be between %1$s and %2$s', "1", "31"));
$('#chore-period-interval-info').attr("data-original-title", __t('This means the next execution of this chore should only be scheduled every %s months', periodInterval.toString())); $('#chore-period-interval-info').attr("data-original-title", __t('This means the next execution of this chore should only be scheduled every %s months', periodInterval.toString()));
} }
else if (periodType === 'yearly') else if (periodType === 'yearly')

View File

@ -252,7 +252,7 @@ $(document).on("click", "#barcodescanner-start-button", async function(e)
}); });
// Add camera select to existing dialog // Add camera select to existing dialog
dialog.find('.bootbox-body').append('<div class="form-group py-0 my-1 cameraSelect-wrapper"><select class="form-control cameraSelect"><select class="form-control cameraSelect" style="display: none"></select></div>'); dialog.find('.bootbox-body').append('<div class="form-group py-0 my-1 cameraSelect-wrapper"><select class="custom-control custom-select cameraSelect"><select class="custom-control custom-select cameraSelect" style="display: none"></select></div>');
var cameraSelect = document.querySelector('.cameraSelect'); var cameraSelect = document.querySelector('.cameraSelect');
var cameras = await Quagga.CameraAccess.enumerateVideoDevices(); var cameras = await Quagga.CameraAccess.enumerateVideoDevices();

View File

@ -25,3 +25,48 @@ $(".numberpicker").on("keyup", function()
$(this)[0].setCustomValidity(""); $(this)[0].setCustomValidity("");
} }
}); });
$(".numberpicker").each(function()
{
new MutationObserver(function(mutations)
{
mutations.forEach(function(mutation)
{
if (mutation.type == "attributes" && (mutation.attributeName == "min" || mutation.attributeName == "max" || mutation.attributeName == "data-not-equal"))
{
var element = $(mutation.target);
var min = element.attr("min");
var max = element.attr("max");
var decimals = element.attr("data-decimals");
if (element.hasAttr("data-not-equal"))
{
var notEqual = element.attr("data-not-equal");
if (max.isEmpty() || max.startsWith("999999"))
{
element.parent().find(".invalid-feedback").text(__t("This cannot be lower than %1$s or equal %2$s and needs to be a valid number with max. %3$s decimal places", parseFloat(min).toLocaleString(undefined, { minimumFractionDigits: 0, maximumFractionDigits: decimals }), parseFloat(notEqual).toLocaleString(undefined, { minimumFractionDigits: 0, maximumFractionDigits: decimals }), decimals));
}
else
{
element.parent().find(".invalid-feedback").text(__t("This must be between %1$s and %2$s, cannot equal %3$s and needs to be a valid number with max. %4$s decimal places", parseFloat(min).toLocaleString(undefined, { minimumFractionDigits: 0, maximumFractionDigits: decimals }), parseFloat(max).toLocaleString(undefined, { minimumFractionDigits: 0, maximumFractionDigits: decimals }), parseFloat(notEqual).toLocaleString(undefined, { minimumFractionDigits: decimals, maximumFractionDigits: decimals }), decimals));
}
return;
}
if (max.isEmpty() || max.startsWith("999999"))
{
element.parent().find(".invalid-feedback").text(__t("This cannot be lower than %1$s and needs to be a valid number with max. %2$s decimal places", parseFloat(min).toLocaleString(undefined, { minimumFractionDigits: 0, maximumFractionDigits: decimals }), decimals));
}
else
{
element.parent().find(".invalid-feedback").text(__t("This must between %1$s and %2$s and needs to be a valid number with max. %3$s decimal places", parseFloat(min).toLocaleString(undefined, { minimumFractionDigits: 0, maximumFractionDigits: decimals }), parseFloat(max).toLocaleString(undefined, { minimumFractionDigits: 0, maximumFractionDigits: decimals }), decimals));
}
}
});
}).observe(this, {
attributes: true
});
});
$(".numberpicker").attr("min", $(".numberpicker").attr("min")); // Dummy change to trigger MutationObserver above once

View File

@ -92,10 +92,8 @@
Grocy.Components.ProductPicker.FinishFlow(); Grocy.Components.ProductPicker.FinishFlow();
Grocy.Components.ProductAmountPicker.Reset(); Grocy.Components.ProductAmountPicker.Reset();
$("#display_amount").attr("min", "1"); $("#display_amount").attr("min", "0." + "0".repeat(parseInt(Grocy.UserSettings.stock_decimal_places_amounts) - 1) + "1");
$("#display_amount").attr("max", "999999"); $("#display_amount").attr("max", "999999");
$("#display_amount").attr("step", "1");
$("#display_amount").parent().find(".invalid-feedback").text(__t('The amount cannot be lower than %s', '1'));
$('#display_amount').val(parseFloat(Grocy.UserSettings.stock_default_consume_amount)); $('#display_amount').val(parseFloat(Grocy.UserSettings.stock_default_consume_amount));
RefreshLocaleNumberInput(); RefreshLocaleNumberInput();
$(".input-group-productamountpicker").trigger("change"); $(".input-group-productamountpicker").trigger("change");
@ -336,28 +334,15 @@ Grocy.Components.ProductPicker.GetPicker().on('change', function(e)
} }
); );
if (productDetails.product.allow_partial_units_in_stock == 1)
{
$("#display_amount").attr("min", "0." + "0".repeat(parseInt(Grocy.UserSettings.stock_decimal_places_amounts) - 1) + "1");
$("#display_amount").attr("step", "." + "0".repeat(parseInt(Grocy.UserSettings.stock_decimal_places_amounts) - 1) + "1");
$("#display_amount").parent().find(".invalid-feedback").text(__t('The amount must be between %1$s and %2$s', "0." + "0".repeat(parseInt(Grocy.UserSettings.stock_decimal_places_amounts) - 1) + "1", parseFloat(productDetails.stock_amount).toLocaleString({ minimumFractionDigits: 0, maximumFractionDigits: Grocy.UserSettings.stock_decimal_places_amounts })));
}
else
{
$("#display_amount").attr("min", "1");
$("#display_amount").attr("step", "1");
$("#display_amount").parent().find(".invalid-feedback").text(__t('The amount must be between %1$s and %2$s', "1", parseFloat(productDetails.stock_amount).toLocaleString({ minimumFractionDigits: 0, maximumFractionDigits: Grocy.UserSettings.stock_decimal_places_amounts })));
}
if (productDetails.product.enable_tare_weight_handling == 1) if (productDetails.product.enable_tare_weight_handling == 1)
{ {
$("#display_amount").attr("min", productDetails.product.tare_weight); $("#display_amount").attr("min", productDetails.product.tare_weight);
$('#display_amount').attr('max', parseFloat(productDetails.stock_amount) + parseFloat(productDetails.product.tare_weight)); $('#display_amount').attr('max', parseFloat(productDetails.stock_amount) + parseFloat(productDetails.product.tare_weight));
$("#display_amount").parent().find(".invalid-feedback").text(__t('The amount must be between %1$s and %2$s', parseFloat(productDetails.product.tare_weight).toLocaleString(), (parseFloat(productDetails.stock_amount) + parseFloat(productDetails.product.tare_weight)).toLocaleString()));
$("#tare-weight-handling-info").removeClass("d-none"); $("#tare-weight-handling-info").removeClass("d-none");
} }
else else
{ {
$("#display_amount").attr("min", "0." + "0".repeat(parseInt(Grocy.UserSettings.stock_decimal_places_amounts) - 1) + "1");
$("#tare-weight-handling-info").addClass("d-none"); $("#tare-weight-handling-info").addClass("d-none");
} }
@ -455,10 +440,6 @@ $("#specific_stock_entry").on("change", function(e)
{ {
$("#display_amount").parent().find(".invalid-feedback").text(__t('There are no units available at this location')); $("#display_amount").parent().find(".invalid-feedback").text(__t('There are no units available at this location'));
} }
else
{
$("#display_amount").parent().find(".invalid-feedback").text(__t('The amount must be between %1$s and %2$s', "1", sumValue));
}
}, },
function(xhr) function(xhr)
{ {
@ -468,7 +449,6 @@ $("#specific_stock_entry").on("change", function(e)
} }
else else
{ {
$("#display_amount").parent().find(".invalid-feedback").text(__t('The amount must be between %1$s and %2$s', "1", $('option:selected', this).attr('amount')));
$("#display_amount").attr("max", $('option:selected', this).attr('amount')); $("#display_amount").attr("max", $('option:selected', this).attr('amount'));
} }
}); });
@ -578,30 +558,18 @@ function RefreshForm()
{ {
$("#consume-exact-amount-group").addClass("d-none"); $("#consume-exact-amount-group").addClass("d-none");
} }
if (productDetails.product.enable_tare_weight_handling == 1 && !$('#consume-exact-amount').is(':checked')) if (productDetails.product.enable_tare_weight_handling == 1 && !$('#consume-exact-amount').is(':checked'))
{ {
$("#display_amount").attr("min", productDetails.product.tare_weight); $("#display_amount").attr("min", productDetails.product.tare_weight);
$('#display_amount').attr('max', sumValue + parseFloat(productDetails.product.tare_weight)); $('#display_amount').attr('max', sumValue + parseFloat(productDetails.product.tare_weight));
$("#display_amount").parent().find(".invalid-feedback").text(__t('The amount must be between %1$s and %2$s', parseFloat(productDetails.product.tare_weight).toLocaleString(), (parseFloat(productDetails.stock_amount) + parseFloat(productDetails.product.tare_weight)).toLocaleString()));
$("#tare-weight-handling-info").removeClass("d-none"); $("#tare-weight-handling-info").removeClass("d-none");
} }
else else
{ {
$("#tare-weight-handling-info").addClass("d-none"); $("#tare-weight-handling-info").addClass("d-none");
if (productDetails.product.allow_partial_units_in_stock == 1) $("#display_amount").attr("min", "0." + "0".repeat(parseInt(Grocy.UserSettings.stock_decimal_places_amounts) - 1) + "1");
{
$("#display_amount").attr("min", "0." + "0".repeat(parseInt(Grocy.UserSettings.stock_decimal_places_amounts) - 1) + "1");
$("#display_amount").attr("step", "." + "0".repeat(parseInt(Grocy.UserSettings.stock_decimal_places_amounts) - 1) + "1");
$("#display_amount").parent().find(".invalid-feedback").text(__t('The amount must be between %1$s and %2$s', "0." + "0".repeat(parseInt(Grocy.UserSettings.stock_decimal_places_amounts) - 1) + "1", parseFloat(productDetails.stock_amount).toLocaleString({ minimumFractionDigits: 0, maximumFractionDigits: Grocy.UserSettings.stock_decimal_places_amounts })));
}
else
{
$("#display_amount").attr("min", "1");
$("#display_amount").attr("step", "1");
$("#display_amount").parent().find(".invalid-feedback").text(__t('The amount must be between %1$s and %2$s', "1", parseFloat(productDetails.stock_amount).toLocaleString({ minimumFractionDigits: 0, maximumFractionDigits: Grocy.UserSettings.stock_decimal_places_amounts })));
}
$('#display_amount').attr('max', sumValue); $('#display_amount').attr('max', sumValue);
if (sumValue == 0) if (sumValue == 0)

View File

@ -83,8 +83,6 @@
$('#inventory-change-info').addClass('d-none'); $('#inventory-change-info').addClass('d-none');
$("#tare-weight-handling-info").addClass("d-none"); $("#tare-weight-handling-info").addClass("d-none");
$("#display_amount").attr("min", "0"); $("#display_amount").attr("min", "0");
$("#display_amount").attr("step", "1");
$("#display_amount").parent().find(".invalid-feedback").text(__t('The amount cannot be lower than %s', '0'));
$('#display_amount').val(''); $('#display_amount').val('');
$(".input-group-productamountpicker").trigger("change"); $(".input-group-productamountpicker").trigger("change");
$('#price').val(''); $('#price').val('');
@ -138,27 +136,14 @@ Grocy.Components.ProductPicker.GetPicker().on('change', function(e)
$('#display_amount').attr("data-stock-amount", productDetails.stock_amount) $('#display_amount').attr("data-stock-amount", productDetails.stock_amount)
$('#display_amount').attr('data-not-equal', productDetails.stock_amount * $("#qu_id option:selected").attr("data-qu-factor")); $('#display_amount').attr('data-not-equal', productDetails.stock_amount * $("#qu_id option:selected").attr("data-qu-factor"));
if (productDetails.product.allow_partial_units_in_stock == 1)
{
$("#display_amount").attr("min", "0." + "0".repeat(parseInt(Grocy.UserSettings.stock_decimal_places_amounts) - 1) + "1");
$("#display_amount").attr("step", "." + "0".repeat(parseInt(Grocy.UserSettings.stock_decimal_places_amounts) - 1) + "1");
$("#display_amount").parent().find(".invalid-feedback").text(__t('The amount cannot be lower than %1$s or equal %2$s', "0." + "0".repeat(parseInt(Grocy.UserSettings.stock_decimal_places_amounts) - 1) + "1", productDetails.stock_amount.toLocaleString({ minimumFractionDigits: 0, maximumFractionDigits: Grocy.UserSettings.stock_decimal_places_amounts })));
}
else
{
$("#display_amount").attr("min", "0");
$("#display_amount").attr("step", "1");
$("#display_amount").parent().find(".invalid-feedback").text(__t('The amount cannot be lower than %1$s or equal %2$s', '0', productDetails.stock_amount.toLocaleString({ minimumFractionDigits: 0, maximumFractionDigits: Grocy.UserSettings.stock_decimal_places_amounts })));
}
if (productDetails.product.enable_tare_weight_handling == 1) if (productDetails.product.enable_tare_weight_handling == 1)
{ {
$("#display_amount").attr("min", productDetails.product.tare_weight); $("#display_amount").attr("min", productDetails.product.tare_weight);
$("#display_amount").parent().find(".invalid-feedback").text(__t('The amount cannot be lower than %1$s or equal %2$s', parseFloat(productDetails.product.tare_weight).toLocaleString({ minimumFractionDigits: 0, maximumFractionDigits: Grocy.UserSettings.stock_decimal_places_amounts }), (parseFloat(productDetails.stock_amount) + parseFloat(productDetails.product.tare_weight)).toLocaleString()));
$("#tare-weight-handling-info").removeClass("d-none"); $("#tare-weight-handling-info").removeClass("d-none");
} }
else else
{ {
$("#display_amount").attr("min", "0." + "0".repeat(parseInt(Grocy.UserSettings.stock_decimal_places_amounts) - 1) + "1");
$("#tare-weight-handling-info").addClass("d-none"); $("#tare-weight-handling-info").addClass("d-none");
} }
@ -243,7 +228,6 @@ $('#inventory-form input').keydown(function(event)
$('#qu_id').on('change', function(e) $('#qu_id').on('change', function(e)
{ {
$('#display_amount').attr('data-not-equal', parseFloat($('#display_amount').attr('data-stock-amount')) * parseFloat($("#qu_id option:selected").attr("data-qu-factor"))); $('#display_amount').attr('data-not-equal', parseFloat($('#display_amount').attr('data-stock-amount')) * parseFloat($("#qu_id option:selected").attr("data-qu-factor")));
$("#display_amount").parent().find(".invalid-feedback").text(__t('The amount cannot be lower than %1$s or equal %2$s', "0." + "0".repeat(parseInt(Grocy.UserSettings.stock_decimal_places_amounts) - 1) + "1", parseFloat($('#display_amount').attr('data-not-equal')).toLocaleString({ minimumFractionDigits: 0, maximumFractionDigits: Grocy.UserSettings.stock_decimal_places_amounts })));
Grocy.FrontendHelpers.ValidateForm('inventory-form'); Grocy.FrontendHelpers.ValidateForm('inventory-form');
}); });

View File

@ -81,3 +81,4 @@ if (Grocy.EditMode == "edit")
Grocy.FrontendHelpers.ValidateForm('barcode-form'); Grocy.FrontendHelpers.ValidateForm('barcode-form');
$('#barcode').focus(); $('#barcode').focus();
RefreshLocaleNumberInput();

View File

@ -247,34 +247,6 @@ $("#enable_tare_weight_handling").on("click", function()
Grocy.FrontendHelpers.ValidateForm("product-form"); Grocy.FrontendHelpers.ValidateForm("product-form");
}); });
$("#allow_partial_units_in_stock").on("click", function()
{
if (this.checked)
{
$("#min_stock_amount").attr("min", "0." + "0".repeat(parseInt(Grocy.UserSettings.stock_decimal_places_amounts)));
$("#min_stock_amount").attr("step", "." + "0".repeat(parseInt(Grocy.UserSettings.stock_decimal_places_amounts) - 1) + "1");
$("#qu_factor_purchase_to_stock").attr("min", "0." + "0".repeat(parseInt(Grocy.UserSettings.stock_decimal_places_amounts) - 1) + "1");
$("#qu_factor_purchase_to_stock").attr("step", "." + "0".repeat(parseInt(Grocy.UserSettings.stock_decimal_places_amounts) - 1) + "1");
$("#qu_factor_purchase_to_stock").parent().find(".invalid-feedback").text(__t('This cannot be lower than %1$s and must be a valid number with max. %2$s decimal places', "0." + "0".repeat(parseInt(Grocy.UserSettings.stock_decimal_places_amounts) - 1) + "1", Grocy.UserSettings.stock_decimal_places_amounts));
$("#quick_consume_amount").attr("min", "0." + "0".repeat(parseInt(Grocy.UserSettings.stock_decimal_places_amounts) - 1) + "1");
$("#quick_consume_amount").attr("step", "." + "0".repeat(parseInt(Grocy.UserSettings.stock_decimal_places_amounts) - 1) + "1");
$("#quick_consume_amount").parent().find(".invalid-feedback").text(__t('This cannot be lower than %1$s and must be a valid number with max. %2$s decimal places', "0." + "0".repeat(parseInt(Grocy.UserSettings.stock_decimal_places_amounts) - 1) + "1", Grocy.UserSettings.stock_decimal_places_amounts));
}
else
{
$("#min_stock_amount").attr("min", "0");
$("#min_stock_amount").attr("step", "1");
$("#qu_factor_purchase_to_stock").attr("min", "1");
$("#qu_factor_purchase_to_stock").attr("step", "1");
$("#qu_factor_purchase_to_stock").parent().find(".invalid-feedback").text(__t('This cannot be lower than %1$s and must be a valid number with max. %2$s decimal places', '1', '0'));
$("#quick_consume_amount").attr("min", "1");
$("#quick_consume_amount").attr("step", "1");
$("#quick_consume_amount").parent().find(".invalid-feedback").text(__t('This cannot be lower than %1$s and must be a valid number with max. %2$s decimal places', '1', '0'));
}
Grocy.FrontendHelpers.ValidateForm("product-form");
});
$("#product-picture").on("change", function(e) $("#product-picture").on("change", function(e)
{ {
$("#product-picture-label").removeClass("d-none"); $("#product-picture-label").removeClass("d-none");
@ -346,10 +318,6 @@ $('#name').focus();
$('.input-group-qu').trigger('change'); $('.input-group-qu').trigger('change');
Grocy.FrontendHelpers.ValidateForm('product-form'); Grocy.FrontendHelpers.ValidateForm('product-form');
// Click twice to trigger on-click but not change the actual checked state
$("#allow_partial_units_in_stock").click();
$("#allow_partial_units_in_stock").click();
$(document).on('click', '.qu-conversion-delete-button', function(e) $(document).on('click', '.qu-conversion-delete-button', function(e)
{ {
var objectId = $(e.currentTarget).attr('data-qu-conversion-id'); var objectId = $(e.currentTarget).attr('data-qu-conversion-id');
@ -479,10 +447,6 @@ if (Grocy.EditMode == "create" && GetUriParam("copy-of") != undefined)
$("#qu_id_stock").val(sourceProduct.qu_id_stock); $("#qu_id_stock").val(sourceProduct.qu_id_stock);
$("#qu_id_purchase").val(sourceProduct.qu_id_purchase); $("#qu_id_purchase").val(sourceProduct.qu_id_purchase);
$("#qu_factor_purchase_to_stock").val(sourceProduct.qu_factor_purchase_to_stock); $("#qu_factor_purchase_to_stock").val(sourceProduct.qu_factor_purchase_to_stock);
if (BoolVal(sourceProduct.allow_partial_units_in_stock))
{
$("#allow_partial_units_in_stock").prop("checked", true);
}
if (BoolVal(sourceProduct.enable_tare_weight_handling)) if (BoolVal(sourceProduct.enable_tare_weight_handling))
{ {
$("#enable_tare_weight_handling").prop("checked", true); $("#enable_tare_weight_handling").prop("checked", true);

View File

@ -108,9 +108,7 @@ $('#save-purchase-button').on('click', function(e)
} }
Grocy.Components.ProductAmountPicker.Reset(); Grocy.Components.ProductAmountPicker.Reset();
$("#display_amount").attr("min", "1"); $("#display_amount").attr("min", "0." + "0".repeat(parseInt(Grocy.UserSettings.stock_decimal_places_amounts) - 1) + "1");
$("#display_amount").attr("step", "1");
$("#display_amount").parent().find(".invalid-feedback").text(__t('The amount cannot be lower than %s', '1'));
$('#display_amount').val(parseFloat(Grocy.UserSettings.stock_default_purchase_amount)); $('#display_amount').val(parseFloat(Grocy.UserSettings.stock_default_purchase_amount));
$(".input-group-productamountpicker").trigger("change"); $(".input-group-productamountpicker").trigger("change");
$('#price').val(''); $('#price').val('');
@ -220,29 +218,15 @@ if (Grocy.Components.ProductPicker !== undefined)
refreshPriceHint(); refreshPriceHint();
if (productDetails.product.allow_partial_units_in_stock == 1)
{
$("#display_amount").attr("min", "0." + "0".repeat(parseInt(Grocy.UserSettings.stock_decimal_places_amounts) - 1) + "1");
$("#display_amount").attr("step", "." + "0".repeat(parseInt(Grocy.UserSettings.stock_decimal_places_amounts) - 1) + "1");
$("#display_amount").parent().find(".invalid-feedback").text(__t('The amount cannot be lower than %s', "0." + "0".repeat(parseInt(Grocy.UserSettings.stock_decimal_places_amounts) - 1) + "1"));
}
else
{
$("#display_amount").attr("min", "1");
$("#display_amount").attr("step", "1");
$("#display_amount").parent().find(".invalid-feedback").text(__t('The amount cannot be lower than %s', '1'));
}
if (productDetails.product.enable_tare_weight_handling == 1) if (productDetails.product.enable_tare_weight_handling == 1)
{ {
var minAmount = parseFloat(productDetails.product.tare_weight) / $("#qu_id option:selected").attr("data-qu-factor") + parseFloat(productDetails.stock_amount); var minAmount = parseFloat(productDetails.product.tare_weight) / $("#qu_id option:selected").attr("data-qu-factor") + parseFloat(productDetails.stock_amount);
$("#display_amount").attr("min", minAmount); $("#display_amount").attr("min", minAmount);
$("#display_amount").attr("step", "." + "0".repeat(parseInt(Grocy.UserSettings.stock_decimal_places_amounts) - 1) + "1");
$("#display_amount").parent().find(".invalid-feedback").text(__t('The amount cannot be lower than %s', minAmount.toLocaleString({ minimumFractionDigits: 0, maximumFractionDigits: Grocy.UserSettings.stock_decimal_places_amounts })));
$("#tare-weight-handling-info").removeClass("d-none"); $("#tare-weight-handling-info").removeClass("d-none");
} }
else else
{ {
$("#display_amount").attr("min", "0." + "0".repeat(parseInt(Grocy.UserSettings.stock_decimal_places_amounts) - 1) + "1");
$("#tare-weight-handling-info").addClass("d-none"); $("#tare-weight-handling-info").addClass("d-none");
} }

View File

@ -62,19 +62,6 @@ Grocy.Components.ProductPicker.GetPicker().on('change', function(e)
Grocy.Components.ProductAmountPicker.Reload(productDetails.product.id, productDetails.quantity_unit_stock.id); Grocy.Components.ProductAmountPicker.Reload(productDetails.product.id, productDetails.quantity_unit_stock.id);
} }
if (productDetails.product.allow_partial_units_in_stock == 1)
{
$("#display_amount").attr("min", "0." + "0".repeat(parseInt(Grocy.UserSettings.stock_decimal_places_amounts) - 1) + "1");
$("#display_amount").attr("step", "." + "0".repeat(parseInt(Grocy.UserSettings.stock_decimal_places_amounts) - 1) + "1");
$("#display_amount").parent().find(".invalid-feedback").text(__t('The amount cannot be lower than %s', "0." + "0".repeat(parseInt(Grocy.UserSettings.stock_decimal_places_amounts) - 1) + "1"));
}
else
{
$("#display_amount").attr("min", "1");
$("#display_amount").attr("step", "1");
$("#display_amount").parent().find(".invalid-feedback").text(__t('The amount cannot be lower than %s', '1'));
}
if (Grocy.Mode == "create") if (Grocy.Mode == "create")
{ {
$("#not_check_stock_fulfillment").prop("checked", productDetails.product.not_check_stock_fulfillment_for_recipes == 1); $("#not_check_stock_fulfillment").prop("checked", productDetails.product.not_check_stock_fulfillment_for_recipes == 1);
@ -154,17 +141,13 @@ $("#only_check_single_unit_in_stock").on("click", function()
if (this.checked) if (this.checked)
{ {
$("#display_amount").attr("min", "0." + "0".repeat(parseInt(Grocy.UserSettings.stock_decimal_places_amounts) - 1) + "1"); $("#display_amount").attr("min", "0." + "0".repeat(parseInt(Grocy.UserSettings.stock_decimal_places_amounts) - 1) + "1");
$("#display_amount").attr("step", "." + "0".repeat(parseInt(Grocy.UserSettings.stock_decimal_places_amounts) - 1) + "1");
$("#display_amount").parent().find(".invalid-feedback").text(__t("This cannot be negative"));
Grocy.Components.ProductAmountPicker.AllowAnyQu(true); Grocy.Components.ProductAmountPicker.AllowAnyQu(true);
Grocy.FrontendHelpers.ValidateForm("recipe-pos-form"); Grocy.FrontendHelpers.ValidateForm("recipe-pos-form");
} }
else else
{ {
$("#display_amount").attr("min", "0"); $("#display_amount").attr("min", "0");
$("#display_amount").attr("step", "1");
Grocy.Components.ProductPicker.GetPicker().trigger("change"); // Selects the default quantity unit of the selected product Grocy.Components.ProductPicker.GetPicker().trigger("change"); // Selects the default quantity unit of the selected product
$("#display_amount").parent().find(".invalid-feedback").text(__t("This cannot be negative and must be an integral number"));
Grocy.Components.ProductAmountPicker.AllowAnyQuEnabled = false; Grocy.Components.ProductAmountPicker.AllowAnyQuEnabled = false;
Grocy.FrontendHelpers.ValidateForm("recipe-pos-form"); Grocy.FrontendHelpers.ValidateForm("recipe-pos-form");
} }

View File

@ -216,5 +216,3 @@ if (GetUriParam("amount") !== undefined)
$(".input-group-productamountpicker").trigger("change"); $(".input-group-productamountpicker").trigger("change");
Grocy.FrontendHelpers.ValidateForm('shoppinglist-form'); Grocy.FrontendHelpers.ValidateForm('shoppinglist-form');
} }
$("#display_amount").parent().find(".invalid-feedback").text(__t('The amount cannot be lower than %s', "0." + "0".repeat(parseInt(Grocy.UserSettings.stock_decimal_places_amounts) - 1) + "1"));

View File

@ -96,19 +96,6 @@ Grocy.Api.Get('stock/products/' + Grocy.EditObjectProductId,
function(productDetails) function(productDetails)
{ {
$('#amount_qu_unit').text(productDetails.quantity_unit_stock.name); $('#amount_qu_unit').text(productDetails.quantity_unit_stock.name);
if (productDetails.product.allow_partial_units_in_stock == 1)
{
$("#amount").attr("min", "0." + "0".repeat(parseInt(Grocy.UserSettings.stock_decimal_places_amounts) - 1) + "1");
$("#amount").attr("step", "." + "0".repeat(parseInt(Grocy.UserSettings.stock_decimal_places_amounts) - 1) + "1");
$("#amount").parent().find(".invalid-feedback").text(__t('The amount cannot be lower than %1$s', "0." + "0".repeat(parseInt(Grocy.UserSettings.stock_decimal_places_amounts) - 1) + "1"));
}
else
{
$("#amount").attr("min", "1");
$("#amount").attr("step", "1");
$("#amount").parent().find(".invalid-feedback").text(__t('The amount cannot be lower than %1$s', '1'));
}
}, },
function(xhr) function(xhr)
{ {

View File

@ -1,6 +1,5 @@
var stockOverviewTable = $('#stock-overview-table').DataTable({ var stockOverviewTable = $('#stock-overview-table').DataTable({
'order': [[4, 'asc']], 'order': [[4, 'asc']],
'colReorder': false,
'columnDefs': [ 'columnDefs': [
{ 'orderable': false, 'targets': 0 }, { 'orderable': false, 'targets': 0 },
{ 'searchable': false, "targets": 0 }, { 'searchable': false, "targets": 0 },

View File

@ -89,10 +89,8 @@
Grocy.Components.ProductAmountPicker.Reset(); Grocy.Components.ProductAmountPicker.Reset();
$("#location_id_from").find("option").remove().end().append("<option></option>"); $("#location_id_from").find("option").remove().end().append("<option></option>");
$("#display_amount").attr("min", "1"); $("#display_amount").attr("min", "0." + "0".repeat(parseInt(Grocy.UserSettings.stock_decimal_places_amounts) - 1) + "1");
$("#display_amount").attr("max", "999999"); $("#display_amount").attr("max", "999999");
$("#display_amount").attr("step", "1");
$("#display_amount").parent().find(".invalid-feedback").text(__t('The amount cannot be lower than %s', '1'));
$('#display_amount').val(parseFloat(Grocy.UserSettings.stock_default_transfer_amount)); $('#display_amount').val(parseFloat(Grocy.UserSettings.stock_default_transfer_amount));
RefreshLocaleNumberInput(); RefreshLocaleNumberInput();
$(".input-group-productamountpicker").trigger("change"); $(".input-group-productamountpicker").trigger("change");
@ -144,7 +142,7 @@ Grocy.Components.ProductPicker.GetPicker().on('change', function(e)
if (productDetails.product.enable_tare_weight_handling == 1) if (productDetails.product.enable_tare_weight_handling == 1)
{ {
Grocy.Components.ProductPicker.GetPicker().parent().find(".invalid-feedback").text(__t('Products with Tare weight enabled are currently not supported for Transfer. Please select another product.')); Grocy.Components.ProductPicker.GetPicker().parent().find(".invalid-feedback").text(__t('Products with tare weight enabled are currently not supported for transfer'));
Grocy.Components.ProductPicker.Clear(); Grocy.Components.ProductPicker.Clear();
return; return;
} }
@ -189,19 +187,6 @@ Grocy.Components.ProductPicker.GetPicker().on('change', function(e)
} }
); );
if (productDetails.product.allow_partial_units_in_stock == 1)
{
$("#display_amount").attr("min", "0." + "0".repeat(parseInt(Grocy.UserSettings.stock_decimal_places_amounts) - 1) + "1");
$("#display_amount").attr("step", "." + "0".repeat(parseInt(Grocy.UserSettings.stock_decimal_places_amounts) - 1) + "1");
$("#display_amount").parent().find(".invalid-feedback").text(__t('The amount must be between %1$s and %2$s', "0." + "0".repeat(parseInt(Grocy.UserSettings.stock_decimal_places_amounts) - 1) + "1"));
}
else
{
$("#display_amount").attr("min", "1");
$("#display_amount").attr("step", "1");
$("#display_amount").parent().find(".invalid-feedback").text(__t('The amount must be between %1$s and %2$s', "1", parseFloat(productDetails.stock_amount).toLocaleString({ minimumFractionDigits: 0, maximumFractionDigits: 4 })));
}
if (productDetails.product.enable_tare_weight_handling == 1) if (productDetails.product.enable_tare_weight_handling == 1)
{ {
$("#display_amount").attr("min", productDetails.product.tare_weight); $("#display_amount").attr("min", productDetails.product.tare_weight);
@ -209,6 +194,7 @@ Grocy.Components.ProductPicker.GetPicker().on('change', function(e)
} }
else else
{ {
$("#display_amount").attr("min", "0." + "0".repeat(parseInt(Grocy.UserSettings.stock_decimal_places_amounts) - 1) + "1");
$("#tare-weight-handling-info").addClass("d-none"); $("#tare-weight-handling-info").addClass("d-none");
} }
@ -293,10 +279,6 @@ $("#location_id_from").on('change', function(e)
{ {
$("#display_amount").parent().find(".invalid-feedback").text(__t('There are no units available at this location')); $("#display_amount").parent().find(".invalid-feedback").text(__t('There are no units available at this location'));
} }
else
{
$("#display_amount").parent().find(".invalid-feedback").text(__t('The amount must be between %1$s and %2$s', "1", sumValue));
}
}, },
function(xhr) function(xhr)
{ {
@ -369,10 +351,6 @@ $("#specific_stock_entry").on("change", function(e)
{ {
$("#display_amount").parent().find(".invalid-feedback").text(__t('There are no units available at this location')); $("#display_amount").parent().find(".invalid-feedback").text(__t('There are no units available at this location'));
} }
else
{
$("#display_amount").parent().find(".invalid-feedback").text(__t('The amount must be between %1$s and %2$s', "1", sumValue));
}
}, },
function(xhr) function(xhr)
{ {
@ -382,7 +360,6 @@ $("#specific_stock_entry").on("change", function(e)
} }
else else
{ {
$("#display_amount").parent().find(".invalid-feedback").text(__t('The amount must be between %1$s and %2$s', "1", $('option:selected', this).attr('amount')));
$("#display_amount").attr("max", $('option:selected', this).attr('amount')); $("#display_amount").attr("max", $('option:selected', this).attr('amount'));
} }
}); });

View File

@ -55,7 +55,7 @@
<span class="text-danger">{{ $__t('Miss') }}: <span id="miss-count" <span class="text-danger">{{ $__t('Miss') }}: <span id="miss-count"
class="locale-number locale-number-generic">0</span></span> class="locale-number locale-number-generic">0</span></span>
</div> </div>
<select class="form-control" <select class="custom-control custom-select"
id="scanned_codes" id="scanned_codes"
name="scanned_codes" name="scanned_codes"
multiple multiple

View File

@ -39,7 +39,7 @@
<div class="input-group-prepend"> <div class="input-group-prepend">
<span class="input-group-text"><i class="fas fa-filter"></i>&nbsp;{{ $__t('Battery') }}</span> <span class="input-group-text"><i class="fas fa-filter"></i>&nbsp;{{ $__t('Battery') }}</span>
</div> </div>
<select class="form-control" <select class="custom-control custom-select"
id="battery-filter"> id="battery-filter">
<option value="all">{{ $__t('All') }}</option> <option value="all">{{ $__t('All') }}</option>
@foreach($batteries as $battery) @foreach($batteries as $battery)

View File

@ -71,7 +71,7 @@
<div class="input-group-prepend"> <div class="input-group-prepend">
<span class="input-group-text"><i class="fas fa-filter"></i>&nbsp;{{ $__t('Status') }}</span> <span class="input-group-text"><i class="fas fa-filter"></i>&nbsp;{{ $__t('Status') }}</span>
</div> </div>
<select class="form-control" <select class="custom-control custom-select"
id="status-filter"> id="status-filter">
<option value="all">{{ $__t('All') }}</option> <option value="all">{{ $__t('All') }}</option>
<option value="duesoon">{{ $__t('Due soon') }}</option> <option value="duesoon">{{ $__t('Due soon') }}</option>

View File

@ -21,7 +21,6 @@
'additionalAttributes' => 'data-setting-key="batteries_due_soon_days"', 'additionalAttributes' => 'data-setting-key="batteries_due_soon_days"',
'label' => 'Due soon days', 'label' => 'Due soon days',
'min' => 1, 'min' => 1,
'invalidFeedback' => $__t('This cannot be lower than %s', '1'),
'additionalCssClasses' => 'user-setting-control' 'additionalCssClasses' => 'user-setting-control'
)) ))

View File

@ -68,8 +68,7 @@
'label' => 'Charge cycle interval (days)', 'label' => 'Charge cycle interval (days)',
'value' => $value, 'value' => $value,
'min' => '0', 'min' => '0',
'hint' => $__t('0 means suggestions for the next charge cycle are disabled'), 'hint' => $__t('0 means suggestions for the next charge cycle are disabled')
'invalidFeedback' => $__t('This cannot be negative')
)) ))
@include('components.userfieldsform', array( @include('components.userfieldsform', array(

View File

@ -57,7 +57,7 @@
data-toggle="tooltip" data-toggle="tooltip"
title=""></i></label> title=""></i></label>
<select required <select required
class="form-control input-group-chore-period-type" class="custom-control custom-select input-group-chore-period-type"
id="period_type" id="period_type"
name="period_type"> name="period_type">
@foreach($periodTypes as $periodType) @foreach($periodTypes as $periodType)
@ -76,7 +76,6 @@
'value' => $value, 'value' => $value,
'min' => '0', 'min' => '0',
'additionalCssClasses' => 'input-group-chore-period-type', 'additionalCssClasses' => 'input-group-chore-period-type',
'invalidFeedback' => $__t('This cannot be negative'),
'additionalGroupCssClasses' => 'period-type-input period-type-dynamic-regular period-type-monthly' 'additionalGroupCssClasses' => 'period-type-input period-type-dynamic-regular period-type-monthly'
)) ))
@ -151,7 +150,6 @@
'value' => $value, 'value' => $value,
'min' => '1', 'min' => '1',
'additionalCssClasses' => 'input-group-chore-period-type', 'additionalCssClasses' => 'input-group-chore-period-type',
'invalidFeedback' => $__t('This cannot be lower than %s', '1'),
'additionalGroupCssClasses' => 'period-type-input period-type-daily period-type-weekly period-type-monthly period-type-yearly', 'additionalGroupCssClasses' => 'period-type-input period-type-daily period-type-weekly period-type-monthly period-type-yearly',
'hintId' => 'chore-period-interval-info' 'hintId' => 'chore-period-interval-info'
)) ))
@ -163,7 +161,7 @@
data-toggle="tooltip" data-toggle="tooltip"
title=""></i></label> title=""></i></label>
<select required <select required
class="form-control input-group-chore-assignment-type" class="custom-control custom-select input-group-chore-assignment-type"
id="assignment_type" id="assignment_type"
name="assignment_type"> name="assignment_type">
@foreach($assignmentTypes as $assignmentType) @foreach($assignmentTypes as $assignmentType)
@ -179,7 +177,7 @@
<label for="assignment_config">{{ $__t('Assign to') }}</label> <label for="assignment_config">{{ $__t('Assign to') }}</label>
<select required <select required
multiple multiple
class="form-control input-group-chore-assignment-type selectpicker" class="custom-control custom-select input-group-chore-assignment-type selectpicker"
id="assignment_config" id="assignment_config"
name="assignment_config" name="assignment_config"
data-actions-Box="true" data-actions-Box="true"
@ -256,9 +254,8 @@
'id' => 'product_amount', 'id' => 'product_amount',
'label' => 'Amount', 'label' => 'Amount',
'contextInfoId' => 'amount_qu_unit', 'contextInfoId' => 'amount_qu_unit',
'min' => '', 'min' => '0.' . str_repeat('0', $userSettings['stock_decimal_places_amounts'] - 1) . '1',
'decimals' => $userSettings['stock_decimal_places_amounts'], 'decimals' => $userSettings['stock_decimal_places_amounts'],
'invalidFeedback' => $__t('The amount cannot be lower than %s', '1'),
'isRequired' => false, 'isRequired' => false,
'value' => $value, 'value' => $value,
'additionalCssClasses' => 'locale-number-input locale-number-quantity-amount' 'additionalCssClasses' => 'locale-number-input locale-number-quantity-amount'

View File

@ -39,7 +39,7 @@
<div class="input-group-prepend"> <div class="input-group-prepend">
<span class="input-group-text"><i class="fas fa-filter"></i>&nbsp;{{ $__t('Chore') }}</span> <span class="input-group-text"><i class="fas fa-filter"></i>&nbsp;{{ $__t('Chore') }}</span>
</div> </div>
<select class="form-control" <select class="custom-control custom-select"
id="chore-filter"> id="chore-filter">
<option value="all">{{ $__t('All') }}</option> <option value="all">{{ $__t('All') }}</option>
@foreach($chores as $chore) @foreach($chores as $chore)

View File

@ -76,7 +76,7 @@
<div class="input-group-prepend"> <div class="input-group-prepend">
<span class="input-group-text"><i class="fas fa-filter"></i>&nbsp;{{ $__t('Status') }}</span> <span class="input-group-text"><i class="fas fa-filter"></i>&nbsp;{{ $__t('Status') }}</span>
</div> </div>
<select class="form-control" <select class="custom-control custom-select"
id="status-filter"> id="status-filter">
<option value="all">{{ $__t('All') }}</option> <option value="all">{{ $__t('All') }}</option>
<option value="duesoon">{{ $__t('Due soon') }}</option> <option value="duesoon">{{ $__t('Due soon') }}</option>
@ -90,7 +90,7 @@
<div class="input-group-prepend"> <div class="input-group-prepend">
<span class="input-group-text"><i class="fas fa-filter"></i>&nbsp;{{ $__t('Assignment') }}</span> <span class="input-group-text"><i class="fas fa-filter"></i>&nbsp;{{ $__t('Assignment') }}</span>
</div> </div>
<select class="form-control" <select class="custom-control custom-select"
id="user-filter"> id="user-filter">
<option></option> <option></option>
@foreach($users as $user) @foreach($users as $user)

View File

@ -21,7 +21,6 @@
'additionalAttributes' => 'data-setting-key="chores_due_soon_days"', 'additionalAttributes' => 'data-setting-key="chores_due_soon_days"',
'label' => 'Due soon days', 'label' => 'Due soon days',
'min' => 1, 'min' => 1,
'invalidFeedback' => $__t('This cannot be lower than %s', '1'),
'additionalCssClasses' => 'user-setting-control' 'additionalCssClasses' => 'user-setting-control'
)) ))

View File

@ -65,7 +65,7 @@
<div class="invalid-feedback">{{ $invalidFeedback }}</div> <div class="invalid-feedback">{{ $invalidFeedback }}</div>
</div> </div>
<div id="datetimepicker-earlier-than-info" <div id="datetimepicker-earlier-than-info"
class="form-text text-info font-italic d-none">{{ $earlierThanInfoText }}</div> class="form-text text-info font-italic w-100 d-none">{{ $earlierThanInfoText }}</div>
@if(isset($shortcutValue) && isset($shortcutLabel)) @if(isset($shortcutValue) && isset($shortcutLabel))
<div class="form-group mt-n2 mb-0"> <div class="form-group mt-n2 mb-0">
<div class="custom-control custom-checkbox"> <div class="custom-control custom-checkbox">

View File

@ -61,7 +61,7 @@
<div class="invalid-feedback">{{ $invalidFeedback }}</div> <div class="invalid-feedback">{{ $invalidFeedback }}</div>
</div> </div>
<div id="datetimepicker2-earlier-than-info" <div id="datetimepicker2-earlier-than-info"
class="form-text text-info font-italic d-none">{{ $earlierThanInfoText }}</div> class="form-text text-info font-italic w-100 d-none">{{ $earlierThanInfoText }}</div>
@if(isset($shortcutValue) && isset($shortcutLabel)) @if(isset($shortcutValue) && isset($shortcutLabel))
<div class="form-group mt-n2 mb-0> <div class="form-group mt-n2 mb-0>
<div class=" <div class="

View File

@ -16,6 +16,7 @@
@php if(!isset($isRequired)) { $isRequired = true; } @endphp @php if(!isset($isRequired)) { $isRequired = true; } @endphp
@php if(!isset($noNameAttribute)) { $noNameAttribute = false; } @endphp @php if(!isset($noNameAttribute)) { $noNameAttribute = false; } @endphp
@php if(empty($contextInfoId)) { $additionalHtmlContextHelp = ''; } @endphp @php if(empty($contextInfoId)) { $additionalHtmlContextHelp = ''; } @endphp
@php if(!isset($invalidFeedback)) { $invalidFeedback = ''; } @endphp
<div id="group-{{ $id }}" <div id="group-{{ $id }}"
class="form-group {{ $additionalGroupCssClasses }}"> class="form-group {{ $additionalGroupCssClasses }}">
@ -47,6 +48,7 @@
min="{{ number_format($min, $decimals, '.', '') }}" min="{{ number_format($min, $decimals, '.', '') }}"
max="{{ number_format($max, $decimals, '.', '') }}" max="{{ number_format($max, $decimals, '.', '') }}"
step="@if($decimals == 0){{1}}@else{{'.' . str_repeat('0', $userSettings['stock_decimal_places_amounts'] - 1) . '1'}}@endif" step="@if($decimals == 0){{1}}@else{{'.' . str_repeat('0', $userSettings['stock_decimal_places_amounts'] - 1) . '1'}}@endif"
data-decimals="{{ $decimals }}"
@if($isRequired) @if($isRequired)
required required
@endif> @endif>

View File

@ -21,7 +21,6 @@
'min' => '0.' . str_repeat('0', $userSettings['stock_decimal_places_amounts'] - 1) . '1', 'min' => '0.' . str_repeat('0', $userSettings['stock_decimal_places_amounts'] - 1) . '1',
'decimals' => $userSettings['stock_decimal_places_amounts'], 'decimals' => $userSettings['stock_decimal_places_amounts'],
'value' => $value, 'value' => $value,
'invalidFeedback' => $__t('This cannot be negative and must be an integral number'),
'additionalGroupCssClasses' => 'col-sm-5 col-xs-12 my-0', 'additionalGroupCssClasses' => 'col-sm-5 col-xs-12 my-0',
'additionalCssClasses' => 'input-group-productamountpicker locale-number-input locale-number-quantity-amount', 'additionalCssClasses' => 'input-group-productamountpicker locale-number-input locale-number-quantity-amount',
'additionalHtmlContextHelp' => '', 'additionalHtmlContextHelp' => '',
@ -33,7 +32,7 @@
<select @if($isRequired) <select @if($isRequired)
required required
@endif @endif
class="form-control input-group-productamountpicker" class="custom-control custom-select input-group-productamountpicker"
id="qu_id" id="qu_id"
name="qu_id" name="qu_id"
data-initial-qu-id="{{ $initialQuId }}"> data-initial-qu-id="{{ $initialQuId }}">

View File

@ -89,7 +89,7 @@
@elseif($userfield->type == \Grocy\Services\UserfieldsService::USERFIELD_TYPE_PRESET_LIST) @elseif($userfield->type == \Grocy\Services\UserfieldsService::USERFIELD_TYPE_PRESET_LIST)
<div class="form-group"> <div class="form-group">
<label for="{{ $userfield->name }}">{{ $userfield->caption }}</label> <label for="{{ $userfield->name }}">{{ $userfield->caption }}</label>
<select class="form-control userfield-input" <select class="custom-control custom-select userfield-input"
data-userfield-name="{{ $userfield->name }}"> data-userfield-name="{{ $userfield->name }}">
<option></option> <option></option>
@foreach(preg_split('/\r\n|\r|\n/', $userfield->config) as $option) @foreach(preg_split('/\r\n|\r|\n/', $userfield->config) as $option)
@ -101,7 +101,7 @@
<div class="form-group"> <div class="form-group">
<label for="{{ $userfield->name }}">{{ $userfield->caption }}</label> <label for="{{ $userfield->name }}">{{ $userfield->caption }}</label>
<select multiple <select multiple
class="form-control userfield-input selectpicker" class="custom-control custom-select userfield-input selectpicker"
data-userfield-name="{{ $userfield->name }}" data-userfield-name="{{ $userfield->name }}"
data-actions-Box="true" data-actions-Box="true"
data-live-search="true"> data-live-search="true">

View File

@ -82,7 +82,7 @@
<div class="form-group"> <div class="form-group">
<label for="location_id">{{ $__t('Location') }}</label> <label for="location_id">{{ $__t('Location') }}</label>
<select required <select required
class="form-control location-combobox" class="custom-control custom-select location-combobox"
id="location_id" id="location_id"
name="location_id"> name="location_id">
<option></option> <option></option>
@ -122,7 +122,7 @@
</label> </label>
</div> </div>
<select disabled <select disabled
class="form-control mt-2" class="custom-control custom-select mt-2"
id="specific_stock_entry" id="specific_stock_entry"
name="specific_stock_entry"> name="specific_stock_entry">
<option></option> <option></option>

View File

@ -28,7 +28,6 @@
@include('components.productamountpicker', array( @include('components.productamountpicker', array(
'value' => 1, 'value' => 1,
'label' => 'New stock amount', 'label' => 'New stock amount',
'additionalAttributes' => 'data-not-equal="-1"',
'additionalHtmlElements' => '<div id="inventory-change-info" 'additionalHtmlElements' => '<div id="inventory-change-info"
class="form-text text-muted d-none ml-3 my-0 w-100"></div>', class="form-text text-muted d-none ml-3 my-0 w-100"></div>',
'additionalHtmlContextHelp' => '<div id="tare-weight-handling-info" 'additionalHtmlContextHelp' => '<div id="tare-weight-handling-info"
@ -82,14 +81,13 @@
@include('components.numberpicker', array( @include('components.numberpicker', array(
'id' => 'price', 'id' => 'price',
'label' => 'Price', 'label' => 'Price',
'min' => 0, 'min' => '0.' . str_repeat('0', $userSettings['stock_decimal_places_amounts'] - 1) . '1',
'decimals' => $userSettings['stock_decimal_places_prices'], 'decimals' => $userSettings['stock_decimal_places_prices'],
'value' => '', 'value' => '',
'hint' => $__t('Per stock quantity unit', GROCY_CURRENCY), 'hint' => $__t('Per stock quantity unit', GROCY_CURRENCY),
'additionalHtmlContextHelp' => '<i class="fas fa-question-circle text-muted" 'additionalHtmlContextHelp' => '<i class="fas fa-question-circle text-muted"
data-toggle="tooltip" data-toggle="tooltip"
title="' . $__t('This will apply to added products') . '"></i>', title="' . $__t('This will apply to added products') . '"></i>',
'invalidFeedback' => $__t('The price cannot be lower than %s', '0'),
'isRequired' => false, 'isRequired' => false,
'additionalCssClasses' => 'locale-number-input locale-number-currency' 'additionalCssClasses' => 'locale-number-input locale-number-currency'
)) ))

View File

@ -28,30 +28,45 @@
@endpush @endpush
@section('content') @section('content')
<h1 class="d-print-none"> <div class="title-related-links d-print-none">
@yield('title') <h2 class="title">
<a class="btn btn-outline-dark responsive-button print-all-locations-button" @yield('title')
href="#"> <i class="fas fa-question-circle text-muted small"
<i class="fas fa-print"></i> {{ $__t('Print') . ' (' . $__t('all locations') . ')' }} data-toggle="tooltip"
</a> title="{{ $__t('Here you can print a page per location with the current stock, maybe to hang it there and note the consumed things on it') }}"></i>
</h1> </h2>
<h5 class="mb-5 d-print-none"> <div class="float-right">
<small class="text-muted">{{ $__t('Here you can print a page per location with the current stock, maybe to hang it there and note the consumed things on it.') }}</small> <button class="btn btn-outline-dark d-md-none mt-2 order-1 order-md-3"
</h5> type="button"
data-toggle="collapse"
data-target="#related-links">
<i class="fas fa-ellipsis-v"></i>
</button>
</div>
<div class="related-links collapse d-md-flex order-2 width-xs-sm-100"
id="related-links">
<a class="btn btn-outline-dark responsive-button m-1 mt-md-0 mb-md-0 float-right print-all-locations-button"
href="#">
{{ $__t('Print') . ' (' . $__t('all locations') . ')' }}
</a>
</div>
</div>
<hr class="my-2 d-print-none">
@foreach($locations as $location) @foreach($locations as $location)
<div class="page"> <div class="page">
<h1 class="text-center"> <h1 class="pt-4">
<img src="{{ $U('/img/grocy_logo.svg?v=', true) }}{{ $version }}" <img src="{{ $U('/img/grocy_logo.svg?v=', true) }}{{ $version }}"
height="30" height="30"
class="d-none d-print-flex mx-auto"> class="d-none d-print-flex mx-auto">
{{ $location->name }} {{ $location->name }}
<a class="btn btn-outline-dark responsive-button print-single-location-button d-print-none" <a class="btn btn-outline-dark btn-sm responsive-button print-single-location-button d-print-none"
href="#"> href="#">
<i class="fas fa-print"></i> {{ $__t('Print') . ' (' . $__t('this location') . ')' }} {{ $__t('Print') . ' (' . $__t('this location') . ')' }}
</a> </a>
</h1> </h1>
<h6 class="text-center mb-4 d-none d-print-block"> <h6 class="mb-4 d-none d-print-block">
{{ $__t('Time of printing') }}: {{ $__t('Time of printing') }}:
<span class="d-inline print-timestamp"></span> <span class="d-inline print-timestamp"></span>
</h6> </h6>

View File

@ -65,7 +65,6 @@
'min' => '0.' . str_repeat('0', $userSettings['stock_decimal_places_amounts'] - 1) . '1', 'min' => '0.' . str_repeat('0', $userSettings['stock_decimal_places_amounts'] - 1) . '1',
'decimals' => $userSettings['stock_decimal_places_amounts'], 'decimals' => $userSettings['stock_decimal_places_amounts'],
'value' => '1', 'value' => '1',
'invalidFeedback' => $__t('This cannot be lower than %s', '1'),
'additionalCssClasses' => 'locale-number-input locale-number-quantity-amount' 'additionalCssClasses' => 'locale-number-input locale-number-quantity-amount'
)) ))

View File

@ -72,7 +72,7 @@
@if(GROCY_FEATURE_FLAG_STOCK_PRICE_TRACKING) @if(GROCY_FEATURE_FLAG_STOCK_PRICE_TRACKING)
<div class="form-group"> <div class="form-group">
<label for="shopping_location_id_id">{{ $__t('Store') }}</label> <label for="shopping_location_id_id">{{ $__t('Store') }}</label>
<select class="form-control" <select class="custom-control custom-select"
id="shopping_location_id" id="shopping_location_id"
name="shopping_location_id"> name="shopping_location_id">
<option></option> <option></option>

View File

@ -105,7 +105,7 @@
<div class="form-group"> <div class="form-group">
<label for="location_id">{{ $__t('Default location') }}</label> <label for="location_id">{{ $__t('Default location') }}</label>
<select required <select required
class="form-control" class="custom-control custom-select"
id="location_id" id="location_id"
name="location_id"> name="location_id">
<option></option> <option></option>
@ -142,10 +142,9 @@
@include('components.numberpicker', array( @include('components.numberpicker', array(
'id' => 'min_stock_amount', 'id' => 'min_stock_amount',
'label' => 'Minimum stock amount', 'label' => 'Minimum stock amount',
'min' => '0.' . str_repeat('0', $userSettings['stock_decimal_places_amounts'] - 1) . '1', 'min' => '0.',
'decimals' => $userSettings['stock_decimal_places_amounts'], 'decimals' => $userSettings['stock_decimal_places_amounts'],
'value' => $value, 'value' => $value,
'invalidFeedback' => $__t('The amount cannot be lower than %s', '0'),
'additionalGroupCssClasses' => 'mb-1', 'additionalGroupCssClasses' => 'mb-1',
'additionalCssClasses' => 'locale-number-input locale-number-quantity-amount' 'additionalCssClasses' => 'locale-number-input locale-number-quantity-amount'
)) ))
@ -212,7 +211,6 @@
'label' => 'Default due days', 'label' => 'Default due days',
'min' => -1, 'min' => -1,
'value' => $value, 'value' => $value,
'invalidFeedback' => $__t('The amount cannot be lower than %s', '-1'),
'hint' => $__t('For purchases this amount of days will be added to today for the due date suggestion') . ' (' . $__t('-1 means that this product wille be never overdue') . ')' 'hint' => $__t('For purchases this amount of days will be added to today for the due date suggestion') . ' (' . $__t('-1 means that this product wille be never overdue') . ')'
)) ))
@ -223,7 +221,6 @@
'label' => 'Default due days after opened', 'label' => 'Default due days after opened',
'min' => 0, 'min' => 0,
'value' => $value, 'value' => $value,
'invalidFeedback' => $__t('The amount cannot be lower than %s', '-1'),
'hint' => $__t('When this product was marked as opened, the expiry date will be replaced by today + this amount of days (a value of 0 disables this)') 'hint' => $__t('When this product was marked as opened, the expiry date will be replaced by today + this amount of days (a value of 0 disables this)')
)) ))
@else @else
@ -245,7 +242,7 @@
<div class="form-group"> <div class="form-group">
<label for="product_group_id">{{ $__t('Product group') }}</label> <label for="product_group_id">{{ $__t('Product group') }}</label>
<select class="form-control" <select class="custom-control custom-select"
id="product_group_id" id="product_group_id"
name="product_group_id"> name="product_group_id">
<option></option> <option></option>
@ -263,7 +260,7 @@
data-toggle="tooltip" data-toggle="tooltip"
title="{{ $__t('Quantity unit stock cannot be changed after first purchase') }}"></i> title="{{ $__t('Quantity unit stock cannot be changed after first purchase') }}"></i>
<select required <select required
class="form-control input-group-qu" class="custom-control custom-select input-group-qu"
id="qu_id_stock" id="qu_id_stock"
name="qu_id_stock" name="qu_id_stock"
@if($mode=='edit' @if($mode=='edit'
@ -286,7 +283,7 @@
data-toggle="tooltip" data-toggle="tooltip"
title="{{ $__t('This is the default quantity unit used when adding this product to the shopping list') }}"></i> title="{{ $__t('This is the default quantity unit used when adding this product to the shopping list') }}"></i>
<select required <select required
class="form-control input-group-qu" class="custom-control custom-select input-group-qu"
id="qu_id_purchase" id="qu_id_purchase"
name="qu_id_purchase"> name="qu_id_purchase">
<option></option> <option></option>
@ -306,22 +303,11 @@
'min' => '0.' . str_repeat('0', $userSettings['stock_decimal_places_amounts'] - 1) . '1', 'min' => '0.' . str_repeat('0', $userSettings['stock_decimal_places_amounts'] - 1) . '1',
'decimals' => $userSettings['stock_decimal_places_amounts'], 'decimals' => $userSettings['stock_decimal_places_amounts'],
'value' => $value, 'value' => $value,
'invalidFeedback' => $__t('The amount cannot be lower than %s', '1'),
'additionalCssClasses' => 'input-group-qu locale-number-input locale-number-quantity-amount', 'additionalCssClasses' => 'input-group-qu locale-number-input locale-number-quantity-amount',
'additionalHtmlElements' => '<p id="qu-conversion-info" 'additionalHtmlElements' => '<p id="qu-conversion-info"
class="form-text text-info d-none"></p>' class="form-text text-info d-none"></p>'
)) ))
<div class="form-group">
<div class="custom-control custom-checkbox">
<input @if($mode=='edit'
&&
$product->allow_partial_units_in_stock == 1) checked @endif class="form-check-input custom-control-input" type="checkbox" id="allow_partial_units_in_stock" name="allow_partial_units_in_stock" value="1">
<label class="form-check-label custom-control-label"
for="allow_partial_units_in_stock">{{ $__t('Allow partial units in stock') }}</label>
</div>
</div>
<div class="form-group mb-1"> <div class="form-group mb-1">
<div class="custom-control custom-checkbox"> <div class="custom-control custom-checkbox">
<input @if($mode=='edit' <input @if($mode=='edit'
@ -344,7 +330,6 @@
'min' => '0.' . str_repeat('0', $userSettings['stock_decimal_places_amounts'] - 1) . '1', 'min' => '0.' . str_repeat('0', $userSettings['stock_decimal_places_amounts'] - 1) . '1',
'decimals' => $userSettings['stock_decimal_places_amounts'], 'decimals' => $userSettings['stock_decimal_places_amounts'],
'value' => $value, 'value' => $value,
'invalidFeedback' => $__t('This cannot be lower than %s', '0'),
'additionalAttributes' => $additionalAttributes, 'additionalAttributes' => $additionalAttributes,
'contextInfoId' => 'tare_weight_qu_info', 'contextInfoId' => 'tare_weight_qu_info',
'additionalCssClasses' => 'locale-number-input locale-number-quantity-amount' 'additionalCssClasses' => 'locale-number-input locale-number-quantity-amount'
@ -379,7 +364,6 @@
'min' => '0.' . str_repeat('0', $userSettings['stock_decimal_places_amounts']), 'min' => '0.' . str_repeat('0', $userSettings['stock_decimal_places_amounts']),
'decimals' => $userSettings['stock_decimal_places_amounts'], 'decimals' => $userSettings['stock_decimal_places_amounts'],
'value' => $value, 'value' => $value,
'invalidFeedback' => $__t('The amount cannot be lower than %s', '0'),
'hint' => $__t('Per stock quantity unit'), 'hint' => $__t('Per stock quantity unit'),
'isRequired' => false, 'isRequired' => false,
'additionalCssClasses' => 'locale-number-input locale-number-quantity-amount' 'additionalCssClasses' => 'locale-number-input locale-number-quantity-amount'
@ -392,7 +376,6 @@
'label' => 'Default due days after freezing', 'label' => 'Default due days after freezing',
'min' => -1, 'min' => -1,
'value' => $value, 'value' => $value,
'invalidFeedback' => $__t('The amount cannot be lower than %s', '0'),
'hint' => $__t('On moving this product to a freezer location (so when freezing it), the expiry date will be replaced by today + this amount of days') 'hint' => $__t('On moving this product to a freezer location (so when freezing it), the expiry date will be replaced by today + this amount of days')
)) ))
@ -402,7 +385,6 @@
'label' => 'Default due days after thawing', 'label' => 'Default due days after thawing',
'min' => -1, 'min' => -1,
'value' => $value, 'value' => $value,
'invalidFeedback' => $__t('The amount cannot be lower than %s', '0'),
'hint' => $__t('On moving this product from a freezer location (so when thawing it), the due date will be replaced by today + this amount of days') 'hint' => $__t('On moving this product from a freezer location (so when thawing it), the due date will be replaced by today + this amount of days')
)) ))
@else @else
@ -419,8 +401,8 @@
'id' => 'quick_consume_amount', 'id' => 'quick_consume_amount',
'label' => 'Quick consume amount', 'label' => 'Quick consume amount',
'min' => '0.' . str_repeat('0', $userSettings['stock_decimal_places_amounts'] - 1) . '1', 'min' => '0.' . str_repeat('0', $userSettings['stock_decimal_places_amounts'] - 1) . '1',
'decimals' => $userSettings['stock_decimal_places_amounts'],
'value' => $value, 'value' => $value,
'invalidFeedback' => $__t('The amount cannot be lower than %s', '0'),
'hint' => $__t('This amount is used for the "quick consume/open buttons" on the stock overview page (related to quantity unit stock)'), 'hint' => $__t('This amount is used for the "quick consume/open buttons" on the stock overview page (related to quantity unit stock)'),
'contextInfoId' => 'quick_consume_qu_info', 'contextInfoId' => 'quick_consume_qu_info',
'additionalCssClasses' => 'locale-number-input locale-number-quantity-amount' 'additionalCssClasses' => 'locale-number-input locale-number-quantity-amount'
@ -520,12 +502,12 @@
@endif @endif
<td> <td>
@if(!empty($barcode->qu_id)) @if(!empty($barcode->qu_id))
<span class="locale-number locale-number-quantity-amount">{{ FindObjectInArrayByPropertyValue($quantityunits, 'id', $barcode->qu_id)->name }}</span> {{ FindObjectInArrayByPropertyValue($quantityunits, 'id', $barcode->qu_id)->name }}
@endif @endif
</td> </td>
<td> <td>
@if(!empty($barcode->amount)) @if(!empty($barcode->amount))
{{ $barcode->amount }} <span class="locale-number locale-number-quantity-amount">{{ $barcode->amount }}</span>
@endif @endif
</td> </td>
</tr> </tr>

View File

@ -62,7 +62,7 @@
<div class="input-group-prepend"> <div class="input-group-prepend">
<span class="input-group-text"><i class="fas fa-filter"></i>&nbsp;{{ $__t('Product group') }}</span> <span class="input-group-text"><i class="fas fa-filter"></i>&nbsp;{{ $__t('Product group') }}</span>
</div> </div>
<select class="form-control" <select class="custom-control custom-select"
id="product-group-filter"> id="product-group-filter">
<option value="all">{{ $__t('All') }}</option> <option value="all">{{ $__t('All') }}</option>
@foreach($productGroups as $productGroup) @foreach($productGroups as $productGroup)

View File

@ -15,7 +15,7 @@
</script> </script>
<div class="row"> <div class="row">
<div class="col-xs-12 col-md-6 col-xl-4"> <div class="col-xs-12 col-md-6 col-xl-4 pb-3">
<div class="title-related-links"> <div class="title-related-links">
<h2 class="title">@yield('title')</h2> <h2 class="title">@yield('title')</h2>
<button class="btn btn-outline-dark d-md-none mt-2 float-right order-1 order-md-3 hide-when-embedded" <button class="btn btn-outline-dark d-md-none mt-2 float-right order-1 order-md-3 hide-when-embedded"
@ -105,7 +105,6 @@
'decimals' => $userSettings['stock_decimal_places_prices'], 'decimals' => $userSettings['stock_decimal_places_prices'],
'value' => '', 'value' => '',
'contextInfoId' => 'price-hint', 'contextInfoId' => 'price-hint',
'invalidFeedback' => $__t('The price cannot be lower than %s', '0'),
'isRequired' => false, 'isRequired' => false,
'additionalGroupCssClasses' => 'mb-1', 'additionalGroupCssClasses' => 'mb-1',
'additionalCssClasses' => 'locale-number-input locale-number-currency' 'additionalCssClasses' => 'locale-number-input locale-number-currency'

View File

@ -51,7 +51,7 @@
<div class="form-group"> <div class="form-group">
<label for="from_qu_id">{{ $__t('Quantity unit from') }}</label> <label for="from_qu_id">{{ $__t('Quantity unit from') }}</label>
<select required <select required
class="form-control input-group-qu" class="custom-control custom-select input-group-qu"
id="from_qu_id" id="from_qu_id"
name="from_qu_id"> name="from_qu_id">
<option></option> <option></option>
@ -68,7 +68,7 @@
<div class="form-group"> <div class="form-group">
<label for="to_qu_id">{{ $__t('Quantity unit to') }}</label> <label for="to_qu_id">{{ $__t('Quantity unit to') }}</label>
<select required <select required
class="form-control input-group-qu" class="custom-control custom-select input-group-qu"
id="to_qu_id" id="to_qu_id"
name="to_qu_id"> name="to_qu_id">
<option></option> <option></option>
@ -88,7 +88,6 @@
'min' => '0.' . str_repeat('0', $userSettings['stock_decimal_places_amounts'] - 1) . '1', 'min' => '0.' . str_repeat('0', $userSettings['stock_decimal_places_amounts'] - 1) . '1',
'decimals' => $userSettings['stock_decimal_places_amounts'], 'decimals' => $userSettings['stock_decimal_places_amounts'],
'value' => $value, 'value' => $value,
'invalidFeedback' => $__t('This cannot be lower than %1$s and must be a valid number with max. %2$s decimal places', '0', $userSettings['stock_decimal_places_amounts']),
'additionalHtmlElements' => '<p id="qu-conversion-info" 'additionalHtmlElements' => '<p id="qu-conversion-info"
class="form-text text-info d-none"></p>', class="form-text text-info d-none"></p>',
'additionalCssClasses' => 'input-group-qu locale-number-input locale-number-quantity-amount' 'additionalCssClasses' => 'input-group-qu locale-number-input locale-number-quantity-amount'

View File

@ -25,7 +25,7 @@
<div class="form-group"> <div class="form-group">
<label for="qu_id">{{ $__t('Quantity unit') }}</label> <label for="qu_id">{{ $__t('Quantity unit') }}</label>
<select class="form-control" <select class="custom-control custom-select"
id="qu_id" id="qu_id"
name="qu_id"> name="qu_id">
<option></option> <option></option>

View File

@ -68,7 +68,6 @@
'min' => '0.' . str_repeat('0', $userSettings['stock_decimal_places_amounts'] - 1) . '1', 'min' => '0.' . str_repeat('0', $userSettings['stock_decimal_places_amounts'] - 1) . '1',
'decimals' => $userSettings['stock_decimal_places_amounts'], 'decimals' => $userSettings['stock_decimal_places_amounts'],
'value' => $value, 'value' => $value,
'invalidFeedback' => $__t('This cannot be lower than %s', '1'),
'hint' => $__t('The ingredients listed here result in this amount of servings'), 'hint' => $__t('The ingredients listed here result in this amount of servings'),
'additionalCssClasses' => 'locale-number-input locale-number-quantity-amount' 'additionalCssClasses' => 'locale-number-input locale-number-quantity-amount'
)) ))
@ -365,7 +364,6 @@
'min' => '0.' . str_repeat('0', $userSettings['stock_decimal_places_amounts'] - 1) . '1', 'min' => '0.' . str_repeat('0', $userSettings['stock_decimal_places_amounts'] - 1) . '1',
'decimals' => $userSettings['stock_decimal_places_amounts'], 'decimals' => $userSettings['stock_decimal_places_amounts'],
'value' => '1', 'value' => '1',
'invalidFeedback' => $__t('This cannot be lower than %s', '1'),
'additionalCssClasses' => 'locale-number-input locale-number-quantity-amount' 'additionalCssClasses' => 'locale-number-input locale-number-quantity-amount'
)) ))

View File

@ -113,7 +113,6 @@
'decimals' => $userSettings['stock_decimal_places_amounts'], 'decimals' => $userSettings['stock_decimal_places_amounts'],
'value' => '', 'value' => '',
'hint' => $__t('The resulting price of this ingredient will be multiplied by this factor'), 'hint' => $__t('The resulting price of this ingredient will be multiplied by this factor'),
'invalidFeedback' => $__t('This cannot be lower than %s', '0'),
'isRequired' => true, 'isRequired' => true,
'value' => $value, 'value' => $value,
'additionalCssClasses' => 'locale-number-input locale-number-quantity-amount' 'additionalCssClasses' => 'locale-number-input locale-number-quantity-amount'

View File

@ -56,7 +56,7 @@
<div class="input-group-prepend"> <div class="input-group-prepend">
<span class="input-group-text"><i class="fas fa-filter"></i>&nbsp;{{ $__t('Status') }}</span> <span class="input-group-text"><i class="fas fa-filter"></i>&nbsp;{{ $__t('Status') }}</span>
</div> </div>
<select class="form-control" <select class="custom-control custom-select"
id="status-filter"> id="status-filter">
<option value="all">{{ $__t('All') }}</option> <option value="all">{{ $__t('All') }}</option>
<option value="Xenoughinstock">{{ $__t('Enough in stock') }}</option> <option value="Xenoughinstock">{{ $__t('Enough in stock') }}</option>
@ -333,7 +333,6 @@
'min' => '0.' . str_repeat('0', $userSettings['stock_decimal_places_amounts'] - 1) . '1', 'min' => '0.' . str_repeat('0', $userSettings['stock_decimal_places_amounts'] - 1) . '1',
'decimals' => $userSettings['stock_decimal_places_amounts'], 'decimals' => $userSettings['stock_decimal_places_amounts'],
'value' => $recipe->desired_servings, 'value' => $recipe->desired_servings,
'invalidFeedback' => $__t('This cannot be lower than %s', '1'),
'additionalAttributes' => 'data-recipe-id="' . $recipe->id . '"', 'additionalAttributes' => 'data-recipe-id="' . $recipe->id . '"',
'hint' => $__t('Base: %s', $recipe->base_servings), 'hint' => $__t('Base: %s', $recipe->base_servings),
'additionalCssClasses' => 'locale-number-input locale-number-quantity-amount' 'additionalCssClasses' => 'locale-number-input locale-number-quantity-amount'

View File

@ -49,7 +49,7 @@
<div class="related-links collapse d-md-flex order-2 width-xs-sm-100" <div class="related-links collapse d-md-flex order-2 width-xs-sm-100"
id="related-links"> id="related-links">
<div class="my-auto float-right"> <div class="my-auto float-right">
<select class="form-control form-control-sm" <select class="custom-control custom-select"
id="selected-shopping-list"> id="selected-shopping-list">
@foreach($shoppingLists as $shoppingList) @foreach($shoppingLists as $shoppingList)
<option @if($shoppingList->id == $selectedShoppingListId) selected="selected" @endif value="{{ $shoppingList->id }}">{{ $shoppingList->name }}</option> <option @if($shoppingList->id == $selectedShoppingListId) selected="selected" @endif value="{{ $shoppingList->id }}">{{ $shoppingList->name }}</option>
@ -143,7 +143,7 @@
<div class="input-group-prepend"> <div class="input-group-prepend">
<span class="input-group-text"><i class="fas fa-filter"></i>&nbsp;{{ $__t('Status') }}</span> <span class="input-group-text"><i class="fas fa-filter"></i>&nbsp;{{ $__t('Status') }}</span>
</div> </div>
<select class="form-control" <select class="custom-control custom-select"
id="status-filter"> id="status-filter">
<option value="all">{{ $__t('All') }}</option> <option value="all">{{ $__t('All') }}</option>
<option class="@if(!GROCY_FEATURE_FLAG_STOCK) d-none @endif" <option class="@if(!GROCY_FEATURE_FLAG_STOCK) d-none @endif"

View File

@ -40,7 +40,7 @@
@if(GROCY_FEATURE_FLAG_SHOPPINGLIST_MULTIPLE_LISTS) @if(GROCY_FEATURE_FLAG_SHOPPINGLIST_MULTIPLE_LISTS)
<div class="form-group"> <div class="form-group">
<label for="shopping_list_id">{{ $__t('Shopping list') }}</label> <label for="shopping_list_id">{{ $__t('Shopping list') }}</label>
<select class="form-control" <select class="custom-control custom-select"
id="shopping_list_id" id="shopping_list_id"
name="shopping_list_id"> name="shopping_list_id">
@foreach($shoppingLists as $shoppingList) @foreach($shoppingLists as $shoppingList)
@ -73,7 +73,6 @@
'value' => $value, 'value' => $value,
'initialQuId' => $initialQuId, 'initialQuId' => $initialQuId,
'min' => '0.' . str_repeat('0', $userSettings['stock_decimal_places_amounts'] - 1) . '1', 'min' => '0.' . str_repeat('0', $userSettings['stock_decimal_places_amounts'] - 1) . '1',
'invalidFeedback' => $__t('The amount cannot be lower than %s', '0.' . str_repeat('0', $userSettings['stock_decimal_places_amounts'] - 1) . '1'),
'isRequired' => false 'isRequired' => false
)) ))

View File

@ -57,9 +57,9 @@
'id' => 'amount', 'id' => 'amount',
'value' => $stockEntry->amount, 'value' => $stockEntry->amount,
'min' => '0.' . str_repeat('0', $userSettings['stock_decimal_places_amounts'] - 1) . '1', 'min' => '0.' . str_repeat('0', $userSettings['stock_decimal_places_amounts'] - 1) . '1',
'decimals' => $userSettings['stock_decimal_places_amounts'],
'label' => 'Amount', 'label' => 'Amount',
'contextInfoId' => 'amount_qu_unit', 'contextInfoId' => 'amount_qu_unit',
'invalidFeedback' => $__t('The amount cannot be lower than %s', '0'),
'additionalCssClasses' => 'locale-number-input locale-number-quantity-amount' 'additionalCssClasses' => 'locale-number-input locale-number-quantity-amount'
)) ))
@ -81,7 +81,6 @@
'min' => '0.' . str_repeat('0', $userSettings['stock_decimal_places_prices'] - 1) . '1', 'min' => '0.' . str_repeat('0', $userSettings['stock_decimal_places_prices'] - 1) . '1',
'decimals' => $userSettings['stock_decimal_places_prices'], 'decimals' => $userSettings['stock_decimal_places_prices'],
'hint' => $__t('Per stock quantity unit'), 'hint' => $__t('Per stock quantity unit'),
'invalidFeedback' => $__t('The price cannot be lower than %s', '0'),
'isRequired' => false, 'isRequired' => false,
'additionalCssClasses' => 'locale-number-input locale-number-currency' 'additionalCssClasses' => 'locale-number-input locale-number-currency'
)) ))

View File

@ -50,7 +50,7 @@
<div class="input-group-prepend"> <div class="input-group-prepend">
<span class="input-group-text"><i class="fas fa-filter"></i>&nbsp;{{ $__t('Product') }}</span> <span class="input-group-text"><i class="fas fa-filter"></i>&nbsp;{{ $__t('Product') }}</span>
</div> </div>
<select class="form-control" <select class="custom-control custom-select"
id="product-filter"> id="product-filter">
<option value="all">{{ $__t('All') }}</option> <option value="all">{{ $__t('All') }}</option>
@foreach($products as $product) @foreach($products as $product)

View File

@ -99,7 +99,7 @@
<div class="input-group-prepend"> <div class="input-group-prepend">
<span class="input-group-text"><i class="fas fa-filter"></i>&nbsp;{{ $__t('Location') }}</span> <span class="input-group-text"><i class="fas fa-filter"></i>&nbsp;{{ $__t('Location') }}</span>
</div> </div>
<select class="form-control" <select class="custom-control custom-select"
id="location-filter"> id="location-filter">
<option value="all">{{ $__t('All') }}</option> <option value="all">{{ $__t('All') }}</option>
@foreach($locations as $location) @foreach($locations as $location)
@ -114,7 +114,7 @@
<div class="input-group-prepend"> <div class="input-group-prepend">
<span class="input-group-text"><i class="fas fa-filter"></i>&nbsp;{{ $__t('Product group') }}</span> <span class="input-group-text"><i class="fas fa-filter"></i>&nbsp;{{ $__t('Product group') }}</span>
</div> </div>
<select class="form-control" <select class="custom-control custom-select"
id="product-group-filter"> id="product-group-filter">
<option value="all">{{ $__t('All') }}</option> <option value="all">{{ $__t('All') }}</option>
@foreach($productGroups as $productGroup) @foreach($productGroups as $productGroup)
@ -128,7 +128,7 @@
<div class="input-group-prepend"> <div class="input-group-prepend">
<span class="input-group-text"><i class="fas fa-filter"></i>&nbsp;{{ $__t('Status') }}</span> <span class="input-group-text"><i class="fas fa-filter"></i>&nbsp;{{ $__t('Status') }}</span>
</div> </div>
<select class="form-control" <select class="custom-control custom-select"
id="status-filter"> id="status-filter">
<option class="bg-white" <option class="bg-white"
value="all">{{ $__t('All') }}</option> value="all">{{ $__t('All') }}</option>
@ -190,7 +190,7 @@
<i class="fas fa-utensils"></i> <span class="locale-number locale-number-quantity-amount">{{ $currentStockEntry->quick_consume_amount }}</span> <i class="fas fa-utensils"></i> <span class="locale-number locale-number-quantity-amount">{{ $currentStockEntry->quick_consume_amount }}</span>
</a> </a>
<a id="product-{{ $currentStockEntry->product_id }}-consume-all-button" <a id="product-{{ $currentStockEntry->product_id }}-consume-all-button"
class="permission-STOCK_CONSUME d-none d-sm-inline-block btn btn-danger btn-sm product-consume-button @if($currentStockEntry->amount == 0) disabled @endif" class="permission-STOCK_CONSUME btn btn-danger btn-sm product-consume-button @if($currentStockEntry->amount == 0) disabled @endif"
href="#" href="#"
data-toggle="tooltip" data-toggle="tooltip"
data-placement="right" data-placement="right"
@ -222,17 +222,6 @@
<i class="fas fa-ellipsis-v"></i> <i class="fas fa-ellipsis-v"></i>
</button> </button>
<div class="table-inline-menu dropdown-menu dropdown-menu-right"> <div class="table-inline-menu dropdown-menu dropdown-menu-right">
<a id="product-{{ $currentStockEntry->product_id }}-consume-all-button"
class="d-inline-block d-sm-none dropdown-item show-as-dialog-link text-danger product-consume-button @if($currentStockEntry->amount == 0) disabled @endif"
href="#"
data-toggle="tooltip"
data-placement="right"
data-product-id="{{ $currentStockEntry->product_id }}"
data-product-name="{{ $currentStockEntry->product_name }}"
data-product-qu-name="{{ $currentStockEntry->qu_unit_name }}"
data-consume-amount="{{ $currentStockEntry->amount }}">
<span class="dropdown-item-icon"><i class="fas fa-utensils"></i></span> <span class="dropdown-item-text">{{ $__t('Consume all %s which are currently in stock', $currentStockEntry->product_name) }}</span>
</a>
<a class="dropdown-item show-as-dialog-link permission-SHOPPINGLIST_ITEMS_ADD" <a class="dropdown-item show-as-dialog-link permission-SHOPPINGLIST_ITEMS_ADD"
type="button" type="button"
href="{{ $U('/shoppinglistitem/new?embedded&updateexistingproduct&product=' . $currentStockEntry->product_id ) }}"> href="{{ $U('/shoppinglistitem/new?embedded&updateexistingproduct&product=' . $currentStockEntry->product_id ) }}">

View File

@ -21,7 +21,7 @@
@if(GROCY_FEATURE_FLAG_STOCK_LOCATION_TRACKING) @if(GROCY_FEATURE_FLAG_STOCK_LOCATION_TRACKING)
<div class="form-group"> <div class="form-group">
<label for="product_presets_location_id">{{ $__t('Location') }}</label> <label for="product_presets_location_id">{{ $__t('Location') }}</label>
<select class="form-control user-setting-control" <select class="custom-control custom-select user-setting-control"
id="product_presets_location_id" id="product_presets_location_id"
data-setting-key="product_presets_location_id"> data-setting-key="product_presets_location_id">
<option value="-1"></option> <option value="-1"></option>
@ -34,7 +34,7 @@
<div class="form-group"> <div class="form-group">
<label for="product_presets_product_group_id">{{ $__t('Product group') }}</label> <label for="product_presets_product_group_id">{{ $__t('Product group') }}</label>
<select class="form-control user-setting-control" <select class="custom-control custom-select user-setting-control"
id="product_presets_product_group_id" id="product_presets_product_group_id"
data-setting-key="product_presets_product_group_id"> data-setting-key="product_presets_product_group_id">
<option value="-1"></option> <option value="-1"></option>
@ -46,7 +46,7 @@
<div class="form-group"> <div class="form-group">
<label for="product_presets_qu_id">{{ $__t('Quantity unit') }}</label> <label for="product_presets_qu_id">{{ $__t('Quantity unit') }}</label>
<select class="form-control user-setting-control" <select class="custom-control custom-select user-setting-control"
id="product_presets_qu_id" id="product_presets_qu_id"
data-setting-key="product_presets_qu_id"> data-setting-key="product_presets_qu_id">
<option value="-1"></option> <option value="-1"></option>
@ -63,7 +63,6 @@
'additionalAttributes' => 'data-setting-key="stock_due_soon_days"', 'additionalAttributes' => 'data-setting-key="stock_due_soon_days"',
'label' => 'Due soon days', 'label' => 'Due soon days',
'min' => 1, 'min' => 1,
'invalidFeedback' => $__t('This cannot be lower than %s', '1'),
'additionalCssClasses' => 'user-setting-control' 'additionalCssClasses' => 'user-setting-control'
)) ))
@ -87,7 +86,6 @@
'label' => 'Default amount for purchase', 'label' => 'Default amount for purchase',
'min' => 0, 'min' => 0,
'decimals' => $userSettings['stock_decimal_places_amounts'], 'decimals' => $userSettings['stock_decimal_places_amounts'],
'invalidFeedback' => $__t('This cannot be lower than %s', '1'),
'additionalCssClasses' => 'user-setting-control locale-number-input locale-number-quantity-amount', 'additionalCssClasses' => 'user-setting-control locale-number-input locale-number-quantity-amount',
)) ))
@ -124,7 +122,6 @@
'label' => 'Default amount for consume', 'label' => 'Default amount for consume',
'min' => 0, 'min' => 0,
'decimals' => $userSettings['stock_decimal_places_amounts'], 'decimals' => $userSettings['stock_decimal_places_amounts'],
'invalidFeedback' => $__t('This cannot be lower than %s', '1'),
'additionalCssClasses' => 'user-setting-control locale-number-input locale-number-quantity-amount' 'additionalCssClasses' => 'user-setting-control locale-number-input locale-number-quantity-amount'
)) ))
@ -135,8 +132,6 @@
'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,
'decimals' => 0,
'invalidFeedback' => $__t('This cannot be lower than %s', '0'),
'additionalCssClasses' => 'user-setting-control' 'additionalCssClasses' => 'user-setting-control'
)) ))
@ -145,8 +140,6 @@
'additionalAttributes' => 'data-setting-key="stock_decimal_places_prices"', 'additionalAttributes' => 'data-setting-key="stock_decimal_places_prices"',
'label' => 'Decimal places allowed for prices', 'label' => 'Decimal places allowed for prices',
'min' => 0, 'min' => 0,
'decimals' => 0,
'invalidFeedback' => $__t('This cannot be lower than %s', '0'),
'additionalCssClasses' => 'user-setting-control' 'additionalCssClasses' => 'user-setting-control'
)) ))

View File

@ -74,7 +74,7 @@
<div class="form-group"> <div class="form-group">
<label for="category_id">{{ $__t('Category') }}</label> <label for="category_id">{{ $__t('Category') }}</label>
<select class="form-control" <select class="custom-control custom-select"
id="category_id" id="category_id"
name="category_id"> name="category_id">
<option></option> <option></option>

View File

@ -78,7 +78,7 @@
<div class="input-group-prepend"> <div class="input-group-prepend">
<span class="input-group-text"><i class="fas fa-filter"></i>&nbsp;{{ $__t('Status') }}</span> <span class="input-group-text"><i class="fas fa-filter"></i>&nbsp;{{ $__t('Status') }}</span>
</div> </div>
<select class="form-control" <select class="custom-control custom-select"
id="status-filter"> id="status-filter">
<option value="all">{{ $__t('All') }}</option> <option value="all">{{ $__t('All') }}</option>
<option value="duesoon">{{ $__t('Due soon') }}</option> <option value="duesoon">{{ $__t('Due soon') }}</option>

View File

@ -21,7 +21,6 @@
'additionalAttributes' => 'data-setting-key="tasks_due_soon_days"', 'additionalAttributes' => 'data-setting-key="tasks_due_soon_days"',
'label' => 'Due soon days', 'label' => 'Due soon days',
'min' => 1, 'min' => 1,
'invalidFeedback' => $__t('This cannot be lower than %s', '1'),
'additionalCssClasses' => 'user-setting-control' 'additionalCssClasses' => 'user-setting-control'
)) ))

View File

@ -29,7 +29,7 @@
<div class="form-group"> <div class="form-group">
<label for="location_id_from">{{ $__t('From location') }}</label> <label for="location_id_from">{{ $__t('From location') }}</label>
<select required <select required
class="form-control location-combobox" class="custom-control custom-select location-combobox"
id="location_id_from" id="location_id_from"
name="location_id_from"> name="location_id_from">
<option></option> <option></option>
@ -50,7 +50,7 @@
<div class="form-group"> <div class="form-group">
<label for="location_id_to">{{ $__t('To location') }}</label> <label for="location_id_to">{{ $__t('To location') }}</label>
<select required <select required
class="form-control location-combobox" class="custom-control custom-select location-combobox"
id="location_id_to" id="location_id_to"
name="location_id_to"> name="location_id_to">
<option></option> <option></option>
@ -77,7 +77,7 @@
</label> </label>
</div> </div>
<select disabled <select disabled
class="form-control mt-2" class="custom-control custom-select mt-2"
id="specific_stock_entry" id="specific_stock_entry"
name="specific_stock_entry"> name="specific_stock_entry">
<option></option> <option></option>

View File

@ -35,7 +35,7 @@
<div class="form-group"> <div class="form-group">
<label for="entity">{{ $__t('Entity') }}</label> <label for="entity">{{ $__t('Entity') }}</label>
<select required <select required
class="form-control" class="custom-control custom-select"
id="entity" id="entity"
name="entity"> name="entity">
<option></option> <option></option>
@ -74,7 +74,7 @@
<div class="form-group"> <div class="form-group">
<label for="type">{{ $__t('Type') }}</label> <label for="type">{{ $__t('Type') }}</label>
<select required <select required
class="form-control" class="custom-control custom-select"
id="type" id="type"
name="type"> name="type">
<option></option> <option></option>

View File

@ -55,7 +55,7 @@
<div class="input-group-prepend"> <div class="input-group-prepend">
<span class="input-group-text"><i class="fas fa-filter"></i>&nbsp;{{ $__t('Entity') }}</span> <span class="input-group-text"><i class="fas fa-filter"></i>&nbsp;{{ $__t('Entity') }}</span>
</div> </div>
<select class="form-control" <select class="custom-control custom-select"
id="entity-filter"> id="entity-filter">
<option value="all">{{ $__t('All') }}</option> <option value="all">{{ $__t('All') }}</option>
@foreach($entities as $entity) @foreach($entities as $entity)

View File

@ -18,7 +18,7 @@
<div class="form-group"> <div class="form-group">
<label for="locale">{{ $__t('Language') }}</label> <label for="locale">{{ $__t('Language') }}</label>
<select class="form-control user-setting-control" <select class="custom-control custom-select user-setting-control"
id="locale" id="locale"
data-setting-key="locale"> data-setting-key="locale">
<option value="">{{ $__t('Default') }}</option> <option value="">{{ $__t('Default') }}</option>