mirror of
https://github.com/grocy/grocy.git
synced 2025-08-20 12:20:22 +00:00
Fixed recipe consume stock fulfillment checking (frontend and API) (fixes #1781)
This commit is contained in:
@@ -74,6 +74,12 @@ class RecipesService extends BaseService
|
||||
throw new \Exception('Recipe does not exist');
|
||||
}
|
||||
|
||||
$recipeResolved = $this->getDatabase()->recipes_resolved()->where('recipe_id', $recipeId)->fetch();
|
||||
if ($recipeResolved->need_fulfilled == 0)
|
||||
{
|
||||
throw new \Exception('Recipe need is not fulfilled, consuming not possible');
|
||||
}
|
||||
|
||||
$transactionId = uniqid();
|
||||
|
||||
$recipePositions = $this->getDatabase()->recipes_pos_resolved()->where('recipe_id', $recipeId)->fetchAll();
|
||||
|
Reference in New Issue
Block a user