Added more product actions on the stock overview page (closes #327)

This commit is contained in:
Bernd Bestel
2019-09-20 13:37:53 +02:00
parent ca9b8d068a
commit a95d6be4f4
20 changed files with 557 additions and 238 deletions

View File

@@ -448,4 +448,23 @@ class StockApiController extends BaseApiController
{
return $this->ApiResponse($this->StockService->GetProductStockEntries($args['productId']));
}
public function StockBooking(\Slim\Http\Request $request, \Slim\Http\Response $response, array $args)
{
try
{
$stockLogRow = $this->Database->stock_log($args['bookingId']);
if ($stockLogRow === null)
{
throw new \Exception('Stock booking does not exist');
}
return $this->ApiResponse($stockLogRow);
}
catch (\Exception $ex)
{
return $this->GenericErrorResponse($response, $ex->getMessage());
}
}
}