From 4d5bbcf2101d036d2914c0172fd7700a07a3800f Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Wed, 31 May 2006 08:17:35 +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/livraison/livraison.class.php | 25 +++++++------------------ 1 file changed, 7 insertions(+), 18 deletions(-) diff --git a/htdocs/livraison/livraison.class.php b/htdocs/livraison/livraison.class.php index c2f01092848..c66c2a7bd0c 100644 --- a/htdocs/livraison/livraison.class.php +++ b/htdocs/livraison/livraison.class.php @@ -94,30 +94,19 @@ class Livraison $sql = "UPDATE ".MAIN_DB_PREFIX."livraison SET ref='(PROV".$this->id.")' WHERE rowid=".$this->id; if ($this->db->query($sql)) { - - /* //test - if ($conf->expedition->enabled) - { - $this->expedition = new Expedition($this->db); - $this->expedition->id = $this->expedition_id; - $this->expedition->fetch_lignes(); - } - else - */ - if (!$conf->expedition->enabled) - { - $this->commande = new Commande($this->db); - $this->commande->id = $this->commande_id; - $this->commande->fetch_lignes(); - } + + $commande = new Commande($this->db); + $commande->id = $this->commande_id; + $lignes = $commande->fetch_lignes(); + /* * Insertion des produits dans la base */ - for ($i = 0 ; $i < sizeof($this->lignes) ; $i++) + for ($i = 0 ; $i < sizeof($lignes) ; $i++) { //TODO - if (! $this->create_line(0, $this->lignes[$i]->commande_ligne_id, $this->lignes[$i]->qty)) + if (! $this->create_line(0, $lignes[$i]->id, $lignes[$i]->qty)) { $error++; }