diff --git a/changelog/76_UNRELEASED_xxxx-xx-xx.md b/changelog/76_UNRELEASED_xxxx-xx-xx.md index 2c8d122b..d345ac0a 100644 --- a/changelog/76_UNRELEASED_xxxx-xx-xx.md +++ b/changelog/76_UNRELEASED_xxxx-xx-xx.md @@ -16,6 +16,7 @@ - After that, the transaction is continued with that product - Fixed that when copying a product, the field "Treat opened as out of stock" wasn't copied along (thanks @TheDodger) - Fixed that the product groups filter on the master data products page used a contains search instead of an exact search +- Fixed that Scan Mode on the purchase page didn't work (not all fields were properly populated) when using/scanning a product Grocycodes ### Shopping list diff --git a/public/viewjs/purchase.js b/public/viewjs/purchase.js index 9f6f70f2..4d518d3c 100644 --- a/public/viewjs/purchase.js +++ b/public/viewjs/purchase.js @@ -358,7 +358,7 @@ if (Grocy.Components.ProductPicker !== undefined) Grocy.Api.Get('objects/product_barcodes?query[]=barcode=' + document.getElementById("product_id").getAttribute("barcode"), function(barcodeResult) { - if (barcodeResult) + if (barcodeResult && barcodeResult.length > 0) { var barcode = barcodeResult[0]; $("#purchase-form").attr("data-used-barcode", barcode.id);