diff --git a/htdocs/livraison/livraison.class.php b/htdocs/livraison/livraison.class.php index b32373bc52c..18eadca188f 100644 --- a/htdocs/livraison/livraison.class.php +++ b/htdocs/livraison/livraison.class.php @@ -74,11 +74,11 @@ class Livraison $this->db->begin(); - $sql = "INSERT INTO ".MAIN_DB_PREFIX."livraison (fk_soc, fk_soc_contact, date_creation, fk_user_author, fk_commande"; + $sql = "INSERT INTO ".MAIN_DB_PREFIX."livraison (date_creation, fk_user_author"; if ($this->commande_id) $sql.= ", fk_commande"; if ($this->expedition_id) $sql.= ", fk_expedition"; $sql.= ")"; - $sql.= " VALUES ($this->soc_id, $this->contactid, now(), $user->id, $this->commande_id"; + $sql.= " VALUES (now(), $user->id, $this->commande_id"; if ($this->commande_id) $sql.= ", $this->commande_id"; if ($this->expedition_id) $sql.= ", $this->expedition_id"; $sql.= ")"; @@ -197,7 +197,7 @@ class Livraison { global $conf; - $sql = "SELECT l.rowid, l.fk_soc, l.fk_soc_contact, l.date_creation, l.ref, l.fk_user_author,"; + $sql = "SELECT l.rowid, l.date_creation, l.ref, l.fk_user_author,"; $sql .=" l.fk_statut, l.fk_commande, l.fk_expedition, l.fk_user_valid, l.note, l.note_public"; $sql .= ", ".$this->db->pdate("l.date_livraison")." as date_livraison, fk_adresse_livraison, model_pdf"; $sql .= " FROM ".MAIN_DB_PREFIX."livraison as l"; @@ -210,8 +210,6 @@ class Livraison $obj = $this->db->fetch_object($result); $this->id = $obj->rowid; - $this->socid = $obj->fk_soc; - $this->contact_id = $obj->fk_soc_contact; $this->ref = $obj->ref; $this->statut = $obj->fk_statut; $this->commande_id = $obj->fk_commande; diff --git a/mysql/migration/2.0.0-2.1.0.sql b/mysql/migration/2.0.0-2.1.0.sql index c010a64185c..00ffae49d54 100644 --- a/mysql/migration/2.0.0-2.1.0.sql +++ b/mysql/migration/2.0.0-2.1.0.sql @@ -209,8 +209,6 @@ create table llx_livraison ( rowid integer AUTO_INCREMENT PRIMARY KEY, tms timestamp, - fk_soc integer NOT NULL, - fk_soc_contact integer, fk_commande integer DEFAULT 0, fk_expedition integer, ref varchar(30) NOT NULL, @@ -228,6 +226,9 @@ create table llx_livraison UNIQUE INDEX (ref) )type=innodb; +alter table llx_livraison drop column fk_soc; +alter table llx_livraison drop column fk_soc_contact; + create table llx_livraisondet ( rowid integer AUTO_INCREMENT PRIMARY KEY, diff --git a/mysql/tables/llx_livraison.sql b/mysql/tables/llx_livraison.sql index 378fede61e4..900306f680a 100644 --- a/mysql/tables/llx_livraison.sql +++ b/mysql/tables/llx_livraison.sql @@ -24,8 +24,6 @@ create table llx_livraison ( rowid integer AUTO_INCREMENT PRIMARY KEY, tms timestamp, - fk_soc integer NOT NULL, - fk_soc_contact integer, fk_commande integer DEFAULT 0, -- commande auquel est rattache le bon de livraison fk_expedition integer, -- expedition auquel est rattache le bon de livraison ref varchar(30) NOT NULL, -- delivery number