From b24261692d7de673421d1cabe1d481dc66a5a013 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Sat, 11 Feb 2006 16:24:55 +0000 Subject: [PATCH] =?UTF-8?q?Ajout=20constante=20COM=5FADD=5FPROD=5FDESC=20,?= =?UTF-8?q?=20mettre=20=E0=201=20pour=20afficher=20la=20description=20prod?= =?UTF-8?q?uit=20=20dans=20les=20commandes?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- htdocs/commande/fiche.php | 4 ++-- htdocs/compta/facture.php | 12 ++++++++++ .../modules/commande/pdf_azur.modules.php | 2 +- htdocs/includes/modules/modCommande.class.php | 8 ++++++- htdocs/includes/modules/modFacture.class.php | 22 +++++++++---------- htdocs/includes/modules/modPropale.class.php | 2 +- 6 files changed, 34 insertions(+), 16 deletions(-) diff --git a/htdocs/commande/fiche.php b/htdocs/commande/fiche.php index 047add991f6..77cbc12335b 100644 --- a/htdocs/commande/fiche.php +++ b/htdocs/commande/fiche.php @@ -683,7 +683,7 @@ else $sql = 'SELECT l.fk_product, l.description, l.price, l.qty, l.rowid, l.tva_tx, l.remise_percent, l.subprice,'; $sql.= ' p.label as product, p.ref, p.fk_product_type, p.rowid as prodid'; - if ($conf->global->PROP_ADD_PROD_DESC) + if ($conf->global->COM_ADD_PROD_DESC) { $sql.= ', p.description as product_desc'; } @@ -730,7 +730,7 @@ else print ' '.$objp->ref.' - '.stripslashes(nl2br($objp->product)); print ($objp->description && $objp->description!=$objp->product)?'
'.$objp->description:''; - if ($conf->global->PROP_ADD_PROD_DESC) + if ($conf->global->COM_ADD_PROD_DESC) { print '
'.nl2br(stripslashes($objp->product_desc)); } diff --git a/htdocs/compta/facture.php b/htdocs/compta/facture.php index 2a568b957d3..50bdb387ef7 100644 --- a/htdocs/compta/facture.php +++ b/htdocs/compta/facture.php @@ -1370,6 +1370,12 @@ else $sql .= ' '.$db->pdate('l.date_start').' as date_start,'; $sql .= ' '.$db->pdate('l.date_end').' as date_end, '; $sql .= ' p.ref, p.fk_product_type, p.label as product'; + + if ($conf->global->FAC_ADD_PROD_DESC) + { + $sql.= ', p.description as product_desc'; + } + $sql .= ' FROM '.MAIN_DB_PREFIX.'facturedet as l '; $sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'product p ON l.fk_product=p.rowid'; $sql .= ' WHERE l.fk_facture = '.$fac->id; @@ -1413,6 +1419,12 @@ else print ' - '.nl2br(stripslashes($objp->product)); print_date_range($objp->date_start,$objp->date_end); print ($objp->description && $objp->description!=$objp->product)?'
'.$objp->description:''; + + if ($conf->global->FAC_ADD_PROD_DESC) + { + print '
'.nl2br(stripslashes($objp->product_desc)); + } + print ''; } else diff --git a/htdocs/includes/modules/commande/pdf_azur.modules.php b/htdocs/includes/modules/commande/pdf_azur.modules.php index 76eade5095c..d22aaacf64e 100644 --- a/htdocs/includes/modules/commande/pdf_azur.modules.php +++ b/htdocs/includes/modules/commande/pdf_azur.modules.php @@ -219,7 +219,7 @@ class pdf_azur extends ModelePDFCommandes } // Ajoute description du produit - if ($conf->global->PROP_ADD_PROD_DESC) + if ($conf->global->COM_ADD_PROD_DESC) { if ($com->lignes[$i]->product_desc&&$com->lignes[$i]->product_desc!=$fac->lignes[$i]->libelle&&$com->lignes[$i]->product_desc!=$com->lignes[$i]->desc) { diff --git a/htdocs/includes/modules/modCommande.class.php b/htdocs/includes/modules/modCommande.class.php index 96af6fde042..601da30c5d1 100644 --- a/htdocs/includes/modules/modCommande.class.php +++ b/htdocs/includes/modules/modCommande.class.php @@ -73,9 +73,15 @@ class modCommande extends DolibarrModules // Constantes $this->const = array(); - $this->const[0][0] = "COMMANDE_ADDON_PDF"; + $this->const[0][0] = "COMMANDE_ADDON_PDF"; $this->const[0][1] = "chaine"; $this->const[0][2] = "azur"; + + $this->const[1][0] = "COM_ADD_PROD_DESC"; + $this->const[1][1] = "chaine"; + $this->const[1][2] = "0"; + $this->const[1][3] = "Mettre à 1 pour voir la description d\'un produit dans une commande"; + $this->const[1][4] = 1; // Boites $this->boxes = array(); diff --git a/htdocs/includes/modules/modFacture.class.php b/htdocs/includes/modules/modFacture.class.php index 7c36872a1be..0384a15b5ac 100644 --- a/htdocs/includes/modules/modFacture.class.php +++ b/htdocs/includes/modules/modFacture.class.php @@ -118,19 +118,19 @@ class modFacture extends DolibarrModules $this->const[7][1] = "chaine"; $this->const[7][2] = "bulot"; - $this->const[7][0] = "FACTURE_ADDON"; - $this->const[7][1] = "chaine"; - $this->const[7][2] = "pluton"; + $this->const[8][0] = "FACTURE_ADDON"; + $this->const[8][1] = "chaine"; + $this->const[8][2] = "pluton"; - $this->const[8][0] = "FAC_FORCE_DATE_VALIDATION"; - $this->const[8][1] = "yesno"; - $this->const[8][2] = "0"; - - $this->const[9][0] = "FAC_ADD_PROD_DESC"; - $this->const[9][1] = "chaine"; + $this->const[9][0] = "FAC_FORCE_DATE_VALIDATION"; + $this->const[9][1] = "yesno"; $this->const[9][2] = "0"; - $this->const[9][3] = "Mettre à 1 pour voir la description d'un produit dans une facture"; - $this->const[9][4] = 1; + + $this->const[10][0] = "FAC_ADD_PROD_DESC"; + $this->const[10][1] = "chaine"; + $this->const[10][2] = "0"; + $this->const[10][3] = "Mettre à 1 pour voir la description d\'un produit dans une facture"; + $this->const[10][4] = 1; // Boites $this->boxes = array(); diff --git a/htdocs/includes/modules/modPropale.class.php b/htdocs/includes/modules/modPropale.class.php index 0bed1080f3c..b65ea49864d 100644 --- a/htdocs/includes/modules/modPropale.class.php +++ b/htdocs/includes/modules/modPropale.class.php @@ -87,7 +87,7 @@ class modPropale extends DolibarrModules $this->const[2][0] = "PROP_ADD_PROD_DESC"; $this->const[2][1] = "chaine"; $this->const[2][2] = "0"; - $this->const[2][3] = "Mettre à 1 pour voir la description d'un produit dans une propale"; + $this->const[2][3] = "Mettre à 1 pour voir la description d\'un produit dans une propale"; $this->const[2][4] = 1; // Boxes