mirror of
https://github.com/grocy/grocy.git
synced 2025-04-29 17:45:39 +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
|
### Shopping list
|
||||||
|
|
||||||
- xxx
|
- Fixed that products could not be added to the shopping list via barcode scanning
|
||||||
|
|
||||||
### Recipes
|
### Recipes
|
||||||
|
|
||||||
|
@ -400,6 +400,7 @@ class StockController extends BaseController
|
|||||||
{
|
{
|
||||||
return $this->renderPage($response, 'shoppinglistitemform', [
|
return $this->renderPage($response, 'shoppinglistitemform', [
|
||||||
'products' => $this->getDatabase()->products()->where('active = 1')->orderBy('name', 'COLLATE NOCASE'),
|
'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'),
|
'shoppingLists' => $this->getDatabase()->shopping_lists()->orderBy('name', 'COLLATE NOCASE'),
|
||||||
'mode' => 'create',
|
'mode' => 'create',
|
||||||
'quantityUnits' => $this->getDatabase()->quantity_units()->orderBy('name', 'COLLATE NOCASE'),
|
'quantityUnits' => $this->getDatabase()->quantity_units()->orderBy('name', 'COLLATE NOCASE'),
|
||||||
@ -412,6 +413,7 @@ class StockController extends BaseController
|
|||||||
return $this->renderPage($response, 'shoppinglistitemform', [
|
return $this->renderPage($response, 'shoppinglistitemform', [
|
||||||
'listItem' => $this->getDatabase()->shopping_list($args['itemId']),
|
'listItem' => $this->getDatabase()->shopping_list($args['itemId']),
|
||||||
'products' => $this->getDatabase()->products()->where('active = 1')->orderBy('name', 'COLLATE NOCASE'),
|
'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'),
|
'shoppingLists' => $this->getDatabase()->shopping_lists()->orderBy('name', 'COLLATE NOCASE'),
|
||||||
'mode' => 'edit',
|
'mode' => 'edit',
|
||||||
'quantityUnits' => $this->getDatabase()->quantity_units()->orderBy('name', 'COLLATE NOCASE'),
|
'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)
|
if (barcodeResult.length > 0)
|
||||||
{
|
{
|
||||||
existsAsProduct = true;
|
existsAsBarcode = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
Grocy.Api.Get('objects/products?query[]=name=' + input,
|
Grocy.Api.Get('objects/products?query[]=name=' + input,
|
||||||
|
@ -61,6 +61,7 @@
|
|||||||
@php if($mode == 'edit') { $productId = $listItem->product_id; } else { $productId = ''; } @endphp
|
@php if($mode == 'edit') { $productId = $listItem->product_id; } else { $productId = ''; } @endphp
|
||||||
@include('components.productpicker', array(
|
@include('components.productpicker', array(
|
||||||
'products' => $products,
|
'products' => $products,
|
||||||
|
'barcodes' => $barcodes,
|
||||||
'nextInputSelector' => '#amount',
|
'nextInputSelector' => '#amount',
|
||||||
'isRequired' => true,
|
'isRequired' => true,
|
||||||
'prefillById' => $productId,
|
'prefillById' => $productId,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user