Skip to content
Snippets Groups Projects
Commit 52cb9581 authored by Florian Henry's avatar Florian Henry
Browse files

Fix multientity stock management

parent 7505537a
No related branches found
No related tags found
No related merge requests found
......@@ -72,7 +72,7 @@ class FormProduct
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."product_stock as ps on ps.fk_entrepot = e.rowid";
$sql.= " AND ps.fk_product = '".$fk_product."'";
}
$sql.= " WHERE e.entity = ".$conf->entity;
$sql.= " WHERE e.entity IN (".getEntity('stock',1).")";
$sql.= " AND e.statut = 1";
$sql.= " ORDER BY e.label";
......
......@@ -47,7 +47,7 @@ $offset = $limit * $page;
$sql = "SELECT e.rowid, e.label as ref, e.statut, e.lieu, e.address, e.zip, e.town, e.fk_pays";
$sql.= " FROM ".MAIN_DB_PREFIX."entrepot as e";
$sql.= " WHERE e.entity = ".$conf->entity;
$sql.= " WHERE e.entity IN (".getEntity('stock',1).")";
if ($sref)
{
$sql.= " AND e.label like '%".$db->escape($sref)."%'";
......
......@@ -583,7 +583,7 @@ $sql.= " FROM ".MAIN_DB_PREFIX."entrepot as e,";
$sql.= " ".MAIN_DB_PREFIX."product_stock as ps";
$sql.= " WHERE ps.reel != 0";
$sql.= " AND ps.fk_entrepot = e.rowid";
$sql.= " AND e.entity = ".$conf->entity;
$sql.= " AND e.entity IN (".getEntity('stock',1).")";
$sql.= " AND ps.fk_product = ".$product->id;
$sql.= " ORDER BY e.label";
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment