fix : syntaxe sql (stock) pouvait provoquer bogue selon contexte
This commit is contained in:
parent
11d2e5c12f
commit
a6c7c04654
@ -540,7 +540,7 @@ class Product
|
|||||||
$sql = "SELECT rowid, ref, label, description, note, price, tva_tx, envente,";
|
$sql = "SELECT rowid, ref, label, description, note, price, tva_tx, envente,";
|
||||||
$sql.= " nbvente, fk_product_type, duration, seuil_stock_alerte";
|
$sql.= " nbvente, fk_product_type, duration, seuil_stock_alerte";
|
||||||
$sql.= " FROM ".MAIN_DB_PREFIX."product";
|
$sql.= " FROM ".MAIN_DB_PREFIX."product";
|
||||||
if ($id) $sql.= " WHERE rowid = ".$id;
|
if ($id) $sql.= " WHERE rowid = '".$id."'";
|
||||||
if ($ref) $sql.= " WHERE ref = '".addslashes($ref)."'";
|
if ($ref) $sql.= " WHERE ref = '".addslashes($ref)."'";
|
||||||
|
|
||||||
$result = $this->db->query($sql) ;
|
$result = $this->db->query($sql) ;
|
||||||
@ -603,8 +603,8 @@ class Product
|
|||||||
$sql= "SELECT price, tva_tx, envente ";
|
$sql= "SELECT price, tva_tx, envente ";
|
||||||
$sql.= "FROM ".MAIN_DB_PREFIX."product_price ";
|
$sql.= "FROM ".MAIN_DB_PREFIX."product_price ";
|
||||||
$sql.= "where price_level=".$i." and ";
|
$sql.= "where price_level=".$i." and ";
|
||||||
if ($id) $sql.= "fk_product = ".$id." ";
|
if ($id) $sql.= "fk_product = '".$id."' ";
|
||||||
if ($ref) $sql.= "fk_product = ".$prodid." ";
|
if ($ref) $sql.= "fk_product = '".$prodid."' ";
|
||||||
$sql.= "order by date_price DESC limit 1";
|
$sql.= "order by date_price DESC limit 1";
|
||||||
$result = $this->db->query($sql) ;
|
$result = $this->db->query($sql) ;
|
||||||
if ( $result )
|
if ( $result )
|
||||||
@ -626,7 +626,7 @@ class Product
|
|||||||
|
|
||||||
|
|
||||||
$sql = "SELECT reel, fk_entrepot";
|
$sql = "SELECT reel, fk_entrepot";
|
||||||
$sql .= " FROM ".MAIN_DB_PREFIX."product_stock WHERE fk_product = ".$this->id;
|
$sql .= " FROM ".MAIN_DB_PREFIX."product_stock WHERE fk_product = '".$this->id."'";
|
||||||
$result = $this->db->query($sql) ;
|
$result = $this->db->query($sql) ;
|
||||||
if ($result)
|
if ($result)
|
||||||
{
|
{
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user