New: Use GB address format
This commit is contained in:
parent
040dd09f5d
commit
dd66ebd3f6
@ -723,12 +723,12 @@ function dol_get_fiche_end($notab=0)
|
|||||||
function dol_format_address($object)
|
function dol_format_address($object)
|
||||||
{
|
{
|
||||||
$ret='';
|
$ret='';
|
||||||
$countriesusingstate=array('US','IN');
|
$countriesusingstate=array('US','IN','GB');
|
||||||
|
|
||||||
// Address
|
// Address
|
||||||
$ret .= $object->address;
|
$ret .= $object->address;
|
||||||
// Zip/Town/State
|
// Zip/Town/State
|
||||||
if (in_array($object->country_code,array('US'))) // US: town, state, zip
|
if (in_array($object->country_code,array('US'))) // US: title firstname name \n address lines \n town, state, zip \n country
|
||||||
{
|
{
|
||||||
$ret .= ($ret ? "\n" : '' ).$object->town;
|
$ret .= ($ret ? "\n" : '' ).$object->town;
|
||||||
if ($object->state && in_array($object->country_code,$countriesusingstate))
|
if ($object->state && in_array($object->country_code,$countriesusingstate))
|
||||||
@ -737,7 +737,16 @@ function dol_format_address($object)
|
|||||||
}
|
}
|
||||||
if ($object->zip) $ret .= ', '.$object->zip;
|
if ($object->zip) $ret .= ', '.$object->zip;
|
||||||
}
|
}
|
||||||
else // Other: zip town, state
|
else if (in_array($object->country_code,array('GB'))) // UK: title firstname name \n address lines \n town state \n zip \n country
|
||||||
|
{
|
||||||
|
$ret .= ($ret ? "\n" : '' ).$object->town;
|
||||||
|
if ($object->state && in_array($object->country_code,$countriesusingstate))
|
||||||
|
{
|
||||||
|
$ret.=", ".$object->departement;
|
||||||
|
}
|
||||||
|
if ($object->zip) $ret .= ($ret ? "\n" : '' ).$object->zip;
|
||||||
|
}
|
||||||
|
else // Other: title firstname name \n address lines \n zip town \n country
|
||||||
{
|
{
|
||||||
$ret .= ($ret ? "\n" : '' ).$object->zip;
|
$ret .= ($ret ? "\n" : '' ).$object->zip;
|
||||||
$ret .= ' '.$object->town;
|
$ret .= ' '.$object->town;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user