From b5841742966555a7ed9bfc13776651468397a5af Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Sun, 12 Feb 2006 19:55:29 +0000 Subject: [PATCH] bugfix --- htdocs/commande/commande.class.php | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/htdocs/commande/commande.class.php b/htdocs/commande/commande.class.php index 49ef292eab0..8a4ab9b8a42 100644 --- a/htdocs/commande/commande.class.php +++ b/htdocs/commande/commande.class.php @@ -338,9 +338,17 @@ class Commande $price = $p_price - $remise; } - $sql = 'INSERT INTO '.MAIN_DB_PREFIX.'commandedet (fk_commande, fk_product, qty, price, tva_tx, label, description, remise_percent, subprice) VALUES '; + $sql = 'INSERT INTO '.MAIN_DB_PREFIX.'commandedet (fk_commande, fk_product, qty, price, tva_tx, label, description, remise_percent, subprice) VALUES '; + + if ($conf->global->CHANGE_PROD_DESC) + { $sql .= " ('".$this->id."', '$p_product_id','". $p_qty."','". $price."','".$p_tva_tx."','".addslashes($p_desc)."','".addslashes($p_product_desc)."', '$remise_percent', '$subprice') ; "; - + } + else + { + $sql .= " ('".$this->id."', '$p_product_id','". $p_qty."','". $price."','".$p_tva_tx."','".addslashes($p_desc)."','".addslashes($p_desc)."', '$remise_percent', '$subprice') ; "; + } + if ($this->db->query($sql) ) { if ($this->update_price() > 0)