mirror of
https://github.com/grocy/grocy.git
synced 2025-08-20 12:20:22 +00:00
This commit is contained in:
@@ -68,7 +68,7 @@ class RecipesService extends BaseService
|
||||
{
|
||||
if ($recipePosition->only_check_single_unit_in_stock == 0)
|
||||
{
|
||||
$this->StockService->ConsumeProduct($recipePosition->product_id, $recipePosition->amount, false, StockService::TRANSACTION_TYPE_CONSUME);
|
||||
$this->StockService->ConsumeProduct($recipePosition->product_id, $recipePosition->amount, false, StockService::TRANSACTION_TYPE_CONSUME, 'default', $recipeId);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -165,7 +165,7 @@ class StockService extends BaseService
|
||||
}
|
||||
}
|
||||
|
||||
public function ConsumeProduct(int $productId, float $amount, bool $spoiled, $transactionType, $specificStockEntryId = 'default')
|
||||
public function ConsumeProduct(int $productId, float $amount, bool $spoiled, $transactionType, $specificStockEntryId = 'default', $recipeId = null)
|
||||
{
|
||||
if (!$this->ProductExists($productId))
|
||||
{
|
||||
@@ -206,7 +206,8 @@ class StockService extends BaseService
|
||||
'stock_id' => $stockEntry->stock_id,
|
||||
'transaction_type' => $transactionType,
|
||||
'price' => $stockEntry->price,
|
||||
'opened_date' => $stockEntry->opened_date
|
||||
'opened_date' => $stockEntry->opened_date,
|
||||
'recipe_id' => $recipeId
|
||||
));
|
||||
$logRow->save();
|
||||
|
||||
@@ -228,7 +229,8 @@ class StockService extends BaseService
|
||||
'stock_id' => $stockEntry->stock_id,
|
||||
'transaction_type' => $transactionType,
|
||||
'price' => $stockEntry->price,
|
||||
'opened_date' => $stockEntry->opened_date
|
||||
'opened_date' => $stockEntry->opened_date,
|
||||
'recipe_id' => $recipeId
|
||||
));
|
||||
$logRow->save();
|
||||
|
||||
|
Reference in New Issue
Block a user