Add recipe name to note of the created stock entry when self producing products (closes #2497)

This commit is contained in:
Bernd Bestel 2024-03-17 17:11:09 +01:00
parent b26dfe3fb0
commit 5167ba1154
No known key found for this signature in database
GPG Key ID: 71BD34C0D4891300
2 changed files with 2 additions and 2 deletions

View File

@ -21,7 +21,7 @@
### Recipes
- xxx
- When self producing a product ("Produces product" recipe option) the name of the recipe is now added to the note field of the created stock entry
### Meal plan

View File

@ -114,7 +114,7 @@ class RecipesService extends BaseService
{
$product = $this->getDatabase()->products()->where('id = :1', $productId)->fetch();
$recipeResolvedRow = $this->getDatabase()->recipes_resolved()->where('recipe_id = :1', $recipeId)->fetch();
$this->getStockService()->AddProduct($productId, $amount, null, StockService::TRANSACTION_TYPE_SELF_PRODUCTION, date('Y-m-d'), $recipeResolvedRow->costs_per_serving, null, null, $dummyTransactionId, $product->default_stock_label_type, true);
$this->getStockService()->AddProduct($productId, $amount, null, StockService::TRANSACTION_TYPE_SELF_PRODUCTION, date('Y-m-d'), $recipeResolvedRow->costs_per_serving, null, null, $dummyTransactionId, $product->default_stock_label_type, true, $recipe->name);
}
}