NEW manage virtual stock at future date
This commit is contained in:
parent
f56abb1e5f
commit
6ff002405e
@ -253,7 +253,7 @@ class Products extends DolibarrApi
|
|||||||
if (!$ids_only) {
|
if (!$ids_only) {
|
||||||
$product_static = new Product($this->db);
|
$product_static = new Product($this->db);
|
||||||
if ($product_static->fetch($obj->rowid)) {
|
if ($product_static->fetch($obj->rowid)) {
|
||||||
if ($includestockdata && DolibarrApiAccess::$user->rights->stock->lire) {
|
if (!empty($includestockdata) && DolibarrApiAccess::$user->rights->stock->lire) {
|
||||||
$product_static->load_stock();
|
$product_static->load_stock();
|
||||||
|
|
||||||
if (is_array($product_static->stock_warehouse)) {
|
if (is_array($product_static->stock_warehouse)) {
|
||||||
@ -1644,10 +1644,10 @@ class Products extends DolibarrApi
|
|||||||
$combinations[$key]->attributes = $prodc2vp->fetchByFkCombination((int) $combination->id);
|
$combinations[$key]->attributes = $prodc2vp->fetchByFkCombination((int) $combination->id);
|
||||||
$combinations[$key] = $this->_cleanObjectDatas($combinations[$key]);
|
$combinations[$key] = $this->_cleanObjectDatas($combinations[$key]);
|
||||||
|
|
||||||
if ($includestock==1 && DolibarrApiAccess::$user->rights->stock->lire) {
|
if (!empty($includestock) && DolibarrApiAccess::$user->rights->stock->lire) {
|
||||||
$productModel = new Product($this->db);
|
$productModel = new Product($this->db);
|
||||||
$productModel->fetch((int) $combination->fk_product_child);
|
$productModel->fetch((int) $combination->fk_product_child);
|
||||||
$productModel->load_stock();
|
$productModel->load_stock($includestock);
|
||||||
$combinations[$key]->stock_warehouse = $this->_cleanObjectDatas($productModel)->stock_warehouse;
|
$combinations[$key]->stock_warehouse = $this->_cleanObjectDatas($productModel)->stock_warehouse;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -2040,8 +2040,8 @@ class Products extends DolibarrApi
|
|||||||
throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login);
|
throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($includestockdata && DolibarrApiAccess::$user->rights->stock->lire) {
|
if (!empty($includestockdata) && DolibarrApiAccess::$user->rights->stock->lire) {
|
||||||
$this->product->load_stock();
|
$this->product->load_stock($includestockdata);
|
||||||
|
|
||||||
if (is_array($this->product->stock_warehouse)) {
|
if (is_array($this->product->stock_warehouse)) {
|
||||||
foreach ($this->product->stock_warehouse as $keytmp => $valtmp) {
|
foreach ($this->product->stock_warehouse as $keytmp => $valtmp) {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user