From 1e609853daefee667e05c67587eaaede72ebecdb Mon Sep 17 00:00:00 2001 From: Rodolphe Quiedeville Date: Sat, 30 Aug 2003 11:46:26 +0000 Subject: [PATCH] =?UTF-8?q?Gestion=20des=20produits=20g=E9n=E9riques?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- htdocs/propal.class.php3 | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/htdocs/propal.class.php3 b/htdocs/propal.class.php3 index ddae9dc66c0..a928a0a014a 100644 --- a/htdocs/propal.class.php3 +++ b/htdocs/propal.class.php3 @@ -92,6 +92,33 @@ class Propal * * */ + Function insert_product_generic($p_desc, $p_price, $p_qty, $p_tva_tx=19.6) + { + if ($this->statut == 0) + { + $p_price = ereg_replace(",",".",$p_price); + $sql = "INSERT INTO llx_propaldet (fk_propal, fk_product, qty, price, tva_tx, description) VALUES "; + $sql .= " (".$this->id.", 0,". $p_qty.",". $p_price.",19.6,'".$p_desc."') ; "; + + if ($this->db->query($sql) ) + { + + $this->update_price($this->id); + + return 1; + } + else + { + print $this->db->error(); + print "
".$sql; + return 0; + } + } + } + /* + * + * + */ Function fetch_client() { $client = new Societe($this->db);