diff --git a/htdocs/compta/stats/cabyprodserv.php b/htdocs/compta/stats/cabyprodserv.php
index fb651977d7c..1c170eae96d 100644
--- a/htdocs/compta/stats/cabyprodserv.php
+++ b/htdocs/compta/stats/cabyprodserv.php
@@ -163,9 +163,6 @@ if ($modecompta=="CREANCES-DETTES") {
$calcmode=$langs->trans("CalcModeDebt");
$calcmode.='
('.$langs->trans("SeeReportInInputOutputMode",'','').')';
- $period=$form->select_date($date_start,'date_start',0,0,0,'',1,0,1).' - '.$form->select_date($date_end,'date_end',0,0,0,'',1,0,1);
- $periodlink="".img_previous()." ".img_next()."";
-
$description=$langs->trans("RulesCADue");
if (! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) {
$description.= $langs->trans("DepositsAreNotIncluded");
@@ -178,14 +175,14 @@ if ($modecompta=="CREANCES-DETTES") {
$calcmode=$langs->trans("CalcModeEngagement");
$calcmode.='
('.$langs->trans("SeeReportInDueDebtMode",'','').')';
- $period=$form->select_date($date_start,'date_start',0,0,0,'',1,0,1).' - '.$form->select_date($date_end,'date_end',0,0,0,'',1,0,1);
- $periodlink="".img_previous()." ".img_next()."";
-
$description=$langs->trans("RulesCAIn");
$description.= $langs->trans("DepositsAreIncluded");
$builddate=dol_now();
}
+$period=$form->select_date($date_start,'date_start',0,0,0,'',1,0,1).' - '.$form->select_date($date_end,'date_end',0,0,0,'',1,0,1);
+if ($date_end == dol_time_plus_duree($date_start, 1, 'y') - 1) $periodlink=''.img_previous().' '.img_next().'';
+else $periodlink = '';
report_header($name,$namelink,$period,$periodlink,$description,$builddate,$exportlink,$tableparams,$calcmode);
diff --git a/htdocs/compta/stats/cabyuser.php b/htdocs/compta/stats/cabyuser.php
index a21c34e0c2f..1d386df6c6f 100644
--- a/htdocs/compta/stats/cabyuser.php
+++ b/htdocs/compta/stats/cabyuser.php
@@ -146,8 +146,6 @@ if ($modecompta=="CREANCES-DETTES") {
$name=$langs->trans("SalesTurnover").', '.$langs->trans("ByUserAuthorOfInvoice");
$calcmode=$langs->trans("CalcModeDebt");
$calcmode.='
('.$langs->trans("SeeReportInInputOutputMode",'','').')';
- $period=$form->select_date($date_start,'date_start',0,0,0,'',1,0,1).' - '.$form->select_date($date_end,'date_end',0,0,0,'',1,0,1);
- $periodlink="".img_previous()." ".img_next()."";
$description=$langs->trans("RulesCADue");
if (! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) $description.= $langs->trans("DepositsAreNotIncluded");
else $description.= $langs->trans("DepositsAreIncluded");
@@ -157,13 +155,15 @@ if ($modecompta=="CREANCES-DETTES") {
$name=$langs->trans("SalesTurnover").', '.$langs->trans("ByUserAuthorOfInvoice");
$calcmode=$langs->trans("CalcModeEngagement");
$calcmode.='
('.$langs->trans("SeeReportInDueDebtMode",'','').')';
- $period=$form->select_date($date_start,'date_start',0,0,0,'',1,0,1).' - '.$form->select_date($date_end,'date_end',0,0,0,'',1,0,1);
- $periodlink="".img_previous()." ".img_next()."";
$description=$langs->trans("RulesCAIn");
$description.= $langs->trans("DepositsAreIncluded");
$builddate=dol_now();
//$exportlink=$langs->trans("NotYetAvailable");
}
+$period=$form->select_date($date_start,'date_start',0,0,0,'',1,0,1).' - '.$form->select_date($date_end,'date_end',0,0,0,'',1,0,1);
+if ($date_end == dol_time_plus_duree($date_start, 1, 'y') - 1) $periodlink=''.img_previous().' '.img_next().'';
+else $periodlink = '';
+
$moreparam=array();
if (! empty($modecompta)) $moreparam['modecompta']=$modecompta;
diff --git a/htdocs/compta/stats/casoc.php b/htdocs/compta/stats/casoc.php
index 9a88a1c4574..ed36d677df9 100644
--- a/htdocs/compta/stats/casoc.php
+++ b/htdocs/compta/stats/casoc.php
@@ -175,8 +175,6 @@ if ($modecompta=="CREANCES-DETTES")
$name=$langs->trans("SalesTurnover").', '.$langs->trans("ByThirdParties");
$calcmode=$langs->trans("CalcModeDebt");
$calcmode.='
('.$langs->trans("SeeReportInInputOutputMode",'','').')';
- $period=$form->select_date($date_start,'date_start',0,0,0,'',1,0,1).' - '.$form->select_date($date_end,'date_end',0,0,0,'',1,0,1);
- $periodlink=''.img_previous().' '.img_next().'';
$description=$langs->trans("RulesCADue");
if (! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) $description.= $langs->trans("DepositsAreNotIncluded");
else $description.= $langs->trans("DepositsAreIncluded");
@@ -186,13 +184,14 @@ if ($modecompta=="CREANCES-DETTES")
$name=$langs->trans("SalesTurnover").', '.$langs->trans("ByThirdParties");
$calcmode=$langs->trans("CalcModeEngagement");
$calcmode.='
('.$langs->trans("SeeReportInDueDebtMode",'','').')';
- $period=$form->select_date($date_start,'date_start',0,0,0,'',1,0,1).' - '.$form->select_date($date_end,'date_end',0,0,0,'',1,0,1);
- $periodlink=''.img_previous().' '.img_next().'';
$description=$langs->trans("RulesCAIn");
$description.= $langs->trans("DepositsAreIncluded");
$builddate=dol_now();
//$exportlink=$langs->trans("NotYetAvailable");
}
+$period=$form->select_date($date_start,'date_start',0,0,0,'',1,0,1).' - '.$form->select_date($date_end,'date_end',0,0,0,'',1,0,1);
+if ($date_end == dol_time_plus_duree($date_start, 1, 'y') - 1) $periodlink=''.img_previous().' '.img_next().'';
+else $periodlink = '';
report_header($name,$namelink,$period,$periodlink,$description,$builddate,$exportlink,$tableparams,$calcmode);