Merge pull request #18435 from henrynopo/patch-2

Added China into the list of country using State / province in address
This commit is contained in:
Laurent Destailleur 2021-08-18 21:28:16 +02:00 committed by GitHub
commit c2bfc87c34
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -2130,7 +2130,7 @@ function dol_format_address($object, $withcountry = 0, $sep = "\n", $outputlangs
global $conf, $langs;
$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', 'CN'); // See also MAIN_FORCE_STATE_INTO_ADDRESS
// See format of addresses on https://en.wikipedia.org/wiki/Address
// Address
@ -2138,7 +2138,7 @@ function dol_format_address($object, $withcountry = 0, $sep = "\n", $outputlangs
$ret .= ($extralangcode ? $object->array_languages['address'][$extralangcode] : (empty($object->address) ? '' : $object->address));
}
// Zip/Town/State
if (isset($object->country_code) && in_array($object->country_code, array('AU', 'CA', 'US')) || !empty($conf->global->MAIN_FORCE_STATE_INTO_ADDRESS)) {
if (isset($object->country_code) && in_array($object->country_code, array('AU', 'CA', 'US', 'CN')) || !empty($conf->global->MAIN_FORCE_STATE_INTO_ADDRESS)) {
// US: title firstname name \n address lines \n town, state, zip \n country
$town = ($extralangcode ? $object->array_languages['town'][$extralangcode] : (empty($object->town) ? '' : $object->town));
$ret .= ($ret ? $sep : '').$town;