From de85cb9e04ec183fab5a9d20c63248707e998851 Mon Sep 17 00:00:00 2001 From: kriddles <54413450+kriddles@users.noreply.github.com> Date: Sat, 31 Oct 2020 10:25:33 -0500 Subject: [PATCH] limit to normal recipes (#1111) --- controllers/StockController.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/controllers/StockController.php b/controllers/StockController.php index 07909e65..2acb0f19 100644 --- a/controllers/StockController.php +++ b/controllers/StockController.php @@ -2,6 +2,8 @@ namespace Grocy\Controllers; +use Grocy\Services\RecipesService; + class StockController extends BaseController { public function Consume(\Psr\Http\Message\ServerRequestInterface $request, \Psr\Http\Message\ResponseInterface $response, array $args) @@ -12,7 +14,7 @@ class StockController extends BaseController return $this->renderPage($response, 'consume', [ 'products' => $this->getDatabase()->products()->where('active = 1')->orderBy('name'), 'barcodes' => $productBarcodes, - 'recipes' => $this->getDatabase()->recipes()->orderBy('name'), + 'recipes' => $this->getDatabase()->recipes()->where('type', RecipesService::RECIPE_TYPE_NORMAL)->orderBy('name'), 'locations' => $this->getDatabase()->locations()->orderBy('name') ]); } @@ -431,7 +433,6 @@ class StockController extends BaseController return $this->renderPage($response, 'transfer', [ 'products' => $this->getDatabase()->products()->where('active = 1')->orderBy('name'), 'barcodes' => $productBarcodes, - 'recipes' => $this->getDatabase()->recipes()->orderBy('name'), 'locations' => $this->getDatabase()->locations()->orderBy('name') ]); }