diff --git a/ChangeLog b/ChangeLog index 3d0caa7d0fbf2..82f764ad6b32a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -12,6 +12,7 @@ Fix: Can disable features with CKEDITOR. Fix: Pb of records not correctly cleaned when module marge is uninstalled (conflict between 'margin' and 'margins'). Fix: [ bug #1341 ] Lastname not added by file or direct input in mass e-mailing +Fix: [ bug #1357 ] Invoice creator state not printed in generated invoice documents ***** ChangeLog for 3.5.2 compared to 3.5.1 ***** Fix: Can't add user for a task. diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index 5d7ab58e39f33..e1fae9fe46a1c 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -10,6 +10,7 @@ * Copyright (C) 2013 Florian Henry * Copyright (C) 2013 Alexandre Spangaro * Copyright (C) 2013 Peter Fontaine + * Copyright (C) 2014 Marcos GarcĂ­a * * 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 @@ -2534,7 +2535,17 @@ function setMysoc($conf) $this->address=empty($conf->global->MAIN_INFO_SOCIETE_ADDRESS)?'':$conf->global->MAIN_INFO_SOCIETE_ADDRESS; $this->zip=empty($conf->global->MAIN_INFO_SOCIETE_ZIP)?'':$conf->global->MAIN_INFO_SOCIETE_ZIP; $this->town=empty($conf->global->MAIN_INFO_SOCIETE_TOWN)?'':$conf->global->MAIN_INFO_SOCIETE_TOWN; - $this->state_id=empty($conf->global->MAIN_INFO_SOCIETE_DEPARTEMENT)?'':$conf->global->MAIN_INFO_SOCIETE_DEPARTEMENT; + $this->state_id=empty($conf->global->MAIN_INFO_SOCIETE_STATE)?'':$conf->global->MAIN_INFO_SOCIETE_STATE; + + /* Disabled: we don't want any SQL request into method setMySoc. This method set object from env only. + If we need label, label must be loaded by output that need it from id (label depends on output language) + require_once DOL_DOCUMENT_ROOT .'/core/lib/company.lib.php'; + if (!empty($conf->global->MAIN_INFO_SOCIETE_STATE)) { + $this->state_id= $conf->global->MAIN_INFO_SOCIETE_STATE; + $this->state = getState($this->state_id); + } + */ + $this->note_private=empty($conf->global->MAIN_INFO_SOCIETE_NOTE)?'':$conf->global->MAIN_INFO_SOCIETE_NOTE; $this->nom=$this->name; // deprecated @@ -2554,8 +2565,8 @@ function setMysoc($conf) { dol_syslog("Your country setup use an old syntax. Reedit it using setup area.", LOG_WARNING); include_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; - $country_code=getCountry($country_id,2,$db); // This need a SQL request, but it's the old feature - $country_label=getCountry($country_id,0,$db); // This need a SQL request, but it's the old feature + $country_code=getCountry($country_id,2,$db); // This need a SQL request, but it's the old feature that should not be used anymore + $country_label=getCountry($country_id,0,$db); // This need a SQL request, but it's the old feature that should not be used anymore } } $this->country_id=$country_id;