mirror of
https://github.com/grocy/grocy.git
synced 2026-04-09 22:16:16 +02:00
Revert changes no longer needed
This commit is contained in:
parent
cb8898e046
commit
40721aa421
|
|
@ -373,11 +373,9 @@ Grocy.Components.ProductPicker.GetPicker().on('change', function(e)
|
||||||
$(".input-group-productamountpicker").trigger("change");
|
$(".input-group-productamountpicker").trigger("change");
|
||||||
|
|
||||||
var defaultLocationId = productDetails.location.id;
|
var defaultLocationId = productDetails.location.id;
|
||||||
var defaultConsumeLocationId = productDetails.product.default_consume_location_id;
|
if (productDetails.product.default_consume_location_id != null && !productDetails.product.default_consume_location_id.isEmpty())
|
||||||
|
|
||||||
if (defaultConsumeLocationId != null && !defaultConsumeLocationId.isEmpty())
|
|
||||||
{
|
{
|
||||||
defaultLocationId = defaultConsumeLocationId;
|
defaultLocationId = productDetails.product.default_consume_location_id;
|
||||||
}
|
}
|
||||||
|
|
||||||
$("#location_id").find("option").remove().end().append("<option></option>");
|
$("#location_id").find("option").remove().end().append("<option></option>");
|
||||||
|
|
@ -388,22 +386,26 @@ Grocy.Components.ProductPicker.GetPicker().on('change', function(e)
|
||||||
var stockAmountAtDefaultLocation = 0;
|
var stockAmountAtDefaultLocation = 0;
|
||||||
stockLocations.forEach(stockLocation =>
|
stockLocations.forEach(stockLocation =>
|
||||||
{
|
{
|
||||||
var stockLocationName = stockLocation.location_name;
|
if (stockLocation.location_id == defaultLocationId)
|
||||||
if (stockLocation.location_id == defaultLocationId) {
|
{
|
||||||
stockLocationName += " (" + __t("Default location") + ")";
|
$("#location_id").append($("<option>", {
|
||||||
|
value: stockLocation.location_id,
|
||||||
|
text: stockLocation.location_name + " (" + __t("Default location") + ")"
|
||||||
|
}));
|
||||||
|
$("#location_id").val(defaultLocationId);
|
||||||
|
$("#location_id").trigger('change');
|
||||||
setDefault = 1;
|
setDefault = 1;
|
||||||
stockAmountAtDefaultLocation += Number.parseFloat(stockLocation.amount);
|
stockAmountAtDefaultLocation += Number.parseFloat(stockLocation.amount);
|
||||||
}
|
}
|
||||||
$("#location_id").append($("<option>", {
|
else
|
||||||
value: stockLocation.location_id,
|
{
|
||||||
text: stockLocationName
|
$("#location_id").append($("<option>", {
|
||||||
}));
|
value: stockLocation.location_id,
|
||||||
$("#location_id").val(defaultLocationId);
|
text: stockLocation.location_name
|
||||||
$("#location_id").trigger('change');
|
}));
|
||||||
setDefault = 1;
|
}
|
||||||
stockAmountAtDefaultLocation += Number.parseFloat(stockLocation.amount);
|
|
||||||
|
|
||||||
if (!setDefault)
|
if (setDefault == 0)
|
||||||
{
|
{
|
||||||
$("#location_id").val(defaultLocationId);
|
$("#location_id").val(defaultLocationId);
|
||||||
$("#location_id").trigger('change');
|
$("#location_id").trigger('change');
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user