mirror of
https://github.com/grocy/grocy.git
synced 2026-04-04 03:46: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");
|
||||
|
||||
var defaultLocationId = productDetails.location.id;
|
||||
var defaultConsumeLocationId = productDetails.product.default_consume_location_id;
|
||||
|
||||
if (defaultConsumeLocationId != null && !defaultConsumeLocationId.isEmpty())
|
||||
if (productDetails.product.default_consume_location_id != null && !productDetails.product.default_consume_location_id.isEmpty())
|
||||
{
|
||||
defaultLocationId = defaultConsumeLocationId;
|
||||
defaultLocationId = productDetails.product.default_consume_location_id;
|
||||
}
|
||||
|
||||
$("#location_id").find("option").remove().end().append("<option></option>");
|
||||
|
|
@ -388,22 +386,26 @@ Grocy.Components.ProductPicker.GetPicker().on('change', function(e)
|
|||
var stockAmountAtDefaultLocation = 0;
|
||||
stockLocations.forEach(stockLocation =>
|
||||
{
|
||||
var stockLocationName = stockLocation.location_name;
|
||||
if (stockLocation.location_id == defaultLocationId) {
|
||||
stockLocationName += " (" + __t("Default location") + ")";
|
||||
if (stockLocation.location_id == defaultLocationId)
|
||||
{
|
||||
$("#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;
|
||||
stockAmountAtDefaultLocation += Number.parseFloat(stockLocation.amount);
|
||||
}
|
||||
$("#location_id").append($("<option>", {
|
||||
value: stockLocation.location_id,
|
||||
text: stockLocationName
|
||||
}));
|
||||
$("#location_id").val(defaultLocationId);
|
||||
$("#location_id").trigger('change');
|
||||
setDefault = 1;
|
||||
stockAmountAtDefaultLocation += Number.parseFloat(stockLocation.amount);
|
||||
else
|
||||
{
|
||||
$("#location_id").append($("<option>", {
|
||||
value: stockLocation.location_id,
|
||||
text: stockLocation.location_name
|
||||
}));
|
||||
}
|
||||
|
||||
if (!setDefault)
|
||||
if (setDefault == 0)
|
||||
{
|
||||
$("#location_id").val(defaultLocationId);
|
||||
$("#location_id").trigger('change');
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user