Fixed shopping list QU handling (fixes #1385, fixes #1384)

This commit is contained in:
Bernd Bestel
2021-07-02 17:37:06 +02:00
parent 187d48f93d
commit cae924eb81
6 changed files with 128 additions and 9 deletions

View File

@@ -180,6 +180,7 @@ class StockApiController extends BaseApiController
$listId = 1;
$amount = 1;
$quId = -1;
$productId = null;
$note = null;
@@ -203,12 +204,17 @@ class StockApiController extends BaseApiController
$note = $requestBody['note'];
}
if (array_key_exists('qu_id', $requestBody) && !empty($requestBody['qu_id']))
{
$quId = $requestBody['qu_id'];
}
if ($productId == null)
{
throw new \Exception('No product id was supplied');
}
$this->getStockService()->AddProductToShoppingList($productId, $amount, $note, $listId);
$this->getStockService()->AddProductToShoppingList($productId, $amount, $quId, $note, $listId);
return $this->EmptyApiResponse($response);
}
catch (\Exception $ex)