mirror of
https://github.com/grocy/grocy.git
synced 2025-04-29 09:39:57 +00:00
Remove "Allow partial units in stock" product option / unify number input validation messages
This commit is contained in:
parent
95fc6a6faa
commit
e85b21384f
@ -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 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)
|
||||
- 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))
|
||||
- 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)
|
||||
@ -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
|
||||
- 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
|
||||
- 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)
|
||||
- Via an environment variable `GROCY_DATAPATH` (higher priority)
|
||||
- Via an FastCGI parameter `GROCY_DATAPATH` (lower priority)
|
||||
|
@ -3957,9 +3957,6 @@
|
||||
"picture_file_name": {
|
||||
"type": "string"
|
||||
},
|
||||
"allow_partial_units_in_stock": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"row_created_timestamp": {
|
||||
"type": "string",
|
||||
"format": "date-time"
|
||||
@ -3987,7 +3984,6 @@
|
||||
"product_group_id": "1",
|
||||
"picture_file_name": "cookies.jpg",
|
||||
"default_best_before_days_after_open": "0",
|
||||
"allow_partial_units_in_stock": "0",
|
||||
"enable_tare_weight_handling": "0",
|
||||
"tare_weight": "0.0",
|
||||
"not_check_stock_fulfillment_for_recipes": "0",
|
||||
@ -4284,7 +4280,6 @@
|
||||
"product_group_id": "1",
|
||||
"picture_file_name": "cookies.jpg",
|
||||
"default_best_before_days_after_open": "0",
|
||||
"allow_partial_units_in_stock": "0",
|
||||
"enable_tare_weight_handling": "0",
|
||||
"tare_weight": "0.0",
|
||||
"not_check_stock_fulfillment_for_recipes": "0",
|
||||
|
@ -405,12 +405,6 @@ msgstr ""
|
||||
msgid "A location is required"
|
||||
msgstr ""
|
||||
|
||||
msgid "The amount cannot be lower than %s"
|
||||
msgstr ""
|
||||
|
||||
msgid "This cannot be negative"
|
||||
msgstr ""
|
||||
|
||||
msgid "A quantity unit is required"
|
||||
msgstr ""
|
||||
|
||||
@ -563,9 +557,6 @@ msgstr ""
|
||||
msgid "Price"
|
||||
msgstr ""
|
||||
|
||||
msgid "The price cannot be lower than %s"
|
||||
msgstr ""
|
||||
|
||||
msgid "Unit"
|
||||
msgstr ""
|
||||
|
||||
@ -597,9 +588,6 @@ msgstr[1] ""
|
||||
msgid "in singular form"
|
||||
msgstr ""
|
||||
|
||||
msgid "This cannot be lower than %s"
|
||||
msgstr ""
|
||||
|
||||
msgid "Quantity unit"
|
||||
msgstr ""
|
||||
|
||||
@ -844,9 +832,6 @@ msgstr ""
|
||||
msgid "Charge cycle successfully undone"
|
||||
msgstr ""
|
||||
|
||||
msgid "This cannot be negative and must be an integral number"
|
||||
msgstr ""
|
||||
|
||||
msgid "Disable stock fulfillment checking for this ingredient"
|
||||
msgstr ""
|
||||
|
||||
@ -1125,9 +1110,6 @@ msgid_plural "Not enough in stock, %s ingredients missing"
|
||||
msgstr[0] ""
|
||||
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"
|
||||
msgstr ""
|
||||
|
||||
@ -1223,7 +1205,7 @@ msgstr ""
|
||||
msgid "all locations"
|
||||
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 ""
|
||||
|
||||
msgid "this location"
|
||||
@ -1265,9 +1247,6 @@ msgstr ""
|
||||
msgid "Quantity unit to"
|
||||
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"
|
||||
msgstr ""
|
||||
|
||||
@ -1981,3 +1960,18 @@ msgstr ""
|
||||
|
||||
msgid "Add overdue/expired products"
|
||||
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 ""
|
||||
|
@ -61,7 +61,6 @@ CREATE TABLE products (
|
||||
default_best_before_days_after_freezing INTEGER NOT NULL DEFAULT 0,
|
||||
default_best_before_days_after_thawing INTEGER NOT NULL DEFAULT 0,
|
||||
picture_file_name TEXT,
|
||||
allow_partial_units_in_stock TINYINT NOT NULL DEFAULT 0,
|
||||
enable_tare_weight_handling TINYINT NOT NULL DEFAULT 0,
|
||||
tare_weight REAL NOT NULL DEFAULT 0,
|
||||
not_check_stock_fulfillment_for_recipes TINYINT DEFAULT 0,
|
||||
@ -74,8 +73,8 @@ CREATE TABLE 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)
|
||||
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
|
||||
(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, 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;
|
||||
|
||||
DROP TABLE products_old;
|
||||
|
@ -290,10 +290,18 @@ a:not([href]) {
|
||||
|
||||
/* Hide the form validation feedback icons introduced in Bootstrap 4.2.0 - a colored border is enough */
|
||||
.form-control.is-invalid,
|
||||
.custom-control.is-invalid,
|
||||
.was-validated .form-control:invalid,
|
||||
.was-validated .custom-control:invalid,
|
||||
.form-control.is-valid,
|
||||
.was-validated .form-control:valid {
|
||||
background-size: 0 0;
|
||||
.custom-control.is-valid,
|
||||
.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 */
|
||||
|
@ -548,32 +548,38 @@ function RefreshLocaleNumberDisplay(rootSelector = "#page-content")
|
||||
{
|
||||
$(rootSelector + " .locale-number.locale-number-currency").each(function()
|
||||
{
|
||||
if (isNaN(parseFloat($(this).text())))
|
||||
var text = $(this).text();
|
||||
if (isNaN(text) || text.isEmpty())
|
||||
{
|
||||
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()
|
||||
{
|
||||
if (isNaN(parseFloat($(this).text())))
|
||||
var text = $(this).text();
|
||||
if (isNaN(text) || text.isEmpty())
|
||||
{
|
||||
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()
|
||||
{
|
||||
if (isNaN(parseFloat($(this).text())))
|
||||
var text = $(this).text();
|
||||
if (isNaN(text) || text.isEmpty())
|
||||
{
|
||||
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();
|
||||
@ -583,18 +589,18 @@ function RefreshLocaleNumberInput(rootSelector = "#page-content")
|
||||
$(rootSelector + " .locale-number-input.locale-number-currency").each(function()
|
||||
{
|
||||
var value = $(this).val();
|
||||
if (isNaN(value))
|
||||
if (isNaN(value) || value.toString().isEmpty())
|
||||
{
|
||||
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()
|
||||
{
|
||||
var value = $(this).val();
|
||||
if (isNaN(value))
|
||||
if (isNaN(value) || value.toString().isEmpty())
|
||||
{
|
||||
return;
|
||||
}
|
||||
@ -605,7 +611,7 @@ function RefreshLocaleNumberInput(rootSelector = "#page-content")
|
||||
$(rootSelector + " .locale-number-input.locale-number-generic").each(function()
|
||||
{
|
||||
var value = $(this).val();
|
||||
if (isNaN(value))
|
||||
if (isNaN(value) || value.toString().isEmpty())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
@ -133,8 +133,7 @@ $('.input-group-chore-period-type').on('change', function(e)
|
||||
{
|
||||
$("label[for='period_days']").text(__t("Period days"));
|
||||
$("#period_days").attr("min", "0");
|
||||
$("#period_days").attr("max", "9999");
|
||||
$("#period_days").parent().find(".invalid-feedback").text(__t('This cannot be negative'));
|
||||
$("#period_days").attr("max", "999999");
|
||||
$('#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')
|
||||
@ -154,7 +153,6 @@ $('.input-group-chore-period-type').on('change', function(e)
|
||||
$("label[for='period_days']").text(__t("Day of month"));
|
||||
$("#period_days").attr("min", "1");
|
||||
$("#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()));
|
||||
}
|
||||
else if (periodType === 'yearly')
|
||||
|
@ -252,7 +252,7 @@ $(document).on("click", "#barcodescanner-start-button", async function(e)
|
||||
});
|
||||
|
||||
// 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 cameras = await Quagga.CameraAccess.enumerateVideoDevices();
|
||||
|
@ -25,3 +25,48 @@ $(".numberpicker").on("keyup", function()
|
||||
$(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
|
||||
|
@ -92,10 +92,8 @@
|
||||
Grocy.Components.ProductPicker.FinishFlow();
|
||||
|
||||
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("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));
|
||||
RefreshLocaleNumberInput();
|
||||
$(".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)
|
||||
{
|
||||
$("#display_amount").attr("min", 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");
|
||||
}
|
||||
else
|
||||
{
|
||||
$("#display_amount").attr("min", "0." + "0".repeat(parseInt(Grocy.UserSettings.stock_decimal_places_amounts) - 1) + "1");
|
||||
$("#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'));
|
||||
}
|
||||
else
|
||||
{
|
||||
$("#display_amount").parent().find(".invalid-feedback").text(__t('The amount must be between %1$s and %2$s', "1", sumValue));
|
||||
}
|
||||
},
|
||||
function(xhr)
|
||||
{
|
||||
@ -468,7 +449,6 @@ $("#specific_stock_entry").on("change", function(e)
|
||||
}
|
||||
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'));
|
||||
}
|
||||
});
|
||||
@ -578,30 +558,18 @@ function RefreshForm()
|
||||
{
|
||||
$("#consume-exact-amount-group").addClass("d-none");
|
||||
}
|
||||
|
||||
if (productDetails.product.enable_tare_weight_handling == 1 && !$('#consume-exact-amount').is(':checked'))
|
||||
{
|
||||
$("#display_amount").attr("min", 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");
|
||||
}
|
||||
else
|
||||
{
|
||||
$("#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("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("min", "0." + "0".repeat(parseInt(Grocy.UserSettings.stock_decimal_places_amounts) - 1) + "1");
|
||||
$('#display_amount').attr('max', sumValue);
|
||||
|
||||
if (sumValue == 0)
|
||||
|
@ -83,8 +83,6 @@
|
||||
$('#inventory-change-info').addClass('d-none');
|
||||
$("#tare-weight-handling-info").addClass("d-none");
|
||||
$("#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('');
|
||||
$(".input-group-productamountpicker").trigger("change");
|
||||
$('#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-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)
|
||||
{
|
||||
$("#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");
|
||||
}
|
||||
else
|
||||
{
|
||||
$("#display_amount").attr("min", "0." + "0".repeat(parseInt(Grocy.UserSettings.stock_decimal_places_amounts) - 1) + "1");
|
||||
$("#tare-weight-handling-info").addClass("d-none");
|
||||
}
|
||||
|
||||
@ -243,7 +228,6 @@ $('#inventory-form input').keydown(function(event)
|
||||
$('#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").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');
|
||||
});
|
||||
|
||||
|
@ -81,3 +81,4 @@ if (Grocy.EditMode == "edit")
|
||||
|
||||
Grocy.FrontendHelpers.ValidateForm('barcode-form');
|
||||
$('#barcode').focus();
|
||||
RefreshLocaleNumberInput();
|
||||
|
@ -247,34 +247,6 @@ $("#enable_tare_weight_handling").on("click", function()
|
||||
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-label").removeClass("d-none");
|
||||
@ -346,10 +318,6 @@ $('#name').focus();
|
||||
$('.input-group-qu').trigger('change');
|
||||
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)
|
||||
{
|
||||
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_purchase").val(sourceProduct.qu_id_purchase);
|
||||
$("#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))
|
||||
{
|
||||
$("#enable_tare_weight_handling").prop("checked", true);
|
||||
|
@ -108,9 +108,7 @@ $('#save-purchase-button').on('click', function(e)
|
||||
}
|
||||
|
||||
Grocy.Components.ProductAmountPicker.Reset();
|
||||
$("#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'));
|
||||
$("#display_amount").attr("min", "0." + "0".repeat(parseInt(Grocy.UserSettings.stock_decimal_places_amounts) - 1) + "1");
|
||||
$('#display_amount').val(parseFloat(Grocy.UserSettings.stock_default_purchase_amount));
|
||||
$(".input-group-productamountpicker").trigger("change");
|
||||
$('#price').val('');
|
||||
@ -220,29 +218,15 @@ if (Grocy.Components.ProductPicker !== undefined)
|
||||
|
||||
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)
|
||||
{
|
||||
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("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");
|
||||
}
|
||||
else
|
||||
{
|
||||
$("#display_amount").attr("min", "0." + "0".repeat(parseInt(Grocy.UserSettings.stock_decimal_places_amounts) - 1) + "1");
|
||||
$("#tare-weight-handling-info").addClass("d-none");
|
||||
}
|
||||
|
||||
|
@ -62,19 +62,6 @@ Grocy.Components.ProductPicker.GetPicker().on('change', function(e)
|
||||
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")
|
||||
{
|
||||
$("#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)
|
||||
{
|
||||
$("#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.FrontendHelpers.ValidateForm("recipe-pos-form");
|
||||
}
|
||||
else
|
||||
{
|
||||
$("#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
|
||||
$("#display_amount").parent().find(".invalid-feedback").text(__t("This cannot be negative and must be an integral number"));
|
||||
Grocy.Components.ProductAmountPicker.AllowAnyQuEnabled = false;
|
||||
Grocy.FrontendHelpers.ValidateForm("recipe-pos-form");
|
||||
}
|
||||
|
@ -216,5 +216,3 @@ if (GetUriParam("amount") !== undefined)
|
||||
$(".input-group-productamountpicker").trigger("change");
|
||||
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"));
|
||||
|
@ -96,19 +96,6 @@ Grocy.Api.Get('stock/products/' + Grocy.EditObjectProductId,
|
||||
function(productDetails)
|
||||
{
|
||||
$('#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)
|
||||
{
|
||||
|
@ -1,6 +1,5 @@
|
||||
var stockOverviewTable = $('#stock-overview-table').DataTable({
|
||||
'order': [[4, 'asc']],
|
||||
'colReorder': false,
|
||||
'columnDefs': [
|
||||
{ 'orderable': false, 'targets': 0 },
|
||||
{ 'searchable': false, "targets": 0 },
|
||||
|
@ -89,10 +89,8 @@
|
||||
|
||||
Grocy.Components.ProductAmountPicker.Reset();
|
||||
$("#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("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));
|
||||
RefreshLocaleNumberInput();
|
||||
$(".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)
|
||||
{
|
||||
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();
|
||||
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)
|
||||
{
|
||||
$("#display_amount").attr("min", productDetails.product.tare_weight);
|
||||
@ -209,6 +194,7 @@ Grocy.Components.ProductPicker.GetPicker().on('change', function(e)
|
||||
}
|
||||
else
|
||||
{
|
||||
$("#display_amount").attr("min", "0." + "0".repeat(parseInt(Grocy.UserSettings.stock_decimal_places_amounts) - 1) + "1");
|
||||
$("#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'));
|
||||
}
|
||||
else
|
||||
{
|
||||
$("#display_amount").parent().find(".invalid-feedback").text(__t('The amount must be between %1$s and %2$s', "1", sumValue));
|
||||
}
|
||||
},
|
||||
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'));
|
||||
}
|
||||
else
|
||||
{
|
||||
$("#display_amount").parent().find(".invalid-feedback").text(__t('The amount must be between %1$s and %2$s', "1", sumValue));
|
||||
}
|
||||
},
|
||||
function(xhr)
|
||||
{
|
||||
@ -382,7 +360,6 @@ $("#specific_stock_entry").on("change", function(e)
|
||||
}
|
||||
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'));
|
||||
}
|
||||
});
|
||||
|
@ -55,7 +55,7 @@
|
||||
<span class="text-danger">{{ $__t('Miss') }}: <span id="miss-count"
|
||||
class="locale-number locale-number-generic">0</span></span>
|
||||
</div>
|
||||
<select class="form-control"
|
||||
<select class="custom-control custom-select"
|
||||
id="scanned_codes"
|
||||
name="scanned_codes"
|
||||
multiple
|
||||
|
@ -39,7 +39,7 @@
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fas fa-filter"></i> {{ $__t('Battery') }}</span>
|
||||
</div>
|
||||
<select class="form-control"
|
||||
<select class="custom-control custom-select"
|
||||
id="battery-filter">
|
||||
<option value="all">{{ $__t('All') }}</option>
|
||||
@foreach($batteries as $battery)
|
||||
|
@ -71,7 +71,7 @@
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fas fa-filter"></i> {{ $__t('Status') }}</span>
|
||||
</div>
|
||||
<select class="form-control"
|
||||
<select class="custom-control custom-select"
|
||||
id="status-filter">
|
||||
<option value="all">{{ $__t('All') }}</option>
|
||||
<option value="duesoon">{{ $__t('Due soon') }}</option>
|
||||
|
@ -21,7 +21,6 @@
|
||||
'additionalAttributes' => 'data-setting-key="batteries_due_soon_days"',
|
||||
'label' => 'Due soon days',
|
||||
'min' => 1,
|
||||
'invalidFeedback' => $__t('This cannot be lower than %s', '1'),
|
||||
'additionalCssClasses' => 'user-setting-control'
|
||||
))
|
||||
|
||||
|
@ -68,8 +68,7 @@
|
||||
'label' => 'Charge cycle interval (days)',
|
||||
'value' => $value,
|
||||
'min' => '0',
|
||||
'hint' => $__t('0 means suggestions for the next charge cycle are disabled'),
|
||||
'invalidFeedback' => $__t('This cannot be negative')
|
||||
'hint' => $__t('0 means suggestions for the next charge cycle are disabled')
|
||||
))
|
||||
|
||||
@include('components.userfieldsform', array(
|
||||
|
@ -57,7 +57,7 @@
|
||||
data-toggle="tooltip"
|
||||
title=""></i></label>
|
||||
<select required
|
||||
class="form-control input-group-chore-period-type"
|
||||
class="custom-control custom-select input-group-chore-period-type"
|
||||
id="period_type"
|
||||
name="period_type">
|
||||
@foreach($periodTypes as $periodType)
|
||||
@ -76,7 +76,6 @@
|
||||
'value' => $value,
|
||||
'min' => '0',
|
||||
'additionalCssClasses' => 'input-group-chore-period-type',
|
||||
'invalidFeedback' => $__t('This cannot be negative'),
|
||||
'additionalGroupCssClasses' => 'period-type-input period-type-dynamic-regular period-type-monthly'
|
||||
))
|
||||
|
||||
@ -151,7 +150,6 @@
|
||||
'value' => $value,
|
||||
'min' => '1',
|
||||
'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',
|
||||
'hintId' => 'chore-period-interval-info'
|
||||
))
|
||||
@ -163,7 +161,7 @@
|
||||
data-toggle="tooltip"
|
||||
title=""></i></label>
|
||||
<select required
|
||||
class="form-control input-group-chore-assignment-type"
|
||||
class="custom-control custom-select input-group-chore-assignment-type"
|
||||
id="assignment_type"
|
||||
name="assignment_type">
|
||||
@foreach($assignmentTypes as $assignmentType)
|
||||
@ -179,7 +177,7 @@
|
||||
<label for="assignment_config">{{ $__t('Assign to') }}</label>
|
||||
<select required
|
||||
multiple
|
||||
class="form-control input-group-chore-assignment-type selectpicker"
|
||||
class="custom-control custom-select input-group-chore-assignment-type selectpicker"
|
||||
id="assignment_config"
|
||||
name="assignment_config"
|
||||
data-actions-Box="true"
|
||||
@ -256,9 +254,8 @@
|
||||
'id' => 'product_amount',
|
||||
'label' => 'Amount',
|
||||
'contextInfoId' => 'amount_qu_unit',
|
||||
'min' => '',
|
||||
'min' => '0.' . str_repeat('0', $userSettings['stock_decimal_places_amounts'] - 1) . '1',
|
||||
'decimals' => $userSettings['stock_decimal_places_amounts'],
|
||||
'invalidFeedback' => $__t('The amount cannot be lower than %s', '1'),
|
||||
'isRequired' => false,
|
||||
'value' => $value,
|
||||
'additionalCssClasses' => 'locale-number-input locale-number-quantity-amount'
|
||||
|
@ -39,7 +39,7 @@
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fas fa-filter"></i> {{ $__t('Chore') }}</span>
|
||||
</div>
|
||||
<select class="form-control"
|
||||
<select class="custom-control custom-select"
|
||||
id="chore-filter">
|
||||
<option value="all">{{ $__t('All') }}</option>
|
||||
@foreach($chores as $chore)
|
||||
|
@ -76,7 +76,7 @@
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fas fa-filter"></i> {{ $__t('Status') }}</span>
|
||||
</div>
|
||||
<select class="form-control"
|
||||
<select class="custom-control custom-select"
|
||||
id="status-filter">
|
||||
<option value="all">{{ $__t('All') }}</option>
|
||||
<option value="duesoon">{{ $__t('Due soon') }}</option>
|
||||
@ -90,7 +90,7 @@
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fas fa-filter"></i> {{ $__t('Assignment') }}</span>
|
||||
</div>
|
||||
<select class="form-control"
|
||||
<select class="custom-control custom-select"
|
||||
id="user-filter">
|
||||
<option></option>
|
||||
@foreach($users as $user)
|
||||
|
@ -21,7 +21,6 @@
|
||||
'additionalAttributes' => 'data-setting-key="chores_due_soon_days"',
|
||||
'label' => 'Due soon days',
|
||||
'min' => 1,
|
||||
'invalidFeedback' => $__t('This cannot be lower than %s', '1'),
|
||||
'additionalCssClasses' => 'user-setting-control'
|
||||
))
|
||||
|
||||
|
@ -65,7 +65,7 @@
|
||||
<div class="invalid-feedback">{{ $invalidFeedback }}</div>
|
||||
</div>
|
||||
<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))
|
||||
<div class="form-group mt-n2 mb-0">
|
||||
<div class="custom-control custom-checkbox">
|
||||
|
@ -61,7 +61,7 @@
|
||||
<div class="invalid-feedback">{{ $invalidFeedback }}</div>
|
||||
</div>
|
||||
<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))
|
||||
<div class="form-group mt-n2 mb-0>
|
||||
<div class="
|
||||
|
@ -16,6 +16,7 @@
|
||||
@php if(!isset($isRequired)) { $isRequired = true; } @endphp
|
||||
@php if(!isset($noNameAttribute)) { $noNameAttribute = false; } @endphp
|
||||
@php if(empty($contextInfoId)) { $additionalHtmlContextHelp = ''; } @endphp
|
||||
@php if(!isset($invalidFeedback)) { $invalidFeedback = ''; } @endphp
|
||||
|
||||
<div id="group-{{ $id }}"
|
||||
class="form-group {{ $additionalGroupCssClasses }}">
|
||||
@ -47,6 +48,7 @@
|
||||
min="{{ number_format($min, $decimals, '.', '') }}"
|
||||
max="{{ number_format($max, $decimals, '.', '') }}"
|
||||
step="@if($decimals == 0){{1}}@else{{'.' . str_repeat('0', $userSettings['stock_decimal_places_amounts'] - 1) . '1'}}@endif"
|
||||
data-decimals="{{ $decimals }}"
|
||||
@if($isRequired)
|
||||
required
|
||||
@endif>
|
||||
|
@ -21,7 +21,6 @@
|
||||
'min' => '0.' . str_repeat('0', $userSettings['stock_decimal_places_amounts'] - 1) . '1',
|
||||
'decimals' => $userSettings['stock_decimal_places_amounts'],
|
||||
'value' => $value,
|
||||
'invalidFeedback' => $__t('This cannot be negative and must be an integral number'),
|
||||
'additionalGroupCssClasses' => 'col-sm-5 col-xs-12 my-0',
|
||||
'additionalCssClasses' => 'input-group-productamountpicker locale-number-input locale-number-quantity-amount',
|
||||
'additionalHtmlContextHelp' => '',
|
||||
@ -33,7 +32,7 @@
|
||||
<select @if($isRequired)
|
||||
required
|
||||
@endif
|
||||
class="form-control input-group-productamountpicker"
|
||||
class="custom-control custom-select input-group-productamountpicker"
|
||||
id="qu_id"
|
||||
name="qu_id"
|
||||
data-initial-qu-id="{{ $initialQuId }}">
|
||||
|
@ -89,7 +89,7 @@
|
||||
@elseif($userfield->type == \Grocy\Services\UserfieldsService::USERFIELD_TYPE_PRESET_LIST)
|
||||
<div class="form-group">
|
||||
<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 }}">
|
||||
<option></option>
|
||||
@foreach(preg_split('/\r\n|\r|\n/', $userfield->config) as $option)
|
||||
@ -101,7 +101,7 @@
|
||||
<div class="form-group">
|
||||
<label for="{{ $userfield->name }}">{{ $userfield->caption }}</label>
|
||||
<select multiple
|
||||
class="form-control userfield-input selectpicker"
|
||||
class="custom-control custom-select userfield-input selectpicker"
|
||||
data-userfield-name="{{ $userfield->name }}"
|
||||
data-actions-Box="true"
|
||||
data-live-search="true">
|
||||
|
@ -82,7 +82,7 @@
|
||||
<div class="form-group">
|
||||
<label for="location_id">{{ $__t('Location') }}</label>
|
||||
<select required
|
||||
class="form-control location-combobox"
|
||||
class="custom-control custom-select location-combobox"
|
||||
id="location_id"
|
||||
name="location_id">
|
||||
<option></option>
|
||||
@ -122,7 +122,7 @@
|
||||
</label>
|
||||
</div>
|
||||
<select disabled
|
||||
class="form-control mt-2"
|
||||
class="custom-control custom-select mt-2"
|
||||
id="specific_stock_entry"
|
||||
name="specific_stock_entry">
|
||||
<option></option>
|
||||
|
@ -28,7 +28,6 @@
|
||||
@include('components.productamountpicker', array(
|
||||
'value' => 1,
|
||||
'label' => 'New stock amount',
|
||||
'additionalAttributes' => 'data-not-equal="-1"',
|
||||
'additionalHtmlElements' => '<div id="inventory-change-info"
|
||||
class="form-text text-muted d-none ml-3 my-0 w-100"></div>',
|
||||
'additionalHtmlContextHelp' => '<div id="tare-weight-handling-info"
|
||||
@ -82,14 +81,13 @@
|
||||
@include('components.numberpicker', array(
|
||||
'id' => 'price',
|
||||
'label' => 'Price',
|
||||
'min' => 0,
|
||||
'min' => '0.' . str_repeat('0', $userSettings['stock_decimal_places_amounts'] - 1) . '1',
|
||||
'decimals' => $userSettings['stock_decimal_places_prices'],
|
||||
'value' => '',
|
||||
'hint' => $__t('Per stock quantity unit', GROCY_CURRENCY),
|
||||
'additionalHtmlContextHelp' => '<i class="fas fa-question-circle text-muted"
|
||||
data-toggle="tooltip"
|
||||
title="' . $__t('This will apply to added products') . '"></i>',
|
||||
'invalidFeedback' => $__t('The price cannot be lower than %s', '0'),
|
||||
'isRequired' => false,
|
||||
'additionalCssClasses' => 'locale-number-input locale-number-currency'
|
||||
))
|
||||
|
@ -28,30 +28,45 @@
|
||||
@endpush
|
||||
|
||||
@section('content')
|
||||
<h1 class="d-print-none">
|
||||
@yield('title')
|
||||
<a class="btn btn-outline-dark responsive-button print-all-locations-button"
|
||||
href="#">
|
||||
<i class="fas fa-print"></i> {{ $__t('Print') . ' (' . $__t('all locations') . ')' }}
|
||||
</a>
|
||||
</h1>
|
||||
<h5 class="mb-5 d-print-none">
|
||||
<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>
|
||||
</h5>
|
||||
<div class="title-related-links d-print-none">
|
||||
<h2 class="title">
|
||||
@yield('title')
|
||||
<i class="fas fa-question-circle text-muted small"
|
||||
data-toggle="tooltip"
|
||||
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>
|
||||
</h2>
|
||||
<div class="float-right">
|
||||
<button class="btn btn-outline-dark d-md-none mt-2 order-1 order-md-3"
|
||||
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)
|
||||
<div class="page">
|
||||
<h1 class="text-center">
|
||||
<h1 class="pt-4">
|
||||
<img src="{{ $U('/img/grocy_logo.svg?v=', true) }}{{ $version }}"
|
||||
height="30"
|
||||
class="d-none d-print-flex mx-auto">
|
||||
{{ $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="#">
|
||||
<i class="fas fa-print"></i> {{ $__t('Print') . ' (' . $__t('this location') . ')' }}
|
||||
{{ $__t('Print') . ' (' . $__t('this location') . ')' }}
|
||||
</a>
|
||||
</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') }}:
|
||||
<span class="d-inline print-timestamp"></span>
|
||||
</h6>
|
||||
|
@ -65,7 +65,6 @@
|
||||
'min' => '0.' . str_repeat('0', $userSettings['stock_decimal_places_amounts'] - 1) . '1',
|
||||
'decimals' => $userSettings['stock_decimal_places_amounts'],
|
||||
'value' => '1',
|
||||
'invalidFeedback' => $__t('This cannot be lower than %s', '1'),
|
||||
'additionalCssClasses' => 'locale-number-input locale-number-quantity-amount'
|
||||
))
|
||||
|
||||
|
@ -72,7 +72,7 @@
|
||||
@if(GROCY_FEATURE_FLAG_STOCK_PRICE_TRACKING)
|
||||
<div class="form-group">
|
||||
<label for="shopping_location_id_id">{{ $__t('Store') }}</label>
|
||||
<select class="form-control"
|
||||
<select class="custom-control custom-select"
|
||||
id="shopping_location_id"
|
||||
name="shopping_location_id">
|
||||
<option></option>
|
||||
|
@ -105,7 +105,7 @@
|
||||
<div class="form-group">
|
||||
<label for="location_id">{{ $__t('Default location') }}</label>
|
||||
<select required
|
||||
class="form-control"
|
||||
class="custom-control custom-select"
|
||||
id="location_id"
|
||||
name="location_id">
|
||||
<option></option>
|
||||
@ -142,10 +142,9 @@
|
||||
@include('components.numberpicker', array(
|
||||
'id' => 'min_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'],
|
||||
'value' => $value,
|
||||
'invalidFeedback' => $__t('The amount cannot be lower than %s', '0'),
|
||||
'additionalGroupCssClasses' => 'mb-1',
|
||||
'additionalCssClasses' => 'locale-number-input locale-number-quantity-amount'
|
||||
))
|
||||
@ -212,7 +211,6 @@
|
||||
'label' => 'Default due days',
|
||||
'min' => -1,
|
||||
'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') . ')'
|
||||
))
|
||||
|
||||
@ -223,7 +221,6 @@
|
||||
'label' => 'Default due days after opened',
|
||||
'min' => 0,
|
||||
'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)')
|
||||
))
|
||||
@else
|
||||
@ -245,7 +242,7 @@
|
||||
|
||||
<div class="form-group">
|
||||
<label for="product_group_id">{{ $__t('Product group') }}</label>
|
||||
<select class="form-control"
|
||||
<select class="custom-control custom-select"
|
||||
id="product_group_id"
|
||||
name="product_group_id">
|
||||
<option></option>
|
||||
@ -263,7 +260,7 @@
|
||||
data-toggle="tooltip"
|
||||
title="{{ $__t('Quantity unit stock cannot be changed after first purchase') }}"></i>
|
||||
<select required
|
||||
class="form-control input-group-qu"
|
||||
class="custom-control custom-select input-group-qu"
|
||||
id="qu_id_stock"
|
||||
name="qu_id_stock"
|
||||
@if($mode=='edit'
|
||||
@ -286,7 +283,7 @@
|
||||
data-toggle="tooltip"
|
||||
title="{{ $__t('This is the default quantity unit used when adding this product to the shopping list') }}"></i>
|
||||
<select required
|
||||
class="form-control input-group-qu"
|
||||
class="custom-control custom-select input-group-qu"
|
||||
id="qu_id_purchase"
|
||||
name="qu_id_purchase">
|
||||
<option></option>
|
||||
@ -306,22 +303,11 @@
|
||||
'min' => '0.' . str_repeat('0', $userSettings['stock_decimal_places_amounts'] - 1) . '1',
|
||||
'decimals' => $userSettings['stock_decimal_places_amounts'],
|
||||
'value' => $value,
|
||||
'invalidFeedback' => $__t('The amount cannot be lower than %s', '1'),
|
||||
'additionalCssClasses' => 'input-group-qu locale-number-input locale-number-quantity-amount',
|
||||
'additionalHtmlElements' => '<p id="qu-conversion-info"
|
||||
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="custom-control custom-checkbox">
|
||||
<input @if($mode=='edit'
|
||||
@ -344,7 +330,6 @@
|
||||
'min' => '0.' . str_repeat('0', $userSettings['stock_decimal_places_amounts'] - 1) . '1',
|
||||
'decimals' => $userSettings['stock_decimal_places_amounts'],
|
||||
'value' => $value,
|
||||
'invalidFeedback' => $__t('This cannot be lower than %s', '0'),
|
||||
'additionalAttributes' => $additionalAttributes,
|
||||
'contextInfoId' => 'tare_weight_qu_info',
|
||||
'additionalCssClasses' => 'locale-number-input locale-number-quantity-amount'
|
||||
@ -379,7 +364,6 @@
|
||||
'min' => '0.' . str_repeat('0', $userSettings['stock_decimal_places_amounts']),
|
||||
'decimals' => $userSettings['stock_decimal_places_amounts'],
|
||||
'value' => $value,
|
||||
'invalidFeedback' => $__t('The amount cannot be lower than %s', '0'),
|
||||
'hint' => $__t('Per stock quantity unit'),
|
||||
'isRequired' => false,
|
||||
'additionalCssClasses' => 'locale-number-input locale-number-quantity-amount'
|
||||
@ -392,7 +376,6 @@
|
||||
'label' => 'Default due days after freezing',
|
||||
'min' => -1,
|
||||
'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')
|
||||
))
|
||||
|
||||
@ -402,7 +385,6 @@
|
||||
'label' => 'Default due days after thawing',
|
||||
'min' => -1,
|
||||
'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')
|
||||
))
|
||||
@else
|
||||
@ -419,8 +401,8 @@
|
||||
'id' => 'quick_consume_amount',
|
||||
'label' => 'Quick consume amount',
|
||||
'min' => '0.' . str_repeat('0', $userSettings['stock_decimal_places_amounts'] - 1) . '1',
|
||||
'decimals' => $userSettings['stock_decimal_places_amounts'],
|
||||
'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)'),
|
||||
'contextInfoId' => 'quick_consume_qu_info',
|
||||
'additionalCssClasses' => 'locale-number-input locale-number-quantity-amount'
|
||||
@ -520,12 +502,12 @@
|
||||
@endif
|
||||
<td>
|
||||
@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
|
||||
</td>
|
||||
<td>
|
||||
@if(!empty($barcode->amount))
|
||||
{{ $barcode->amount }}
|
||||
<span class="locale-number locale-number-quantity-amount">{{ $barcode->amount }}</span>
|
||||
@endif
|
||||
</td>
|
||||
</tr>
|
||||
|
@ -62,7 +62,7 @@
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fas fa-filter"></i> {{ $__t('Product group') }}</span>
|
||||
</div>
|
||||
<select class="form-control"
|
||||
<select class="custom-control custom-select"
|
||||
id="product-group-filter">
|
||||
<option value="all">{{ $__t('All') }}</option>
|
||||
@foreach($productGroups as $productGroup)
|
||||
|
@ -15,7 +15,7 @@
|
||||
</script>
|
||||
|
||||
<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">
|
||||
<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"
|
||||
@ -105,7 +105,6 @@
|
||||
'decimals' => $userSettings['stock_decimal_places_prices'],
|
||||
'value' => '',
|
||||
'contextInfoId' => 'price-hint',
|
||||
'invalidFeedback' => $__t('The price cannot be lower than %s', '0'),
|
||||
'isRequired' => false,
|
||||
'additionalGroupCssClasses' => 'mb-1',
|
||||
'additionalCssClasses' => 'locale-number-input locale-number-currency'
|
||||
|
@ -51,7 +51,7 @@
|
||||
<div class="form-group">
|
||||
<label for="from_qu_id">{{ $__t('Quantity unit from') }}</label>
|
||||
<select required
|
||||
class="form-control input-group-qu"
|
||||
class="custom-control custom-select input-group-qu"
|
||||
id="from_qu_id"
|
||||
name="from_qu_id">
|
||||
<option></option>
|
||||
@ -68,7 +68,7 @@
|
||||
<div class="form-group">
|
||||
<label for="to_qu_id">{{ $__t('Quantity unit to') }}</label>
|
||||
<select required
|
||||
class="form-control input-group-qu"
|
||||
class="custom-control custom-select input-group-qu"
|
||||
id="to_qu_id"
|
||||
name="to_qu_id">
|
||||
<option></option>
|
||||
@ -88,7 +88,6 @@
|
||||
'min' => '0.' . str_repeat('0', $userSettings['stock_decimal_places_amounts'] - 1) . '1',
|
||||
'decimals' => $userSettings['stock_decimal_places_amounts'],
|
||||
'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"
|
||||
class="form-text text-info d-none"></p>',
|
||||
'additionalCssClasses' => 'input-group-qu locale-number-input locale-number-quantity-amount'
|
||||
|
@ -25,7 +25,7 @@
|
||||
|
||||
<div class="form-group">
|
||||
<label for="qu_id">{{ $__t('Quantity unit') }}</label>
|
||||
<select class="form-control"
|
||||
<select class="custom-control custom-select"
|
||||
id="qu_id"
|
||||
name="qu_id">
|
||||
<option></option>
|
||||
|
@ -68,7 +68,6 @@
|
||||
'min' => '0.' . str_repeat('0', $userSettings['stock_decimal_places_amounts'] - 1) . '1',
|
||||
'decimals' => $userSettings['stock_decimal_places_amounts'],
|
||||
'value' => $value,
|
||||
'invalidFeedback' => $__t('This cannot be lower than %s', '1'),
|
||||
'hint' => $__t('The ingredients listed here result in this amount of servings'),
|
||||
'additionalCssClasses' => 'locale-number-input locale-number-quantity-amount'
|
||||
))
|
||||
@ -365,7 +364,6 @@
|
||||
'min' => '0.' . str_repeat('0', $userSettings['stock_decimal_places_amounts'] - 1) . '1',
|
||||
'decimals' => $userSettings['stock_decimal_places_amounts'],
|
||||
'value' => '1',
|
||||
'invalidFeedback' => $__t('This cannot be lower than %s', '1'),
|
||||
'additionalCssClasses' => 'locale-number-input locale-number-quantity-amount'
|
||||
))
|
||||
|
||||
|
@ -113,7 +113,6 @@
|
||||
'decimals' => $userSettings['stock_decimal_places_amounts'],
|
||||
'value' => '',
|
||||
'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,
|
||||
'value' => $value,
|
||||
'additionalCssClasses' => 'locale-number-input locale-number-quantity-amount'
|
||||
|
@ -56,7 +56,7 @@
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fas fa-filter"></i> {{ $__t('Status') }}</span>
|
||||
</div>
|
||||
<select class="form-control"
|
||||
<select class="custom-control custom-select"
|
||||
id="status-filter">
|
||||
<option value="all">{{ $__t('All') }}</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',
|
||||
'decimals' => $userSettings['stock_decimal_places_amounts'],
|
||||
'value' => $recipe->desired_servings,
|
||||
'invalidFeedback' => $__t('This cannot be lower than %s', '1'),
|
||||
'additionalAttributes' => 'data-recipe-id="' . $recipe->id . '"',
|
||||
'hint' => $__t('Base: %s', $recipe->base_servings),
|
||||
'additionalCssClasses' => 'locale-number-input locale-number-quantity-amount'
|
||||
|
@ -49,7 +49,7 @@
|
||||
<div class="related-links collapse d-md-flex order-2 width-xs-sm-100"
|
||||
id="related-links">
|
||||
<div class="my-auto float-right">
|
||||
<select class="form-control form-control-sm"
|
||||
<select class="custom-control custom-select"
|
||||
id="selected-shopping-list">
|
||||
@foreach($shoppingLists as $shoppingList)
|
||||
<option @if($shoppingList->id == $selectedShoppingListId) selected="selected" @endif value="{{ $shoppingList->id }}">{{ $shoppingList->name }}</option>
|
||||
@ -143,7 +143,7 @@
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fas fa-filter"></i> {{ $__t('Status') }}</span>
|
||||
</div>
|
||||
<select class="form-control"
|
||||
<select class="custom-control custom-select"
|
||||
id="status-filter">
|
||||
<option value="all">{{ $__t('All') }}</option>
|
||||
<option class="@if(!GROCY_FEATURE_FLAG_STOCK) d-none @endif"
|
||||
|
@ -40,7 +40,7 @@
|
||||
@if(GROCY_FEATURE_FLAG_SHOPPINGLIST_MULTIPLE_LISTS)
|
||||
<div class="form-group">
|
||||
<label for="shopping_list_id">{{ $__t('Shopping list') }}</label>
|
||||
<select class="form-control"
|
||||
<select class="custom-control custom-select"
|
||||
id="shopping_list_id"
|
||||
name="shopping_list_id">
|
||||
@foreach($shoppingLists as $shoppingList)
|
||||
@ -73,7 +73,6 @@
|
||||
'value' => $value,
|
||||
'initialQuId' => $initialQuId,
|
||||
'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
|
||||
))
|
||||
|
||||
|
@ -57,9 +57,9 @@
|
||||
'id' => 'amount',
|
||||
'value' => $stockEntry->amount,
|
||||
'min' => '0.' . str_repeat('0', $userSettings['stock_decimal_places_amounts'] - 1) . '1',
|
||||
'decimals' => $userSettings['stock_decimal_places_amounts'],
|
||||
'label' => 'Amount',
|
||||
'contextInfoId' => 'amount_qu_unit',
|
||||
'invalidFeedback' => $__t('The amount cannot be lower than %s', '0'),
|
||||
'additionalCssClasses' => 'locale-number-input locale-number-quantity-amount'
|
||||
))
|
||||
|
||||
@ -81,7 +81,6 @@
|
||||
'min' => '0.' . str_repeat('0', $userSettings['stock_decimal_places_prices'] - 1) . '1',
|
||||
'decimals' => $userSettings['stock_decimal_places_prices'],
|
||||
'hint' => $__t('Per stock quantity unit'),
|
||||
'invalidFeedback' => $__t('The price cannot be lower than %s', '0'),
|
||||
'isRequired' => false,
|
||||
'additionalCssClasses' => 'locale-number-input locale-number-currency'
|
||||
))
|
||||
|
@ -50,7 +50,7 @@
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fas fa-filter"></i> {{ $__t('Product') }}</span>
|
||||
</div>
|
||||
<select class="form-control"
|
||||
<select class="custom-control custom-select"
|
||||
id="product-filter">
|
||||
<option value="all">{{ $__t('All') }}</option>
|
||||
@foreach($products as $product)
|
||||
|
@ -99,7 +99,7 @@
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fas fa-filter"></i> {{ $__t('Location') }}</span>
|
||||
</div>
|
||||
<select class="form-control"
|
||||
<select class="custom-control custom-select"
|
||||
id="location-filter">
|
||||
<option value="all">{{ $__t('All') }}</option>
|
||||
@foreach($locations as $location)
|
||||
@ -114,7 +114,7 @@
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fas fa-filter"></i> {{ $__t('Product group') }}</span>
|
||||
</div>
|
||||
<select class="form-control"
|
||||
<select class="custom-control custom-select"
|
||||
id="product-group-filter">
|
||||
<option value="all">{{ $__t('All') }}</option>
|
||||
@foreach($productGroups as $productGroup)
|
||||
@ -128,7 +128,7 @@
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fas fa-filter"></i> {{ $__t('Status') }}</span>
|
||||
</div>
|
||||
<select class="form-control"
|
||||
<select class="custom-control custom-select"
|
||||
id="status-filter">
|
||||
<option class="bg-white"
|
||||
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>
|
||||
</a>
|
||||
<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="#"
|
||||
data-toggle="tooltip"
|
||||
data-placement="right"
|
||||
@ -222,17 +222,6 @@
|
||||
<i class="fas fa-ellipsis-v"></i>
|
||||
</button>
|
||||
<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"
|
||||
type="button"
|
||||
href="{{ $U('/shoppinglistitem/new?embedded&updateexistingproduct&product=' . $currentStockEntry->product_id ) }}">
|
||||
|
@ -21,7 +21,7 @@
|
||||
@if(GROCY_FEATURE_FLAG_STOCK_LOCATION_TRACKING)
|
||||
<div class="form-group">
|
||||
<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"
|
||||
data-setting-key="product_presets_location_id">
|
||||
<option value="-1"></option>
|
||||
@ -34,7 +34,7 @@
|
||||
|
||||
<div class="form-group">
|
||||
<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"
|
||||
data-setting-key="product_presets_product_group_id">
|
||||
<option value="-1"></option>
|
||||
@ -46,7 +46,7 @@
|
||||
|
||||
<div class="form-group">
|
||||
<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"
|
||||
data-setting-key="product_presets_qu_id">
|
||||
<option value="-1"></option>
|
||||
@ -63,7 +63,6 @@
|
||||
'additionalAttributes' => 'data-setting-key="stock_due_soon_days"',
|
||||
'label' => 'Due soon days',
|
||||
'min' => 1,
|
||||
'invalidFeedback' => $__t('This cannot be lower than %s', '1'),
|
||||
'additionalCssClasses' => 'user-setting-control'
|
||||
))
|
||||
|
||||
@ -87,7 +86,6 @@
|
||||
'label' => 'Default amount for purchase',
|
||||
'min' => 0,
|
||||
'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',
|
||||
))
|
||||
|
||||
@ -124,7 +122,6 @@
|
||||
'label' => 'Default amount for consume',
|
||||
'min' => 0,
|
||||
'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'
|
||||
))
|
||||
|
||||
@ -135,8 +132,6 @@
|
||||
'additionalAttributes' => 'data-setting-key="stock_decimal_places_amounts"',
|
||||
'label' => 'Decimal places allowed for amounts',
|
||||
'min' => 0,
|
||||
'decimals' => 0,
|
||||
'invalidFeedback' => $__t('This cannot be lower than %s', '0'),
|
||||
'additionalCssClasses' => 'user-setting-control'
|
||||
))
|
||||
|
||||
@ -145,8 +140,6 @@
|
||||
'additionalAttributes' => 'data-setting-key="stock_decimal_places_prices"',
|
||||
'label' => 'Decimal places allowed for prices',
|
||||
'min' => 0,
|
||||
'decimals' => 0,
|
||||
'invalidFeedback' => $__t('This cannot be lower than %s', '0'),
|
||||
'additionalCssClasses' => 'user-setting-control'
|
||||
))
|
||||
|
||||
|
@ -74,7 +74,7 @@
|
||||
|
||||
<div class="form-group">
|
||||
<label for="category_id">{{ $__t('Category') }}</label>
|
||||
<select class="form-control"
|
||||
<select class="custom-control custom-select"
|
||||
id="category_id"
|
||||
name="category_id">
|
||||
<option></option>
|
||||
|
@ -78,7 +78,7 @@
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fas fa-filter"></i> {{ $__t('Status') }}</span>
|
||||
</div>
|
||||
<select class="form-control"
|
||||
<select class="custom-control custom-select"
|
||||
id="status-filter">
|
||||
<option value="all">{{ $__t('All') }}</option>
|
||||
<option value="duesoon">{{ $__t('Due soon') }}</option>
|
||||
|
@ -21,7 +21,6 @@
|
||||
'additionalAttributes' => 'data-setting-key="tasks_due_soon_days"',
|
||||
'label' => 'Due soon days',
|
||||
'min' => 1,
|
||||
'invalidFeedback' => $__t('This cannot be lower than %s', '1'),
|
||||
'additionalCssClasses' => 'user-setting-control'
|
||||
))
|
||||
|
||||
|
@ -29,7 +29,7 @@
|
||||
<div class="form-group">
|
||||
<label for="location_id_from">{{ $__t('From location') }}</label>
|
||||
<select required
|
||||
class="form-control location-combobox"
|
||||
class="custom-control custom-select location-combobox"
|
||||
id="location_id_from"
|
||||
name="location_id_from">
|
||||
<option></option>
|
||||
@ -50,7 +50,7 @@
|
||||
<div class="form-group">
|
||||
<label for="location_id_to">{{ $__t('To location') }}</label>
|
||||
<select required
|
||||
class="form-control location-combobox"
|
||||
class="custom-control custom-select location-combobox"
|
||||
id="location_id_to"
|
||||
name="location_id_to">
|
||||
<option></option>
|
||||
@ -77,7 +77,7 @@
|
||||
</label>
|
||||
</div>
|
||||
<select disabled
|
||||
class="form-control mt-2"
|
||||
class="custom-control custom-select mt-2"
|
||||
id="specific_stock_entry"
|
||||
name="specific_stock_entry">
|
||||
<option></option>
|
||||
|
@ -35,7 +35,7 @@
|
||||
<div class="form-group">
|
||||
<label for="entity">{{ $__t('Entity') }}</label>
|
||||
<select required
|
||||
class="form-control"
|
||||
class="custom-control custom-select"
|
||||
id="entity"
|
||||
name="entity">
|
||||
<option></option>
|
||||
@ -74,7 +74,7 @@
|
||||
<div class="form-group">
|
||||
<label for="type">{{ $__t('Type') }}</label>
|
||||
<select required
|
||||
class="form-control"
|
||||
class="custom-control custom-select"
|
||||
id="type"
|
||||
name="type">
|
||||
<option></option>
|
||||
|
@ -55,7 +55,7 @@
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fas fa-filter"></i> {{ $__t('Entity') }}</span>
|
||||
</div>
|
||||
<select class="form-control"
|
||||
<select class="custom-control custom-select"
|
||||
id="entity-filter">
|
||||
<option value="all">{{ $__t('All') }}</option>
|
||||
@foreach($entities as $entity)
|
||||
|
@ -18,7 +18,7 @@
|
||||
|
||||
<div class="form-group">
|
||||
<label for="locale">{{ $__t('Language') }}</label>
|
||||
<select class="form-control user-setting-control"
|
||||
<select class="custom-control custom-select user-setting-control"
|
||||
id="locale"
|
||||
data-setting-key="locale">
|
||||
<option value="">{{ $__t('Default') }}</option>
|
||||
|
Loading…
x
Reference in New Issue
Block a user