FIX #12797
This commit is contained in:
parent
b6ed6df75d
commit
9d4e1a3941
@ -1639,13 +1639,14 @@ function dol_bc($var, $moreclass = '')
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return a formated address (part address/zip/town/state) according to country rules
|
* Return a formated address (part address/zip/town/state) according to country rules.
|
||||||
|
* See https://en.wikipedia.org/wiki/Address
|
||||||
*
|
*
|
||||||
* @param Object $object A company or contact object
|
* @param Object $object A company or contact object
|
||||||
* @param int $withcountry 1=Add country into address string
|
* @param int $withcountry 1=Add country into address string
|
||||||
* @param string $sep Separator to use to build string
|
* @param string $sep Separator to use to build string
|
||||||
* @param Translate $outputlangs Object lang that contains language for text translation.
|
* @param Translate $outputlangs Object lang that contains language for text translation.
|
||||||
* @param int $mode 0=Standard output, 1=Remove address
|
* @param int $mode 0=Standard output, 1=Remove address
|
||||||
* @return string Formated string
|
* @return string Formated string
|
||||||
* @see dol_print_address()
|
* @see dol_print_address()
|
||||||
*/
|
*/
|
||||||
@ -1656,6 +1657,8 @@ function dol_format_address($object, $withcountry = 0, $sep = "\n", $outputlangs
|
|||||||
$ret = '';
|
$ret = '';
|
||||||
$countriesusingstate = array('AU', 'CA', 'US', 'IN', 'GB', 'ES', 'UK', 'TR'); // See also MAIN_FORCE_STATE_INTO_ADDRESS
|
$countriesusingstate = array('AU', 'CA', 'US', 'IN', 'GB', 'ES', 'UK', 'TR'); // See also MAIN_FORCE_STATE_INTO_ADDRESS
|
||||||
|
|
||||||
|
// See format of addresses on https://en.wikipedia.org/wiki/Address
|
||||||
|
|
||||||
// Address
|
// Address
|
||||||
if (empty($mode)) {
|
if (empty($mode)) {
|
||||||
$ret .= $object->address;
|
$ret .= $object->address;
|
||||||
@ -1692,7 +1695,7 @@ function dol_format_address($object, $withcountry = 0, $sep = "\n", $outputlangs
|
|||||||
{
|
{
|
||||||
$ret .= ($ret ? $sep : '').$object->zip;
|
$ret .= ($ret ? $sep : '').$object->zip;
|
||||||
$ret .= ($object->town ? (($object->zip ? ' ' : '').$object->town) : '');
|
$ret .= ($object->town ? (($object->zip ? ' ' : '').$object->town) : '');
|
||||||
$ret .= ($object->state_id ? (' ('.($object->state_id).')') : '');
|
$ret .= ($object->state_code ? (' '.($object->state_code)) : '');
|
||||||
}
|
}
|
||||||
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
|
||||||
{
|
{
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user