Fixed product barcode scanning on the recipe ingredient edit page (fixes #2572)

This commit is contained in:
Bernd Bestel
2024-08-24 18:22:39 +02:00
parent d5dacb1053
commit 4f6075d8c5
3 changed files with 4 additions and 0 deletions

View File

@@ -26,6 +26,7 @@
- When self producing a product ("Produces product" recipe option) the name of the recipe is now added to the note field of the created stock entry - When self producing a product ("Produces product" recipe option) the name of the recipe is now added to the note field of the created stock entry
- Fixed that when `FEATURE_FLAG_STOCK_STOCK` was set to `false`, the "Put missing products on shopping list"-button was not visible - Fixed that when `FEATURE_FLAG_STOCK_STOCK` was set to `false`, the "Put missing products on shopping list"-button was not visible
- Fixed that scanning a product barcode on the recipe ingredient edit page didn't work
### Meal plan ### Meal plan

View File

@@ -182,6 +182,7 @@ class RecipesController extends BaseController
'recipe' => $this->getDatabase()->recipes($args['recipeId']), 'recipe' => $this->getDatabase()->recipes($args['recipeId']),
'recipePos' => new \stdClass(), 'recipePos' => new \stdClass(),
'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(),
'quantityUnits' => $this->getDatabase()->quantity_units()->orderBy('name', 'COLLATE NOCASE'), 'quantityUnits' => $this->getDatabase()->quantity_units()->orderBy('name', 'COLLATE NOCASE'),
'quantityUnitConversionsResolved' => $this->getDatabase()->cache__quantity_unit_conversions_resolved() 'quantityUnitConversionsResolved' => $this->getDatabase()->cache__quantity_unit_conversions_resolved()
]); ]);
@@ -193,6 +194,7 @@ class RecipesController extends BaseController
'recipe' => $this->getDatabase()->recipes($args['recipeId']), 'recipe' => $this->getDatabase()->recipes($args['recipeId']),
'recipePos' => $this->getDatabase()->recipes_pos($args['recipePosId']), 'recipePos' => $this->getDatabase()->recipes_pos($args['recipePosId']),
'products' => $this->getDatabase()->products()->orderBy('name', 'COLLATE NOCASE'), 'products' => $this->getDatabase()->products()->orderBy('name', 'COLLATE NOCASE'),
'barcodes' => $this->getDatabase()->product_barcodes_comma_separated(),
'quantityUnits' => $this->getDatabase()->quantity_units()->orderBy('name', 'COLLATE NOCASE'), 'quantityUnits' => $this->getDatabase()->quantity_units()->orderBy('name', 'COLLATE NOCASE'),
'quantityUnitConversionsResolved' => $this->getDatabase()->cache__quantity_unit_conversions_resolved() 'quantityUnitConversionsResolved' => $this->getDatabase()->cache__quantity_unit_conversions_resolved()
]); ]);

View File

@@ -45,6 +45,7 @@
@include('components.productpicker', array( @include('components.productpicker', array(
'products' => $products, 'products' => $products,
'barcodes' => $barcodes,
'nextInputSelector' => '#amount' 'nextInputSelector' => '#amount'
)) ))