From 2f8968478d9260f9385ec1f866edd3a6447ed33b Mon Sep 17 00:00:00 2001 From: florian HENRY Date: Sun, 12 Jul 2020 10:06:04 +0200 Subject: [PATCH 1/3] fix missing entity into fetch wahrehouse --- htdocs/product/stock/class/entrepot.class.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/htdocs/product/stock/class/entrepot.class.php b/htdocs/product/stock/class/entrepot.class.php index 0b259018cfc..39fad14c544 100644 --- a/htdocs/product/stock/class/entrepot.class.php +++ b/htdocs/product/stock/class/entrepot.class.php @@ -441,6 +441,7 @@ class Entrepot extends CommonObject } $sql = "SELECT rowid, fk_parent, ref as label, description, statut, lieu, address, zip, town, fk_pays as country_id"; + $sql .= " , entity"; $sql .= " FROM ".MAIN_DB_PREFIX."entrepot"; if ($id) { @@ -460,6 +461,7 @@ class Entrepot extends CommonObject $obj=$this->db->fetch_object($result); $this->id = $obj->rowid; + $this->entity = $obj->entity; $this->fk_parent = $obj->fk_parent; $this->ref = $obj->label; $this->label = $obj->label; From 7b5072a21b49fd4816f8cae72924e29743ae5dfd Mon Sep 17 00:00:00 2001 From: florian HENRY Date: Sun, 12 Jul 2020 10:10:46 +0200 Subject: [PATCH 2/3] fix missing entity --- htdocs/product/stock/class/entrepot.class.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/product/stock/class/entrepot.class.php b/htdocs/product/stock/class/entrepot.class.php index 39fad14c544..f5500812290 100644 --- a/htdocs/product/stock/class/entrepot.class.php +++ b/htdocs/product/stock/class/entrepot.class.php @@ -104,6 +104,7 @@ class Entrepot extends CommonObject */ public $fields=array( 'rowid' =>array('type'=>'integer', 'label'=>'ID', 'enabled'=>1, 'visible'=>0, 'notnull'=>1, 'position'=>10), + 'entity' =>array('type'=>'integer', 'label'=>'Entity', 'enabled'=>1, 'visible'=>0, 'default'=>1, 'notnull'=>1, 'index'=>1, 'position'=>15), 'ref' =>array('type'=>'varchar(255)', 'label'=>'Ref', 'enabled'=>1, 'visible'=>1, 'showoncombobox'=>1, 'position'=>25), 'entity' =>array('type'=>'integer', 'label'=>'Entity', 'enabled'=>1, 'visible'=>0, 'notnull'=>1, 'position'=>30), 'description' =>array('type'=>'text', 'label'=>'Description', 'enabled'=>1, 'visible'=>-2, 'position'=>35), From 32e4635e84203596db9ebcef85ef78863644e88a Mon Sep 17 00:00:00 2001 From: florian HENRY Date: Sun, 12 Jul 2020 21:34:13 +0200 Subject: [PATCH 3/3] fix missing entity into fetch wharehouse --- htdocs/product/stock/list.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/product/stock/list.php b/htdocs/product/stock/list.php index 057735c49cc..9baaeebf90e 100644 --- a/htdocs/product/stock/list.php +++ b/htdocs/product/stock/list.php @@ -209,7 +209,7 @@ $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_country as ccount ON ccount.rowid = t.fk $sql .= " WHERE t.entity IN (".getEntity('stock').")"; foreach ($search as $key => $val) { - if ($key == 'status' && $search[$key] == -1) continue; + if (($key == 'status' && $search[$key] == -1) || $key=='entity') continue; $mode_search = (($object->isInt($object->fields[$key]) || $object->isFloat($object->fields[$key])) ? 1 : 0); if (strpos($object->fields[$key]['type'], 'integer:') === 0) { if ($search[$key] == '-1') $search[$key] = '';