mirror of
https://github.com/grocy/grocy.git
synced 2025-04-29 09:39:57 +00:00
Fixed shopping list item form product barcode scan handling (fixes #1940)
This commit is contained in:
parent
b57ba59243
commit
8cb9157c73
@ -12,7 +12,7 @@
|
||||
|
||||
### Shopping list
|
||||
|
||||
- xxx
|
||||
- Fixed that products could not be added to the shopping list via barcode scanning
|
||||
|
||||
### Recipes
|
||||
|
||||
|
@ -400,6 +400,7 @@ class StockController extends BaseController
|
||||
{
|
||||
return $this->renderPage($response, 'shoppinglistitemform', [
|
||||
'products' => $this->getDatabase()->products()->where('active = 1')->orderBy('name', 'COLLATE NOCASE'),
|
||||
'barcodes' => $this->getDatabase()->product_barcodes_comma_separated(),
|
||||
'shoppingLists' => $this->getDatabase()->shopping_lists()->orderBy('name', 'COLLATE NOCASE'),
|
||||
'mode' => 'create',
|
||||
'quantityUnits' => $this->getDatabase()->quantity_units()->orderBy('name', 'COLLATE NOCASE'),
|
||||
@ -412,6 +413,7 @@ class StockController extends BaseController
|
||||
return $this->renderPage($response, 'shoppinglistitemform', [
|
||||
'listItem' => $this->getDatabase()->shopping_list($args['itemId']),
|
||||
'products' => $this->getDatabase()->products()->where('active = 1')->orderBy('name', 'COLLATE NOCASE'),
|
||||
'barcodes' => $this->getDatabase()->product_barcodes_comma_separated(),
|
||||
'shoppingLists' => $this->getDatabase()->shopping_lists()->orderBy('name', 'COLLATE NOCASE'),
|
||||
'mode' => 'edit',
|
||||
'quantityUnits' => $this->getDatabase()->quantity_units()->orderBy('name', 'COLLATE NOCASE'),
|
||||
|
@ -277,7 +277,7 @@ $('#product_id_text_input').on('blur', function(e)
|
||||
{
|
||||
if (barcodeResult.length > 0)
|
||||
{
|
||||
existsAsProduct = true;
|
||||
existsAsBarcode = true;
|
||||
}
|
||||
|
||||
Grocy.Api.Get('objects/products?query[]=name=' + input,
|
||||
|
@ -61,6 +61,7 @@
|
||||
@php if($mode == 'edit') { $productId = $listItem->product_id; } else { $productId = ''; } @endphp
|
||||
@include('components.productpicker', array(
|
||||
'products' => $products,
|
||||
'barcodes' => $barcodes,
|
||||
'nextInputSelector' => '#amount',
|
||||
'isRequired' => true,
|
||||
'prefillById' => $productId,
|
||||
|
Loading…
x
Reference in New Issue
Block a user