diff --git a/htdocs/compta/resultat/clientfourn.php b/htdocs/compta/resultat/clientfourn.php
index f2347d2594f..b81a6444cc7 100644
--- a/htdocs/compta/resultat/clientfourn.php
+++ b/htdocs/compta/resultat/clientfourn.php
@@ -87,7 +87,7 @@ else
// Define modecompta ('CREANCES-DETTES' or 'RECETTES-DEPENSES')
$modecompta = $conf->global->COMPTA_MODE;
-if ($_GET["modecompta"]) $modecompta=$_GET["modecompta"];
+if (GETPOST("modecompta")) $modecompta=GETPOST("modecompta");
@@ -122,7 +122,7 @@ else {
$builddate=time();
//$exportlink=$langs->trans("NotYetAvailable");
}
-report_header($nom,$nomlink,$period,$periodlink,$description,$builddate,$exportlink);
+report_header($nom,$nomlink,$period,$periodlink,$description,$builddate,$exportlink,array('modecompta'=>$modecompta));
// Show report array
print '
';
diff --git a/htdocs/compta/resultat/index.php b/htdocs/compta/resultat/index.php
index 371a859c062..ed738e9864b 100644
--- a/htdocs/compta/resultat/index.php
+++ b/htdocs/compta/resultat/index.php
@@ -45,7 +45,7 @@ accessforbidden();
// Define modecompta ('CREANCES-DETTES' or 'RECETTES-DEPENSES')
$modecompta = $conf->global->COMPTA_MODE;
-if ($_GET["modecompta"]) $modecompta=$_GET["modecompta"];
+if (GETPOST("modecompta")) $modecompta=GETPOST("modecompta");
@@ -79,7 +79,7 @@ else {
$builddate=time();
//$exportlink=$langs->trans("NotYetAvailable");
}
-report_header($nom,$nomlink,$period,$periodlink,$description,$builddate,$exportlink);
+report_header($nom,$nomlink,$period,$periodlink,$description,$builddate,$exportlink,array('modecompta'=>$modecompta));
/*
diff --git a/htdocs/compta/stats/index.php b/htdocs/compta/stats/index.php
index c546fd5c563..a179811b1fb 100644
--- a/htdocs/compta/stats/index.php
+++ b/htdocs/compta/stats/index.php
@@ -78,7 +78,9 @@ else {
$builddate=time();
//$exportlink=$langs->trans("NotYetAvailable");
}
-report_header($nom,$nomlink,$period,$periodlink,$description,$builddate,$exportlink);
+$moreparam=array();
+if (! empty($modecompta)) $moreparam['modecompta']=$modecompta;
+report_header($nom,$nomlink,$period,$periodlink,$description,$builddate,$exportlink,$moreparam);
if ($modecompta == 'CREANCES-DETTES')
diff --git a/htdocs/core/lib/report.lib.php b/htdocs/core/lib/report.lib.php
index 02f982bcbb6..0a07f96d3de 100644
--- a/htdocs/core/lib/report.lib.php
+++ b/htdocs/core/lib/report.lib.php
@@ -25,14 +25,15 @@
/**
* Show header of a VAT report
*
-* @param $nom Name of report
-* @param $variante Link for alternate report
-* @param $period Period of report
-* @param $periodlink Link to switch period
-* @param $description Description
-* @param $builddate Date generation
-* @param $exportlink Link for export or ''
-* @param $moreparam Array with list of params to add into form
+* @param string $nom Name of report
+* @param string $variante Link for alternate report
+* @param string $period Period of report
+* @param string $periodlink Link to switch period
+* @param string $description Description
+* @param date $builddate Date generation
+* @param string $exportlink Link for export or ''
+* @param array $moreparam Array with list of params to add into form
+* @return void
*/
function report_header($nom,$variante='',$period,$periodlink,$description,$builddate,$exportlink='',$moreparam=array())
{