mirror of
https://github.com/grocy/grocy.git
synced 2025-04-29 01:32:38 +00:00
Fixed consuming Scan Mode timing (fixes #1292)
This commit is contained in:
parent
42689ecefe
commit
a1adc80c29
@ -2,4 +2,5 @@
|
||||
- Fixed that editing stock entries was not possible
|
||||
- Fixed that shopping list prints had a grey background (thanks @Forceu)
|
||||
- Improved/fixed the form validation on the shopping list item page (thanks @Forceu)
|
||||
- Fixed that consuming with Scan Mode was not possible
|
||||
- Some night mode style improvements (thanks @BlizzWave)
|
||||
|
@ -265,6 +265,11 @@ $("#location_id").on('change', function(e)
|
||||
console.error(xhr);
|
||||
}
|
||||
);
|
||||
|
||||
if (document.getElementById("product_id").getAttribute("barcode") == "null")
|
||||
{
|
||||
ScanModeSubmit();
|
||||
}
|
||||
},
|
||||
function(xhr)
|
||||
{
|
||||
@ -369,10 +374,9 @@ Grocy.Components.ProductPicker.GetPicker().on('change', function(e)
|
||||
$(".input-group-productamountpicker").trigger("change");
|
||||
Grocy.FrontendHelpers.ValidateForm('consume-form');
|
||||
RefreshLocaleNumberInput();
|
||||
ScanModeSubmit(false);
|
||||
}
|
||||
}
|
||||
|
||||
ScanModeSubmit(false);
|
||||
},
|
||||
function(xhr)
|
||||
{
|
||||
@ -380,10 +384,6 @@ Grocy.Components.ProductPicker.GetPicker().on('change', function(e)
|
||||
}
|
||||
);
|
||||
}
|
||||
else
|
||||
{
|
||||
ScanModeSubmit();
|
||||
}
|
||||
},
|
||||
function(xhr)
|
||||
{
|
||||
@ -612,6 +612,11 @@ var current_productDetails;
|
||||
function RefreshForm()
|
||||
{
|
||||
var productDetails = current_productDetails;
|
||||
if (!productDetails)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (productDetails.product.enable_tare_weight_handling == 1)
|
||||
{
|
||||
$("#consume-exact-amount-group").removeClass("d-none");
|
||||
@ -650,12 +655,10 @@ function ScanModeSubmit(singleUnit = true)
|
||||
if (singleUnit)
|
||||
{
|
||||
$("#display_amount").val(1);
|
||||
$(".input-group-productamountpicker").trigger("change");
|
||||
}
|
||||
|
||||
RefreshLocaleNumberInput();
|
||||
$(".input-group-productamountpicker").trigger("change");
|
||||
Grocy.FrontendHelpers.ValidateForm("consume-form");
|
||||
|
||||
if (document.getElementById("consume-form").checkValidity() === true)
|
||||
{
|
||||
$('#save-consume-button').click();
|
||||
|
Loading…
x
Reference in New Issue
Block a user