mirror of
https://github.com/grocy/grocy.git
synced 2025-04-29 01:32:38 +00:00
Print stock entry labels when consuming a "Produces product" recipe (closes #2123)
This commit is contained in:
parent
9ef5045c9b
commit
0bd698c968
@ -41,6 +41,7 @@
|
||||
- Added a new entry "Add to meal plan" in the context/more menu per recipe to directly add a recipe to the meal plan from the recipes page
|
||||
- Changed that when a ingredient has a "Variable amount" set, the text entered there now also replaces the unit when displaying the recipe (not only the amount as before)
|
||||
- When displaying a recipe in fullscreen mode, the ingredients and preparation is now shown side by side (or below each other on small screens) instead of in tabs
|
||||
- When consuming a recipe which has a "Produces product" set and when the product's "Default stock entry label" is configured accordingly, the corresponding label will now be printed on that action (only server side label printer WebHooks are supported)
|
||||
- Fixed that hiding the "Requirements fulfilled" column (table options) on the recipes page didn't work
|
||||
- Fixed that ingredient costs and calories were wrong when product substitution and unit conversions were involved at the same time
|
||||
|
||||
|
@ -104,8 +104,9 @@ class RecipesService extends BaseService
|
||||
$recipeRow = $this->getDatabase()->recipes()->where('id = :1', $recipeId)->fetch();
|
||||
if (!empty($recipeRow->product_id))
|
||||
{
|
||||
$product = $this->getDatabase()->products()->where('id = :1', $recipeRow->product_id)->fetch();
|
||||
$recipeResolvedRow = $this->getDatabase()->recipes_resolved()->where('recipe_id = :1', $recipeId)->fetch();
|
||||
$this->getStockService()->AddProduct($recipeRow->product_id, floatval($recipeRow->desired_servings), null, StockService::TRANSACTION_TYPE_SELF_PRODUCTION, date('Y-m-d'), floatval($recipeResolvedRow->costs_per_serving), null, null, $dummyTransactionId, 0, true);
|
||||
$this->getStockService()->AddProduct($recipeRow->product_id, floatval($recipeRow->desired_servings), null, StockService::TRANSACTION_TYPE_SELF_PRODUCTION, date('Y-m-d'), floatval($recipeResolvedRow->costs_per_serving), null, null, $dummyTransactionId, $product->default_stock_label_type, true);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user