diff --git a/htdocs/expedition/expedition.class.php b/htdocs/expedition/expedition.class.php index 3c91eb9bb51..9de805c4cb3 100644 --- a/htdocs/expedition/expedition.class.php +++ b/htdocs/expedition/expedition.class.php @@ -230,7 +230,7 @@ class Expedition extends CommonObject $this->lignes = array(); // TODO Supprimer cette partie. L'appelant qui fetch doit // en fait appeler fetch_lignes pour charges ceci. - $sql = "SELECT c.description, c.qty as qtycom, c.fk_product, c.label, "; + $sql = "SELECT c.description, c.qty as qtycom, c.fk_product, p.label, "; $sql.= " e.qty as qtyexp, e.fk_commande_ligne,"; $sql.= " p.ref"; $sql.= " FROM ".MAIN_DB_PREFIX."expeditiondet as e"; @@ -239,7 +239,7 @@ class Expedition extends CommonObject $sql.= " WHERE e.fk_expedition = ".$this->id; $sql.= " AND e.fk_commande_ligne = c.rowid"; $sql.= " AND c.fk_product = p.rowid"; - + $resultp = $this->db->query($sql); if ($resultp) @@ -281,7 +281,7 @@ class Expedition extends CommonObject else { $this->error=$this->db->error(); - return -1; + return -2; } } diff --git a/htdocs/livraison/livraison.class.php b/htdocs/livraison/livraison.class.php index 0ace564b184..945a78d51f1 100644 --- a/htdocs/livraison/livraison.class.php +++ b/htdocs/livraison/livraison.class.php @@ -409,9 +409,10 @@ class Livraison extends CommonObject $expedition = new Expedition($this->db); $result=$expedition->fetch($sending_id); - $this->lines = array(); + $this->lignes = array(); $this->date_livraison = time(); $this->expedition_id = $sending_id; + for ($i = 0 ; $i < sizeof($expedition->lignes) ; $i++) { $LivraisonLigne = new LivraisonLigne($this->db); @@ -555,7 +556,7 @@ class Livraison extends CommonObject { $this->lignes = array(); - $sql = "SELECT c.label, c.description, c.qty as qtycom, l.qty as qtyliv"; + $sql = "SELECT p.label, c.description, c.qty as qtycom, l.qty as qtyliv"; $sql .= ", c.fk_product, c.price, p.ref"; $sql .= " FROM ".MAIN_DB_PREFIX."livraisondet as l"; $sql .= " , ".MAIN_DB_PREFIX."commandedet as c"; @@ -599,6 +600,20 @@ class Livraison extends CommonObject class LivraisonLigne { + var $db; + + // From llx_expeditiondet + var $qty; + var $fk_product; + var $commande_ligne_id; + var $libelle; // Label produit + var $description; // Description produit + var $ref; + + function LivraisonLigne($DB) + { + $this->db=$DB; + } }