Le descriptif de ligne de propal est propagé à la facture créée.

This commit is contained in:
Laurent Destailleur 2005-08-13 23:14:42 +00:00
parent e7861691b8
commit 4962c51fae

View File

@ -486,12 +486,12 @@ class Propal
$this->ref_url = '<a href="'.DOL_URL_ROOT.'/comm/propal.php?propalid='.$this->id.'">'.$this->ref.'</a>'; $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 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 = "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 .= " 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"; $sql .= " WHERE d.fk_propal = ".$this->id ." AND d.fk_product = p.rowid";
$sql .= " ORDER by d.rowid ASC";
$result = $this->db->query($sql); $result = $this->db->query($sql);
if ($result) if ($result)
@ -504,8 +504,9 @@ class Propal
$objp = $this->db->fetch_object($result); $objp = $this->db->fetch_object($result);
$ligne = new PropaleLigne(); $ligne = new PropaleLigne();
$ligne->libelle = stripslashes($objp->label); $ligne->desc = stripslashes($objp->description); // Description ligne
$ligne->desc = stripslashes($objp->description); $ligne->libelle = stripslashes($objp->label); // Label produit
$ligne->product_desc = stripslashes($objp->product_desc); // Description produit
$ligne->qty = $objp->qty; $ligne->qty = $objp->qty;
$ligne->ref = $objp->ref; $ligne->ref = $objp->ref;
$ligne->tva_tx = $objp->tva_tx; $ligne->tva_tx = $objp->tva_tx;
@ -515,6 +516,8 @@ class Propal
$ligne->product_id = $objp->rowid; $ligne->product_id = $objp->rowid;
$this->lignes[$i] = $ligne; $this->lignes[$i] = $ligne;
//dolibarr_syslog("1 ".$ligne->desc);
//dolibarr_syslog("2 ".$ligne->product_desc);
$i++; $i++;
} }
$this->db->free($result); $this->db->free($result);
@ -526,7 +529,7 @@ class Propal
} }
/* /*
* 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 = "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"; $sql .= " FROM ".MAIN_DB_PREFIX."propaldet as d";