diff --git a/controllers/StockApiController.php b/controllers/StockApiController.php index eede7ef1..6bae21e0 100644 --- a/controllers/StockApiController.php +++ b/controllers/StockApiController.php @@ -276,8 +276,14 @@ class StockApiController extends BaseApiController { $consumeExact = $requestBody['exact_amount']; } + $transactionId = null; + if (array_key_exists('transaction_id', $requestBody) && is_numeric($requestBody['transaction_id'])) + { + $transactionId = $requestBody['transaction_id']; + } + $bookingId = $this->getStockService()->ConsumeProduct($args['productId'], $requestBody['amount'], $spoiled, $transactionType, $specificStockEntryId, $recipeId, $locationId, $transactionId, false, $consumeExact); return $this->ApiResponse($response, $this->getDatabase()->stock_log($bookingId)); }