mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2026-02-07 16:41:48 +01:00
Fix: !!!! Dont't use entity if you use rowid in fetch or others !!!!
This commit is contained in:
@@ -1591,8 +1591,10 @@ class Commande extends CommonOrder
|
||||
$sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_availability as ca ON c.fk_availability = ca.rowid';
|
||||
$sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_input_reason as dr ON c.fk_input_reason = ca.rowid';
|
||||
$sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_incoterms as i ON c.fk_incoterms = i.rowid';
|
||||
$sql.= " WHERE c.entity IN (".getEntity('commande').")";
|
||||
if ($id) $sql.= " AND c.rowid=".$id;
|
||||
|
||||
if ($id) $sql.= " WHERE c.rowid=".$id;
|
||||
else $sql.= " WHERE c.entity IN (".getEntity('commande').")"; // Dont't use entity if you use rowid
|
||||
|
||||
if ($ref) $sql.= " AND c.ref='".$this->db->escape($ref)."'";
|
||||
if ($ref_ext) $sql.= " AND c.ref_ext='".$this->db->escape($ref_ext)."'";
|
||||
if ($ref_int) $sql.= " AND c.ref_int='".$this->db->escape($ref_int)."'";
|
||||
|
||||
Reference in New Issue
Block a user