From 4962c51fae3f7b7e0dc29f61176d9d7ca12b49f9 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur <eldy@users.sourceforge.net> Date: Sat, 13 Aug 2005 23:14:42 +0000 Subject: [PATCH] =?UTF-8?q?Le=20descriptif=20de=20ligne=20de=20propal=20es?= =?UTF-8?q?t=20propag=E9=20=E0=20la=20facture=20cr=E9=E9e.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- htdocs/propal.class.php | 79 +++++++++++++++++++++-------------------- 1 file changed, 41 insertions(+), 38 deletions(-) diff --git a/htdocs/propal.class.php b/htdocs/propal.class.php index b82da67ac42..162904f53a2 100644 --- a/htdocs/propal.class.php +++ b/htdocs/propal.class.php @@ -486,47 +486,50 @@ class Propal $this->ref_url = '<a href="'.DOL_URL_ROOT.'/comm/propal.php?propalid='.$this->id.'">'.$this->ref.'</a>'; /* - * Lignes produits + * Lignes propales li�es � un produit */ - - $sql = "SELECT p.rowid, p.label, p.description, p.ref, d.price, d.tva_tx, d.qty, d.remise_percent, d.subprice"; - $sql .= " FROM ".MAIN_DB_PREFIX."propaldet as d, ".MAIN_DB_PREFIX."product as p"; - $sql .= " WHERE d.fk_propal = ".$this->id ." AND d.fk_product = p.rowid ORDER by d.rowid ASC"; - - $result = $this->db->query($sql); - if ($result) - { - $num = $this->db->num_rows($result); - $i = 0; - - while ($i < $num) - { - $objp = $this->db->fetch_object($result); - - $ligne = new PropaleLigne(); - $ligne->libelle = stripslashes($objp->label); - $ligne->desc = stripslashes($objp->description); - $ligne->qty = $objp->qty; - $ligne->ref = $objp->ref; - $ligne->tva_tx = $objp->tva_tx; - $ligne->subprice = $objp->subprice; - $ligne->remise_percent = $objp->remise_percent; - $ligne->price = $objp->price; - $ligne->product_id = $objp->rowid; - - $this->lignes[$i] = $ligne; - $i++; - } - $this->db->free($result); - } - else - { - dolibarr_syslog("Propal::Fetch Erreur lecture des produits"); - return -1; - } + $sql = "SELECT d.description, p.rowid, p.label, p.description as product_desc, p.ref, d.price, d.tva_tx, d.qty, d.remise_percent, d.subprice"; + $sql .= " FROM ".MAIN_DB_PREFIX."propaldet as d, ".MAIN_DB_PREFIX."product as p"; + $sql .= " WHERE d.fk_propal = ".$this->id ." AND d.fk_product = p.rowid"; + $sql .= " ORDER by d.rowid ASC"; + + $result = $this->db->query($sql); + if ($result) + { + $num = $this->db->num_rows($result); + $i = 0; + + while ($i < $num) + { + $objp = $this->db->fetch_object($result); + + $ligne = new PropaleLigne(); + $ligne->desc = stripslashes($objp->description); // Description ligne + $ligne->libelle = stripslashes($objp->label); // Label produit + $ligne->product_desc = stripslashes($objp->product_desc); // Description produit + $ligne->qty = $objp->qty; + $ligne->ref = $objp->ref; + $ligne->tva_tx = $objp->tva_tx; + $ligne->subprice = $objp->subprice; + $ligne->remise_percent = $objp->remise_percent; + $ligne->price = $objp->price; + $ligne->product_id = $objp->rowid; + + $this->lignes[$i] = $ligne; + //dolibarr_syslog("1 ".$ligne->desc); + //dolibarr_syslog("2 ".$ligne->product_desc); + $i++; + } + $this->db->free($result); + } + else + { + dolibarr_syslog("Propal::Fetch Erreur lecture des produits"); + return -1; + } /* - * Lignes propales + * Lignes propales li�es � aucun produit */ $sql = "SELECT d.qty, d.description, d.price, d.subprice, d.tva_tx, d.rowid, d.remise_percent"; $sql .= " FROM ".MAIN_DB_PREFIX."propaldet as d"; -- GitLab