Fixed embedded /transfer from /stockentries (fixes #1303)

This commit is contained in:
Bernd Bestel 2021-02-21 19:36:37 +01:00
parent 5583074001
commit 906a9db628
No known key found for this signature in database
GPG Key ID: 71BD34C0D4891300
2 changed files with 14 additions and 3 deletions

View File

@ -3,6 +3,7 @@
- Fixed that editing stock entries was not possible
- Fixed that consuming with Scan Mode was not possible
- Fixed that the current stock total value (header of the stock overview page) didn't include decimal amounts (thanks @Ape)
- Fixed that the transfer page was not fully populated when opening it from the stock entries page
### Shopping list fixes
- Fixed that shopping list prints had a grey background (thanks @Forceu)

View File

@ -126,12 +126,15 @@
Grocy.Components.ProductPicker.GetPicker().on('change', function(e)
{
$("#specific_stock_entry").find("option").remove().end().append("<option></option>");
if ($("#use_specific_stock_entry").is(":checked"))
if ($("#use_specific_stock_entry").is(":checked") && GetUriParam("stockId") == null)
{
$("#use_specific_stock_entry").click();
}
$("#location_id_to").val("");
if (GetUriParam("stockId") == null)
{
$("#location_id_from").val("");
}
var productId = $(e.target).val();
@ -185,6 +188,12 @@ Grocy.Components.ProductPicker.GetPicker().on('change', function(e)
$("#location_id_from").trigger('change');
}
});
if (GetUriParam("locationId") != null)
{
$("#location_id_from").val(GetUriParam("locationId"));
$("#location_id_from").trigger("change");
}
},
function(xhr)
{
@ -284,7 +293,7 @@ $("#location_id_from").on('change', function(e)
}
$("#specific_stock_entry").find("option").remove().end().append("<option></option>");
if ($("#use_specific_stock_entry").is(":checked"))
if ($("#use_specific_stock_entry").is(":checked") && GetUriParam("stockId") == null)
{
$("#use_specific_stock_entry").click();
}
@ -475,6 +484,7 @@ if (GetUriParam("embedded") !== undefined)
$("#location_id_from").trigger('change');
$("#use_specific_stock_entry").click();
$("#use_specific_stock_entry").trigger('change');
Grocy.Components.ProductPicker.GetPicker().trigger('change');
}
}