diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index adbb77ae6b9..ee811e3b81a 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -455,7 +455,6 @@ abstract class CommonObject { if ($withcountry && $this->country_id && (empty($this->country_code) || empty($this->country))) { - $langs->load("dict"); require_once DOL_DOCUMENT_ROOT .'/core/lib/company.lib.php'; $tmparray=getCountry($this->country_id,'all'); $this->country_code=$tmparray['code']; @@ -2705,7 +2704,7 @@ abstract class CommonObject $sql .= ", multicurrency_total_ttc='".price2num($this->multicurrency_total_ttc, 'MT', 1)."'"; $sql .= ' WHERE rowid = '.$this->id; - + dol_syslog(get_class($this)."::update_price", LOG_DEBUG); $resql=$this->db->query($sql); if (! $resql) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 123334eee25..153ebab4c89 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -1654,9 +1654,9 @@ function dol_format_address($object, $withcountry=0, $sep="\n", $outputlangs='', } else if (in_array($object->country_code,array('IT'))) // IT: tile firstname name\n address lines \n zip (Code Departement) \n country { - $ret .= ($ret ? $sep : '' ).$object->zip; - $ret .= ($object->town?(($object->zip?' ':'').$object->town):''); - $ret .= ($object->departement_id?(' ('.($object->departement_id).')'):''); + $ret .= ($ret ? $sep : '' ).$object->zip; + $ret .= ($object->town?(($object->zip?' ':'').$object->town):''); + $ret .= ($object->departement_id?(' ('.($object->departement_id).')'):''); } else // Other: title firstname name \n address lines \n zip town \n country { @@ -1668,7 +1668,11 @@ function dol_format_address($object, $withcountry=0, $sep="\n", $outputlangs='', } } if (! is_object($outputlangs)) $outputlangs=$langs; - if ($withcountry) $ret.=($object->country_code?($ret?$sep:'').$outputlangs->convToOutputCharset($outputlangs->transnoentitiesnoconv("Country".$object->country_code)):''); + if ($withcountry) + { + $langs->load("dict"); + $ret.=($object->country_code?($ret?$sep:'').$outputlangs->convToOutputCharset($outputlangs->transnoentitiesnoconv("Country".$object->country_code)):''); + } return $ret; }