Fix this also for transferring a product

This commit is contained in:
Bernd Bestel 2021-08-19 19:43:36 +02:00
parent cf0162cb54
commit 2e8977811f
No known key found for this signature in database
GPG Key ID: 71BD34C0D4891300

View File

@ -817,6 +817,18 @@ class StockApiController extends BaseApiController
try
{
$args['productId'] = $this->getStockService()->GetProductIdFromBarcode($args['barcode']);
if (Grocycode::Validate($args['barcode']))
{
$gc = new Grocycode($args['barcode']);
if ($gc->GetExtraData())
{
$requestBody = $request->getParsedBody();
$requestBody['stock_entry_id'] = $gc->GetExtraData()[0];
$request = $request->withParsedBody($requestBody);
}
}
return $this->TransferProduct($request, $response, $args);
}
catch (\Exception $ex)