New: Add ES formated address country rule
This commit is contained in:
parent
df0f281efd
commit
9e3497cff3
@ -673,7 +673,7 @@ function dol_get_fiche_end($notab=0)
|
|||||||
function dol_format_address($object)
|
function dol_format_address($object)
|
||||||
{
|
{
|
||||||
$ret='';
|
$ret='';
|
||||||
$countriesusingstate=array('US','IN','GB');
|
$countriesusingstate=array('US','IN','GB','ES');
|
||||||
|
|
||||||
// Address
|
// Address
|
||||||
$ret .= $object->address;
|
$ret .= $object->address;
|
||||||
@ -696,6 +696,16 @@ function dol_format_address($object)
|
|||||||
}
|
}
|
||||||
if ($object->zip) $ret .= ($ret ? "\n" : '' ).$object->zip;
|
if ($object->zip) $ret .= ($ret ? "\n" : '' ).$object->zip;
|
||||||
}
|
}
|
||||||
|
else if (in_array($object->country_code,array('ES'))) // title firstname name \n address lines \n zip town \n state \n country
|
||||||
|
{
|
||||||
|
$ret .= ($ret ? "\n" : '' ).$object->zip;
|
||||||
|
$ret .= ' '.$object->town;
|
||||||
|
if ($object->state && in_array($object->country_code,$countriesusingstate))
|
||||||
|
{
|
||||||
|
$ret.="\n".$object->state;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
else // Other: title firstname name \n address lines \n zip town \n country
|
else // Other: title firstname name \n address lines \n zip town \n country
|
||||||
{
|
{
|
||||||
$ret .= ($ret ? "\n" : '' ).$object->zip;
|
$ret .= ($ret ? "\n" : '' ).$object->zip;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user