From ed40fb933032aa0710bfd7d35849fd43595583a3 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Tue, 3 Apr 2007 11:04:10 +0000 Subject: [PATCH] =?UTF-8?q?Fix:=20Le=20modele=20einstein=20g=E8re=20les=20?= =?UTF-8?q?avoirs.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../modules/commande/pdf_einstein.modules.php | 53 +++++++++++-------- 1 file changed, 32 insertions(+), 21 deletions(-) diff --git a/htdocs/includes/modules/commande/pdf_einstein.modules.php b/htdocs/includes/modules/commande/pdf_einstein.modules.php index 2fb34442ed6..82e8b666c88 100644 --- a/htdocs/includes/modules/commande/pdf_einstein.modules.php +++ b/htdocs/includes/modules/commande/pdf_einstein.modules.php @@ -1,24 +1,25 @@ -* -* This program is free software; you can redistribute it and/or modify -* it under the terms of the GNU General Public License as published by -* the Free Software Foundation; either version 2 of the License, or -* (at your option) any later version. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program; if not, write to the Free Software -* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -* or see http://www.gnu.org/ -* -* $Id$ -* $Source$ -*/ +/* Copyright (C) 2004-2007 Laurent Destailleur + * Copyright (C) 2005-2007 Regis Houssin + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * or see http://www.gnu.org/ + * + * $Id$ + * $Source$ + */ /** \file htdocs/includes/modules/commande/pdf_einstein.modules.php @@ -73,6 +74,7 @@ class pdf_einstein extends ModelePDFCommandes $this->option_condreg = 1; // Affiche conditions règlement $this->option_codeproduitservice = 1; // Affiche code produit-service $this->option_multilang = 1; // Dispo en plusieurs langues + $this->option_credit_note = 1; // Gère les avoirs if (defined("FACTURE_TVAOPTION") && FACTURE_TVAOPTION == 'franchise') $this->franchise=1; @@ -219,7 +221,16 @@ class pdf_einstein extends ModelePDFCommandes if ($com->lignes[$i]->desc&&$com->lignes[$i]->desc!=$com->lignes[$i]->libelle) { if ($libelleproduitservice) $libelleproduitservice.="\n"; - $libelleproduitservice.=_dol_htmlentities($com->lignes[$i]->desc,$conf->global->FCKEDITOR_ENABLE_DETAILS); + if ($com->lignes[$i]->desc == '(CREDIT_NOTE)' && $com->lignes[$i]->fk_remise_except) + { + $discount=new DiscountAbsolute($this->db); + $discount->fetch($com->lignes[$i]->fk_remise_except); + $libelleproduitservice=$langs->trans("DiscountFromCreditNote",$discount->ref_facture_source); + } + else + { + $libelleproduitservice.=_dol_htmlentities($com->lignes[$i]->desc,$conf->global->FCKEDITOR_ENABLE_DETAILS); + } } // Si ligne associée à un code produit if ($com->lignes[$i]->fk_product)