diff --git a/htdocs/expedition/index.php b/htdocs/expedition/index.php index d93027310b9..c5e32ac9630 100644 --- a/htdocs/expedition/index.php +++ b/htdocs/expedition/index.php @@ -68,7 +68,8 @@ if (!$user->rights->societe->client->voir && !$socid) $clause = " AND "; } $sql.= $clause." e.fk_statut = 0"; -$sql.= " AND e.entity = ".$conf->entity; +$sql.= " AND (e.entity = ".$conf->entity; +$sql.= " AND s.entity = ".$conf->entity.")"; if ($socid) $sql.= " AND c.fk_soc = ".$socid; $resql=$db->query($sql); diff --git a/htdocs/livraison/livraison.class.php b/htdocs/livraison/livraison.class.php index c4a94e48532..192dcea1b0b 100644 --- a/htdocs/livraison/livraison.class.php +++ b/htdocs/livraison/livraison.class.php @@ -87,7 +87,6 @@ class Livraison extends CommonObject $this->brouillon = 1; $this->user = $user; - if ($this->expedition_id) $expedition_id $this->db->begin(); @@ -116,9 +115,10 @@ class Livraison extends CommonObject { $this->id = $this->db->last_insert_id(MAIN_DB_PREFIX."livraison"); - $numref="(PROV".$this->id.")"; + $numref = "(PROV".$this->id.")"; + $sql = "UPDATE ".MAIN_DB_PREFIX."livraison "; - $sql.= "SET ref = '".addslashes($numref); + $sql.= "SET ref = '".addslashes($numref)."'"; $sql.= " WHERE rowid = ".$this->id; dol_syslog("Livraison::create sql=".$sql, LOG_DEBUG);