From c063482d4955b39ae590a5b60f07da3a880d105d Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 4 Jan 2006 20:20:05 +0000 Subject: [PATCH] =?UTF-8?q?Fix:=20Regression.=20La=20description=20des=20p?= =?UTF-8?q?roduits=20s'affiche=20si=20constante=20FAC=5FADD=5FPROD=5FDESC?= =?UTF-8?q?=20ou=20PROP=5FADD=5FPROD=5FDESC=20d=E9finie?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../modules/facture/pdf_crabe.modules.php | 16 +++++++++++++--- .../modules/propale/pdf_propale_azur.modules.php | 16 +++++++++++++--- 2 files changed, 26 insertions(+), 6 deletions(-) diff --git a/htdocs/includes/modules/facture/pdf_crabe.modules.php b/htdocs/includes/modules/facture/pdf_crabe.modules.php index 87ae625afd0..19103758684 100644 --- a/htdocs/includes/modules/facture/pdf_crabe.modules.php +++ b/htdocs/includes/modules/facture/pdf_crabe.modules.php @@ -189,24 +189,34 @@ class pdf_crabe extends ModelePDFFactures { $curY = $nexY; - // Description produit + // Description de la ligne produit $libelleproduitservice=$fac->lignes[$i]->libelle; if ($fac->lignes[$i]->product_desc&&$fac->lignes[$i]->product_desc!=$fac->lignes[$i]->libelle) { if ($libelleproduitservice) $libelleproduitservice.="\n"; $libelleproduitservice.=$fac->lignes[$i]->product_desc; } - + // Si ligne associée à un code produit if ($fac->lignes[$i]->produit_id) { - // Affiche code produit si ligne associée à un code produit $prodser = new Product($this->db); $prodser->fetch($fac->lignes[$i]->produit_id); if ($prodser->ref) { $libelleproduitservice=$langs->trans("Product")." ".$prodser->ref." - ".$libelleproduitservice; } + + // Ajoute description du produit + if ($conf->global->FAC_ADD_PROD_DESC) + { + if ($fac->lignes[$i]->product_desc&&$fac->lignes[$i]->product_desc!=$fac->lignes[$i]->libelle&&$fac->lignes[$i]->product_desc!=$fac->lignes[$i]->desc) + { + if ($libelleproduitservice) $libelleproduitservice.="\n"; + $libelleproduitservice.=$fac->lignes[$i]->product_desc; + } + } } + if ($fac->lignes[$i]->date_start && $fac->lignes[$i]->date_end) { // Affichage durée si il y en a une $libelleproduitservice.="\n(".$langs->trans("From")." ".dolibarr_print_date($fac->lignes[$i]->date_start)." ".$langs->trans("to")." ".dolibarr_print_date($fac->lignes[$i]->date_end).")"; diff --git a/htdocs/includes/modules/propale/pdf_propale_azur.modules.php b/htdocs/includes/modules/propale/pdf_propale_azur.modules.php index dab8055cbaf..f5e39f706a3 100644 --- a/htdocs/includes/modules/propale/pdf_propale_azur.modules.php +++ b/htdocs/includes/modules/propale/pdf_propale_azur.modules.php @@ -26,6 +26,7 @@ \brief Fichier de la classe permettant de générer les propales au modèle Azur \author Laurent Destailleur \version $Revision$ + \version $Revision$ */ require_once(DOL_DOCUMENT_ROOT ."/includes/modules/propale/modules_propale.php"); @@ -196,17 +197,16 @@ class pdf_propale_azur extends ModelePDFPropales { $curY = $nexY; - // Description produit + // Description de la ligne produit $libelleproduitservice=$prop->lignes[$i]->libelle; if ($prop->lignes[$i]->product_desc&&$prop->lignes[$i]->product_desc!=$prop->lignes[$i]->libelle) { if ($libelleproduitservice) $libelleproduitservice.="\n"; $libelleproduitservice.=$prop->lignes[$i]->product_desc; } - + // Si ligne associée à un code produit if ($prop->lignes[$i]->product_id) { - // Affiche code produit si ligne associée à un code produit $prodser = new Product($this->db); $prodser->fetch($prop->lignes[$i]->product_id); @@ -214,6 +214,16 @@ class pdf_propale_azur extends ModelePDFPropales { $libelleproduitservice=$langs->trans("Product")." ".$prodser->ref." - ".$libelleproduitservice; } + + // Ajoute description du produit + if ($conf->global->PROP_ADD_PROD_DESC) + { + if ($prop->lignes[$i]->product_desc&&$prop->lignes[$i]->product_desc!=$fac->lignes[$i]->libelle&&$prop->lignes[$i]->product_desc!=$prop->lignes[$i]->desc) + { + if ($libelleproduitservice) $libelleproduitservice.="\n"; + $libelleproduitservice.=$prop->lignes[$i]->product_desc; + } + } } if ($prop->lignes[$i]->date_start && $prop->lignes[$i]->date_end) {