From cd6c1c4546293e32d0da2dc4b45432469e45eb77 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Wed, 31 May 2006 16:02:14 +0000 Subject: [PATCH] bugfix --- htdocs/expedition/expedition.class.php | 19 ++++++++++--------- htdocs/livraison/livraison.class.php | 2 +- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/htdocs/expedition/expedition.class.php b/htdocs/expedition/expedition.class.php index e6c5048dcce..5fc2f9aa3e7 100644 --- a/htdocs/expedition/expedition.class.php +++ b/htdocs/expedition/expedition.class.php @@ -222,7 +222,7 @@ class Expedition // ligne de produit associée à une expédition $this->lignes = array(); - $sql = "SELECT c.description, c.qty as qtycom, e.qty as qtyexp"; + $sql = "SELECT c.description, c.qty as qtycom, e.qty as qtyexp, e.fk_commande_ligne"; $sql .= ", c.fk_product, c.label, p.ref"; $sql .= " FROM ".MAIN_DB_PREFIX."expeditiondet as e"; $sql .= " , ".MAIN_DB_PREFIX."commandedet as c"; @@ -240,18 +240,19 @@ class Expedition while ($i < $num) { - $objp = $this->db->fetch_object($resultp); + $objp = $this->db->fetch_object($resultp); - $ligne = new ExpeditionLigne(); + $ligne = new ExpeditionLigne(); - $ligne->product_desc = $objp->description; // Description ligne - $ligne->qty_commande = $objp->qtycom; - $ligne->product_id = $objp->fk_product; + $ligne->commande_ligne_id = $objp->fk_commande_ligne; + $ligne->product_desc = $objp->description; // Description ligne + $ligne->qty_commande = $objp->qtycom; + $ligne->product_id = $objp->fk_product; - $ligne->libelle = $objp->label; // Label produit - $ligne->ref = $objp->ref; + $ligne->libelle = $objp->label; // Label produit + $ligne->ref = $objp->ref; - $this->lignes[$i] = $ligne; + $this->lignes[$i] = $ligne; $i++; } $this->db->free($resultp); diff --git a/htdocs/livraison/livraison.class.php b/htdocs/livraison/livraison.class.php index c0eac0e96aa..cf8d6c535d8 100644 --- a/htdocs/livraison/livraison.class.php +++ b/htdocs/livraison/livraison.class.php @@ -109,7 +109,7 @@ class Livraison for ($i = 0 ; $i < sizeof($lignes) ; $i++) { //TODO - if (! $this->create_line(0, $lignes[$i]->commande_ligne_id, $lignes[$i]->qty)) + if (! $this->create_line(0, $this->lignes[$i]->commande_ligne_id, $this->lignes[$i]->qty)) { $error++; }