diff --git a/htdocs/contact.class.php b/htdocs/contact.class.php index 675f9013830..3403e74585c 100644 --- a/htdocs/contact.class.php +++ b/htdocs/contact.class.php @@ -4,6 +4,7 @@ * Copyright (C) 2004-2008 Laurent Destailleur * Copyright (C) 2005 Regis Houssin * Copyright (C) 2007 Franky Van Liedekerke + * Copyright (C) 2008 Raphael Bertrand (Resultic) * * 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 @@ -744,9 +745,10 @@ class Contact extends CommonObject * \brief Return full name (name+' '+lastname) * \param langs Lang for output * \param option 0=No option, 1=Add civility - * \return string String with full name + * \param nameorder 0=Lastname+Firstname, 1=Firstname+Lastname + * \return string String with full name */ - function getFullName($langs,$option=0) + function getFullName($langs,$option=0,$nameorder=0) { $ret=''; if ($option && $this->civilite_id) @@ -754,8 +756,17 @@ class Contact extends CommonObject if ($langs->transnoentities("Civility".$this->civilite_id)!="Civility".$this->civilite_id) $ret.=$langs->transnoentities("Civility".$this->civilite_id).' '; else $ret.=$this->civilite_id.' '; } - if ($this->name) $ret.=$this->name.' '; - if ($this->firstname) $ret.=$this->firstname.' '; + + if ($nameorder) + { + if ($this->firstname) $ret.=$this->firstname.' '; + if ($this->name) $ret.=$this->name.' '; + } + else + { + if ($this->name) $ret.=$this->name.' '; + if ($this->firstname) $ret.=$this->firstname.' '; + } return trim($ret); } diff --git a/htdocs/includes/modules/commande/pdf_einstein.modules.php b/htdocs/includes/modules/commande/pdf_einstein.modules.php index 82508d6484f..76531600957 100644 --- a/htdocs/includes/modules/commande/pdf_einstein.modules.php +++ b/htdocs/includes/modules/commande/pdf_einstein.modules.php @@ -921,9 +921,10 @@ class pdf_einstein extends ModelePDFCommandes // Caractéristiques client $carac_client.="\n".$object->contact->adresse; $carac_client.="\n".$object->contact->cp . " " . $object->contact->ville."\n"; + //Pays si different de l'emetteur if ($this->emetteur->pays_code != $object->contact->pays_code) { - $carac_client.=$object->contact->pays."\n"; + dol_entity_decode($carac_client.=$object->contact->pays)."\n"; } } else @@ -949,10 +950,10 @@ class pdf_einstein extends ModelePDFCommandes $carac_client.="\n".$object->client->adresse; $carac_client.="\n".$object->client->cp . " " . $object->client->ville."\n"; - //Pays si defini et different de l'emetteur + //Pays si different de l'emetteur if ($this->emetteur->pays_code != $object->client->pays_code) { - $carac_client.=$object->client->pays."\n"; + $carac_client.=dol_entity_decode($object->client->pays)."\n"; } } // Numéro TVA intracom diff --git a/htdocs/includes/modules/facture/pdf_crabe.modules.php b/htdocs/includes/modules/facture/pdf_crabe.modules.php index e5e43f1a870..01292bb3ee5 100644 --- a/htdocs/includes/modules/facture/pdf_crabe.modules.php +++ b/htdocs/includes/modules/facture/pdf_crabe.modules.php @@ -1114,10 +1114,10 @@ class pdf_crabe extends ModelePDFFactures // Caractéristiques client $carac_client.="\n".$object->contact->adresse; $carac_client.="\n".$object->contact->cp . " " . $object->contact->ville."\n"; - //Pays si definit et different de l'emetteur + //Pays si different de l'emetteur if ($this->emetteur->pays_code != $object->contact->pays_code) { - $carac_client.=$object->contact->pays."\n"; + $carac_client.=dol_entity_decode($object->contact->pays)."\n"; } } else @@ -1143,10 +1143,10 @@ class pdf_crabe extends ModelePDFFactures $carac_client.="\n".$object->client->adresse; $carac_client.="\n".$object->client->cp . " " . $object->client->ville."\n"; - //Pays si defini et different de l'emetteur - if ( (!empty( $object->client->pays_code )) && ($this->emetteur->pays_code != $object->client->pays_code) ) + //Pays si different de l'emetteur + if ($this->emetteur->pays_code != $object->client->pays_code) { - $carac_client.=$object->client->pays."\n"; + $carac_client.=dol_entity_decode($object->client->pays)."\n"; } } // Numéro TVA intracom diff --git a/htdocs/includes/modules/propale/pdf_propale_azur.modules.php b/htdocs/includes/modules/propale/pdf_propale_azur.modules.php index 3a0972c337f..94c09d2185d 100644 --- a/htdocs/includes/modules/propale/pdf_propale_azur.modules.php +++ b/htdocs/includes/modules/propale/pdf_propale_azur.modules.php @@ -947,10 +947,10 @@ class pdf_propale_azur extends ModelePDFPropales // Caractéristiques client $carac_client.="\n".$object->contact->adresse; $carac_client.="\n".$object->contact->cp . " " . $object->contact->ville."\n"; - //Pays si definit et different de l'emetteur + //Pays si different de l'emetteur if ($this->emetteur->pays_code != $object->contact->pays_code) { - $carac_client.=$object->contact->pays."\n"; + $carac_client.=dol_entity_decode($object->contact->pays)."\n"; } } else @@ -976,10 +976,10 @@ class pdf_propale_azur extends ModelePDFPropales $carac_client.="\n".$object->client->adresse; $carac_client.="\n".$object->client->cp . " " . $object->client->ville."\n"; - //Pays si defini et different de l'emetteur - if ( (!empty( $object->client->pays_code )) && ($this->emetteur->pays_code != $object->client->pays_code) ) + //Pays si different de l'emetteur + if ($this->emetteur->pays_code != $object->client->pays_code) { - $carac_client.=$object->client->pays."\n"; + $carac_client.=dol_entity_decode($object->client->pays)."\n"; } } // Numéro TVA intracom