Add an option per recipe to not check against the shopping list when adding missing recipe ingredients, only against stock (closes #154)

This commit is contained in:
Bernd Bestel
2019-03-03 15:23:39 +01:00
parent 5b544f76a5
commit 8c11d0f15d
3 changed files with 74 additions and 0 deletions

View File

@@ -38,6 +38,11 @@ class RecipesService extends BaseService
$product = $this->Database->products($recipePosition->product_id);
$toOrderAmount = ceil(($recipePosition->missing_amount - $recipePosition->amount_on_shopping_list) / $product->qu_factor_purchase_to_stock);
if ($recipe->not_check_shoppinglist == 1)
{
$toOrderAmount = ceil($recipePosition->missing_amount / $product->qu_factor_purchase_to_stock);
}
if($toOrderAmount > 0)
{
$shoppinglistRow = $this->Database->shopping_list()->createRow(array(