diff --git a/controllers/RecipesController.php b/controllers/RecipesController.php index 5d63454a..8b319e15 100644 --- a/controllers/RecipesController.php +++ b/controllers/RecipesController.php @@ -169,7 +169,7 @@ class RecipesController extends BaseController 'recipes' => $recipes, 'internalRecipes' => $this->Database->recipes()->whereNot('type', RecipesService::RECIPE_TYPE_NORMAL)->fetchAll(), 'recipesResolved' => $this->RecipesService->GetRecipesResolved(), - 'products' => $this->Database->products()->orderBy('name'), + 'products' => $this->Database->products()->where('include_in_mealplan', '1')->orderBy('name'), 'quantityUnits' => $this->Database->quantity_units()->orderBy('name'), 'quantityUnitConversionsResolved' => $this->Database->quantity_unit_conversions_resolved() ]); diff --git a/migrations/0097.sql b/migrations/0097.sql index 269911ef..f3010f54 100644 --- a/migrations/0097.sql +++ b/migrations/0097.sql @@ -1,3 +1,6 @@ +ALTER TABLE products +ADD include_in_mealplan TINYINT NOT NULL DEFAULT 0; + ALTER TABLE products ADD default_best_before_days_after_freezing INTEGER NOT NULL DEFAULT 0; diff --git a/views/productform.blade.php b/views/productform.blade.php index 8b74dd29..c757609e 100644 --- a/views/productform.blade.php +++ b/views/productform.blade.php @@ -252,6 +252,16 @@ @endif +
+
+ + include_in_mealplan == 1) checked @endif class="form-check-input" type="checkbox" id="include_in_mealplan" name="include_in_mealplan" value="1"> + +
+
+