From 4599b22cb57211a5eb827b6aebb6989955d8ff67 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20Garci=CC=81a=20de=20La=20Fuente?= Date: Fri, 2 May 2014 17:15:56 +0200 Subject: [PATCH 1/2] Fix: [ bug #1357 ] Invoice creator state not printed in generated invoice documents --- ChangeLog | 2 +- htdocs/societe/class/societe.class.php | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 455ba63c7eee4..80173e42c65dc 100644 --- a/ChangeLog +++ b/ChangeLog @@ -7,7 +7,7 @@ Fix: Error on field accountancy code for export profile of invoices. Fix: [ bug #1351 ] VIES verification link broken. Fix: [ bug #1352 ] Removing a shipping does not remove the delivery. Fix: Option MAIN_INVERT_SENDER_RECIPIENT broken with typhon template. - +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..bbefb952c7a67 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 @@ -2529,12 +2530,15 @@ function setMysoc($conf) { global $langs; + require_once DOL_DOCUMENT_ROOT .'/core/lib/company.lib.php'; + $this->id=0; $this->name=empty($conf->global->MAIN_INFO_SOCIETE_NOM)?'':$conf->global->MAIN_INFO_SOCIETE_NOM; $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; + $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 From 08301e3478677d4dbd80d8ab1fd24c32ed36ae64 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20Garci=CC=81a=20de=20La=20Fuente?= Date: Sat, 3 May 2014 17:16:37 +0200 Subject: [PATCH 2/2] Corrected little bug when no state_id was defined --- htdocs/societe/class/societe.class.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index bbefb952c7a67..b875c50a12bfe 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -2537,8 +2537,12 @@ 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_STATE)?'':$conf->global->MAIN_INFO_SOCIETE_STATE; - $this->state = getState($this->state_id); + + 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