mirror of
https://github.com/grocy/grocy.git
synced 2025-04-29 09:39:57 +00:00
Fixed the "Add as barcode to existing product" productpicker workflow from the /shoppinglistitem page (fixes #1262)
This commit is contained in:
parent
4086a63ebd
commit
734e174442
@ -41,6 +41,7 @@
|
||||
- Fixed the form validation on the shopping list item page (thanks @Forceu)
|
||||
- Fixed that when adding products to the shopping list from the stock overview page, the used quantity unit was always the products default purchase QU (and not the selected one)
|
||||
- Fixed that the displayed last unit/total price was wrong when the used quantity unit was not the products stock QU
|
||||
- Fixed that the "Add as barcode to existing product" productpicker workflow did not work
|
||||
|
||||
### Recipe improvements/fixes
|
||||
- Recipe printing improvements (thanks @Ape)
|
||||
|
@ -220,7 +220,7 @@ $('#product_id_text_input').on('blur', function(e)
|
||||
callback: function()
|
||||
{
|
||||
Grocy.Components.ProductPicker.PopupOpen = false;
|
||||
window.location.href = U(Grocy.CurrentUrlRelative + '?flow=InplaceAddBarcodeToExistingProduct&barcode=' + encodeURIComponent(input));
|
||||
window.location.href = U(Grocy.CurrentUrlRelative + '?flow=InplaceAddBarcodeToExistingProduct&barcode=' + encodeURIComponent(input) + "&" + embedded);
|
||||
}
|
||||
},
|
||||
addnewproductwithbarcode: {
|
||||
|
@ -19,6 +19,27 @@ $('#save-shoppinglist-button').on('click', function(e)
|
||||
|
||||
Grocy.FrontendHelpers.BeginUiBusy("shoppinglist-form");
|
||||
|
||||
if (GetUriParam("flow") === "InplaceAddBarcodeToExistingProduct")
|
||||
{
|
||||
var jsonDataBarcode = {};
|
||||
jsonDataBarcode.barcode = GetUriParam("barcode");
|
||||
jsonDataBarcode.product_id = jsonData.product_id;
|
||||
|
||||
Grocy.Api.Post('objects/product_barcodes', jsonDataBarcode,
|
||||
function(result)
|
||||
{
|
||||
$("#flow-info-InplaceAddBarcodeToExistingProduct").addClass("d-none");
|
||||
$('#barcode-lookup-disabled-hint').addClass('d-none');
|
||||
$('#barcode-lookup-hint').removeClass('d-none');
|
||||
},
|
||||
function(xhr)
|
||||
{
|
||||
Grocy.FrontendHelpers.EndUiBusy("shoppinglist-form");
|
||||
Grocy.FrontendHelpers.ShowGenericError('Error while saving, probably this item already exists', xhr.response);
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
if (GetUriParam("updateexistingproduct") !== undefined)
|
||||
{
|
||||
jsonData.product_amount = jsonData.amount;
|
||||
|
Loading…
x
Reference in New Issue
Block a user