Fix: Le modele einstein gère les avoirs.

This commit is contained in:
Regis Houssin 2007-04-03 11:04:10 +00:00
parent c5669bc150
commit ed40fb9330

View File

@ -1,24 +1,25 @@
<?php <?php
/* Copyright (C) 2004-2006 Laurent Destailleur <eldy@users.sourceforge.net> /* Copyright (C) 2004-2007 Laurent Destailleur <eldy@users.sourceforge.net>
* * Copyright (C) 2005-2007 Regis Houssin <regis.houssin@cap-networks.com>
* 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 * This program is free software; you can redistribute it and/or modify
* the Free Software Foundation; either version 2 of the License, or * it under the terms of the GNU General Public License as published by
* (at your option) any later version. * 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 * This program is distributed in the hope that it will be useful,
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * but WITHOUT ANY WARRANTY; without even the implied warranty of
* GNU General Public License for more details. * 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 * You should have received a copy of the GNU General Public License
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * along with this program; if not, write to the Free Software
* or see http://www.gnu.org/ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
* * or see http://www.gnu.org/
* $Id$ *
* $Source$ * $Id$
*/ * $Source$
*/
/** /**
\file htdocs/includes/modules/commande/pdf_einstein.modules.php \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_condreg = 1; // Affiche conditions règlement
$this->option_codeproduitservice = 1; // Affiche code produit-service $this->option_codeproduitservice = 1; // Affiche code produit-service
$this->option_multilang = 1; // Dispo en plusieurs langues $this->option_multilang = 1; // Dispo en plusieurs langues
$this->option_credit_note = 1; // Gère les avoirs
if (defined("FACTURE_TVAOPTION") && FACTURE_TVAOPTION == 'franchise') if (defined("FACTURE_TVAOPTION") && FACTURE_TVAOPTION == 'franchise')
$this->franchise=1; $this->franchise=1;
@ -219,8 +221,17 @@ class pdf_einstein extends ModelePDFCommandes
if ($com->lignes[$i]->desc&&$com->lignes[$i]->desc!=$com->lignes[$i]->libelle) if ($com->lignes[$i]->desc&&$com->lignes[$i]->desc!=$com->lignes[$i]->libelle)
{ {
if ($libelleproduitservice) $libelleproduitservice.="\n"; if ($libelleproduitservice) $libelleproduitservice.="\n";
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); $libelleproduitservice.=_dol_htmlentities($com->lignes[$i]->desc,$conf->global->FCKEDITOR_ENABLE_DETAILS);
} }
}
// Si ligne associée à un code produit // Si ligne associée à un code produit
if ($com->lignes[$i]->fk_product) if ($com->lignes[$i]->fk_product)
{ {