mirror of
https://github.com/grocy/grocy.git
synced 2025-08-28 17:10:11 +00:00
Respect QU purchase factor when adding or comparing recipe ingredients to shopping list entries (fixes #131)
This commit is contained in:
@@ -35,7 +35,9 @@ class RecipesService extends BaseService
|
||||
{
|
||||
if($recipePosition->recipe_id == $recipeId)
|
||||
{
|
||||
$toOrderAmount = $recipePosition->missing_amount - $recipePosition->amount_on_shopping_list;
|
||||
$product = $this->Database->products($recipePosition->product_id);
|
||||
|
||||
$toOrderAmount = ceil(($recipePosition->missing_amount - $recipePosition->amount_on_shopping_list) / $product->qu_factor_purchase_to_stock);
|
||||
if($toOrderAmount > 0)
|
||||
{
|
||||
$shoppinglistRow = $this->Database->shopping_list()->createRow(array(
|
||||
|
Reference in New Issue
Block a user