Fixed product Grocycode handling on /purchase (references #2571)

This commit is contained in:
Bernd Bestel 2024-08-24 11:32:15 +02:00
parent 7080ec9a8f
commit 1246f402e5
No known key found for this signature in database
GPG Key ID: 71BD34C0D4891300
2 changed files with 2 additions and 1 deletions

View File

@ -16,6 +16,7 @@
- After that, the transaction is continued with that product - 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 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 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 ### Shopping list

View File

@ -358,7 +358,7 @@ if (Grocy.Components.ProductPicker !== undefined)
Grocy.Api.Get('objects/product_barcodes?query[]=barcode=' + document.getElementById("product_id").getAttribute("barcode"), Grocy.Api.Get('objects/product_barcodes?query[]=barcode=' + document.getElementById("product_id").getAttribute("barcode"),
function(barcodeResult) function(barcodeResult)
{ {
if (barcodeResult) if (barcodeResult && barcodeResult.length > 0)
{ {
var barcode = barcodeResult[0]; var barcode = barcodeResult[0];
$("#purchase-form").attr("data-used-barcode", barcode.id); $("#purchase-form").attr("data-used-barcode", barcode.id);