From dce5a201725d08a8e65407c1fb090faf078e7ca5 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Sat, 11 Feb 2006 18:02:29 +0000 Subject: [PATCH] modification de la description produit --- htdocs/commande/commande.class.php | 10 +++++++++- htdocs/includes/modules/modProduit.class.php | 5 +++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/htdocs/commande/commande.class.php b/htdocs/commande/commande.class.php index e414a5c3085..14ffc024487 100644 --- a/htdocs/commande/commande.class.php +++ b/htdocs/commande/commande.class.php @@ -406,7 +406,15 @@ class Commande } $sql = 'INSERT INTO '.MAIN_DB_PREFIX.'commandedet (fk_commande,label,description,fk_product, price,qty,tva_tx, remise_percent, subprice, remise)'; - $sql .= " VALUES ($this->id, '" . addslashes($desc) . "','" . nl2br(addslashes($product_desc)) . "',$fk_product,".price2num($price).", '$qty', $txtva, $remise_percent,'".price2num($subprice)."','".price2num( $remise)."') ;"; + + if ($conf->global->CHANGE_PROD_DESC) + { + $sql .= " VALUES ($this->id, '" . addslashes($desc) . "','" . nl2br(addslashes($product_desc)) . "',$fk_product,".price2num($price).", '$qty', $txtva, $remise_percent,'".price2num($subprice)."','".price2num( $remise)."') ;"; + } + else + { + $sql .= " VALUES ($this->id, '" . addslashes($desc) . "','" . addslashes($desc) . "',$fk_product,".price2num($price).", '$qty', $txtva, $remise_percent,'".price2num($subprice)."','".price2num( $remise)."') ;"; + } if ( $this->db->query( $sql) ) { diff --git a/htdocs/includes/modules/modProduit.class.php b/htdocs/includes/modules/modProduit.class.php index 17100a70222..b2b118fbc0b 100644 --- a/htdocs/includes/modules/modProduit.class.php +++ b/htdocs/includes/modules/modProduit.class.php @@ -74,6 +74,11 @@ class modProduit extends DolibarrModules // Constantes $this->const = array(); + $this->const[1][0] = "CHANGE_PROD_DESC"; + $this->const[1][1] = "chaine"; + $this->const[1][2] = "0"; + $this->const[1][3] = "Mettre à 1 pour modifier la description d\'un produit dans une propale, commande et facture"; + $this->const[1][4] = 1; // Boxes $this->boxes = array();