Print stock entry labels also on inventory when adding products (closes #1713)

This commit is contained in:
Bernd Bestel
2021-12-09 18:32:59 +01:00
parent 3e20c2cc3d
commit a711bbd8f6
6 changed files with 94 additions and 5 deletions

View File

@@ -495,7 +495,13 @@ class StockApiController extends BaseApiController
$shoppingLocationId = $requestBody['shopping_location_id'];
}
$transactionId = $this->getStockService()->InventoryProduct($args['productId'], $requestBody['new_amount'], $bestBeforeDate, $locationId, $price, $shoppingLocationId, $purchasedDate);
$stockLabelType = 0;
if (array_key_exists('stock_label_type', $requestBody) && is_numeric($requestBody['stock_label_type']))
{
$stockLabelType = intval($requestBody['stock_label_type']);
}
$transactionId = $this->getStockService()->InventoryProduct($args['productId'], $requestBody['new_amount'], $bestBeforeDate, $locationId, $price, $shoppingLocationId, $purchasedDate, $stockLabelType);
$args['transactionId'] = $transactionId;
return $this->StockTransactions($request, $response, $args);
}