From 974a10e1cc624d2b9b37d22fa6fa27ef045c76d9 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Thu, 30 Apr 2009 16:44:31 +0000 Subject: [PATCH] New: early development of multi-company module --- htdocs/expedition/index.php | 3 ++- htdocs/livraison/livraison.class.php | 6 +++--- 2 files changed, 5 insertions(+), 4 deletions(-) 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);