diff --git a/htdocs/compta/stats/byratecountry.php b/htdocs/compta/stats/byratecountry.php
index 3416cd553a0..acd58f90217 100644
--- a/htdocs/compta/stats/byratecountry.php
+++ b/htdocs/compta/stats/byratecountry.php
@@ -257,7 +257,7 @@ if ($modecompta == 'CREANCES-DETTES') {
$sql = "SELECT fd.tva_tx AS vatrate,";
$sql .= " fd.product_type AS product_type,";
- $sql .= " cc.label AS country,";
+ $sql .= " cc.code, cc.label AS country,";
for ($i = 1; $i <= 12; $i++) {
$sql .= " SUM(".$db->ifsql('MONTH(f.datef)='.$i, 'fd.total_ht', '0').") AS month".str_pad($i, 2, '0', STR_PAD_LEFT).",";
}
@@ -289,7 +289,10 @@ if ($modecompta == 'CREANCES-DETTES') {
} else {
print '
'.$langs->trans("Service").' | ';
}
- print ''.$obj->country.' | ';
+ // Country
+ print '';
+ print $langs->trans("Country".$obj->code) != "Country".$obj->code ? $langs->trans("Country".$obj->code) : $obj->country;
+ print ' | ';
for ($i = 0; $i < 12; $i++) {
$j = $i + (empty($conf->global->SOCIETE_FISCAL_MONTH_START) ? 1 : $conf->global->SOCIETE_FISCAL_MONTH_START);
if ($j > 12) $j -= 12;
@@ -335,7 +338,7 @@ if ($modecompta == 'CREANCES-DETTES') {
$sql2 = "SELECT ffd.tva_tx AS vatrate,";
$sql2 .= " ffd.product_type AS product_type,";
- $sql2 .= " cc.label AS country,";
+ $sql2 .= " cc.code, cc.label AS country,";
for ($i = 1; $i <= 12; $i++) {
$sql2 .= " SUM(".$db->ifsql('MONTH(ff.datef)='.$i, 'ffd.total_ht', '0').") AS month".str_pad($i, 2, '0', STR_PAD_LEFT).",";
}
@@ -368,7 +371,9 @@ if ($modecompta == 'CREANCES-DETTES') {
} else {
print ''.$langs->trans("Service").' | ';
}
- print ''.$obj->country.' | ';
+ print '';
+ print $langs->trans("Country".$obj->code) != "Country".$obj->code ? $langs->trans("Country".$obj->code) : $obj->country;
+ print ' | ';
for ($i = 0; $i < 12; $i++) {
$j = $i + (empty($conf->global->SOCIETE_FISCAL_MONTH_START) ? 1 : $conf->global->SOCIETE_FISCAL_MONTH_START);
if ($j > 12) $j -= 12;
diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php
index 6306162af34..1d275e0f512 100644
--- a/htdocs/core/lib/functions.lib.php
+++ b/htdocs/core/lib/functions.lib.php
@@ -1582,9 +1582,12 @@ function dol_banner_tab($object, $paramid, $morehtml = '', $shownav = 1, $fieldi
if (method_exists($object, 'getBannerAddress') && $object->element != 'product' && $object->element != 'bookmark' && $object->element != 'ecm_directories' && $object->element != 'ecm_files')
{
- $morehtmlref .= '';
- $morehtmlref .= $object->getBannerAddress('refaddress', $object);
- $morehtmlref .= '
';
+ $moreaddress = $object->getBannerAddress('refaddress', $object);
+ if ($moreaddress) {
+ $morehtmlref .= '';
+ $morehtmlref .= $moreaddress;
+ $morehtmlref .= '
';
+ }
}
if (!empty($conf->global->MAIN_SHOW_TECHNICAL_ID) && in_array($object->element, array('societe', 'contact', 'member', 'product')))
{