From 234a582661ff3f650c289e1a71cc149c87984f64 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Tue, 30 May 2006 15:40:05 +0000 Subject: [PATCH] =?UTF-8?q?D=E9but=20ajout=20bon=20de=20livraison?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- htdocs/expedition/expedition.class.php | 7 +++++++ htdocs/expedition/fiche.php | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/htdocs/expedition/expedition.class.php b/htdocs/expedition/expedition.class.php index e080a96c7fb..4d4485433af 100644 --- a/htdocs/expedition/expedition.class.php +++ b/htdocs/expedition/expedition.class.php @@ -191,10 +191,13 @@ class Expedition $sql = "SELECT e.rowid, e.date_creation, e.ref, e.fk_user_author, e.fk_statut, e.fk_commande, e.fk_entrepot"; $sql .= ", ".$this->db->pdate("e.date_expedition")." as date_expedition, c.fk_adresse_livraison"; + if ($conf->livraison->enabled) $sql.=", l.rowid as livraison_id"; $sql .= " FROM ".MAIN_DB_PREFIX."expedition as e"; $sql .= ", ".MAIN_DB_PREFIX."commande as c"; + if ($conf->livraison->enabled) $sql.=", ".MAIN_DB_PREFIX."livraison as l"; $sql .= " WHERE e.rowid = $id"; $sql .= " AND e.fk_commande = c.rowid"; + if ($conf->livraison->enabled) $sql.=" AND e.rowid = l.fk_expedition"; $result = $this->db->query($sql) ; @@ -206,6 +209,10 @@ class Expedition $this->ref = $obj->ref; $this->statut = $obj->fk_statut; $this->commande_id = $obj->fk_commande; + if ($conf->livraison->enabled) + { + $this->livraison_id = $obj->livraison_id; + } $this->user_author_id = $obj->fk_user_author; $this->date = $obj->date_expedition; $this->entrepot_id = $obj->fk_entrepot; diff --git a/htdocs/expedition/fiche.php b/htdocs/expedition/fiche.php index a2e55375df2..cbdb3a03336 100644 --- a/htdocs/expedition/fiche.php +++ b/htdocs/expedition/fiche.php @@ -353,7 +353,7 @@ else $hselected = $h; $h++; - if ($conf->livraison->enabled) + if ($conf->livraison->enabled && $expedition->livraison_id) { $head[$h][0] = DOL_URL_ROOT."/livraison/fiche.php?id=".$expedition->livraison_id; $head[$h][1] = $langs->trans("DeliveryCard");