Skip to content

Commit

Permalink
Fix : use getentity for stock sharing
Browse files Browse the repository at this point in the history
  • Loading branch information
atm-maxime committed Apr 18, 2015
1 parent 25a9966 commit bcf9e7f
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions htdocs/product/stock/index.php
Expand Up @@ -64,7 +64,7 @@
$sql = "SELECT e.label, e.rowid, e.statut";
$sql.= " FROM ".MAIN_DB_PREFIX."entrepot as e";
$sql.= " WHERE e.statut in (0,1)";
$sql.= " AND e.entity = ".$conf->entity;
$sql.= " AND e.entity IN (".getEntity('stock', 1).")";
$sql.= $db->order('e.statut','DESC');
$sql.= $db->plimit(15, 0);

Expand Down Expand Up @@ -119,7 +119,7 @@
$sql.= ", ".MAIN_DB_PREFIX."product as p";
$sql.= " WHERE m.fk_product = p.rowid";
$sql.= " AND m.fk_entrepot = e.rowid";
$sql.= " AND e.entity = ".$conf->entity;
$sql.= " AND e.entity IN (".getEntity('stock', 1).")";
if (empty($conf->global->STOCK_SUPPORTS_SERVICES)) $sql.= " AND p.fk_product_type = 0";
$sql.= $db->order("datem","DESC");
$sql.= $db->plimit($max,0);
Expand Down
2 changes: 1 addition & 1 deletion htdocs/product/stock/list.php
Expand Up @@ -58,7 +58,7 @@
$sql.= " FROM ".MAIN_DB_PREFIX."entrepot as e";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."product_stock as ps ON e.rowid = ps.fk_entrepot";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."product as p ON ps.fk_product = p.rowid";
$sql.= " WHERE e.entity = ".$conf->entity;
$sql.= " WHERE e.entity IN (".getEntity('stock', 1).")";
if ($sref)
{
$sql.= " AND e.label LIKE '%".$db->escape($sref)."%'";
Expand Down
2 changes: 1 addition & 1 deletion htdocs/product/stock/mouvement.php
Expand Up @@ -133,7 +133,7 @@
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."user as u ON m.fk_user_author = u.rowid";
$sql.= " WHERE m.fk_product = p.rowid";
$sql.= " AND m.fk_entrepot = e.rowid";
$sql.= " AND e.entity = ".$conf->entity;
$sql.= " AND e.entity IN (".getEntity('stock', 1).")";
if (empty($conf->global->STOCK_SUPPORTS_SERVICES)) $sql.= " AND p.fk_product_type = 0";
if ($id)
{
Expand Down
2 changes: 1 addition & 1 deletion htdocs/product/stock/product.php
Expand Up @@ -849,7 +849,7 @@ function init_price()
$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";

Expand Down
2 changes: 1 addition & 1 deletion htdocs/product/stock/valo.php
Expand Up @@ -56,7 +56,7 @@
$sql.= " FROM ".MAIN_DB_PREFIX."entrepot as e";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."product_stock as ps ON e.rowid = ps.fk_entrepot";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."product as p ON ps.fk_product = p.rowid";
$sql.= " WHERE e.entity = ".$conf->entity;
$sql.= " WHERE e.entity IN (".getEntity('stock', 1).")";
if ($sref)
{
$sql.= " AND e.label LIKE '%".$db->escape($sref)."%'";
Expand Down

0 comments on commit bcf9e7f

Please sign in to comment.