diff --git a/htdocs/compta/stats/index.php b/htdocs/compta/stats/index.php index 49c0ff19d70..1a1de43709d 100644 --- a/htdocs/compta/stats/index.php +++ b/htdocs/compta/stats/index.php @@ -108,6 +108,10 @@ if (!empty($conf->accounting->enabled)) $result = restrictedArea($user, 'account * View */ +$param = ''; +if ($date_startday && $date_startmonth && $date_startyear) $param .= '&date_startday='.$date_startday.'&date_startmonth='.$date_startmonth.'&date_startyear='.$date_startyear; +if ($date_endday && $date_endmonth && $date_endyear) $param .= '&date_endday='.$date_endday.'&date_endmonth='.$date_endmonth.'&date_endyear='.$date_endyear; + llxHeader(); $form = new Form($db); @@ -118,7 +122,7 @@ if ($modecompta == "CREANCES-DETTES") $name = $langs->trans("Turnover"); $calcmode = $langs->trans("CalcModeDebt"); //$calcmode.='
('.$langs->trans("SeeReportInInputOutputMode",'','').')'; - $calcmode .= '
('.$langs->trans("SeeReportInBookkeepingMode", '', '').')'; + $calcmode .= '
('.$langs->trans("SeeReportInBookkeepingMode", '', '').')'; $period = $form->selectDate($date_start, 'date_start', 0, 0, 0, '', 1, 0).' - '.$form->selectDate($date_end, 'date_end', 0, 0, 0, '', 1, 0); $periodlink = ($year_start ? "".img_previous()." ".img_next()."" : ""); $description = $langs->trans("RulesCADue"); @@ -142,7 +146,7 @@ if ($modecompta == "CREANCES-DETTES") { $name = $langs->trans("Turnover"); $calcmode = $langs->trans("CalcModeBookkeeping"); - $calcmode .= '
('.$langs->trans("SeeReportInDueDebtMode", '', '').')'; + $calcmode .= '
('.$langs->trans("SeeReportInDueDebtMode", '', '').')'; //$calcmode.='
('.$langs->trans("SeeReportInInputOutputMode",'','').')'; $period = $form->selectDate($date_start, 'date_start', 0, 0, 0, '', 1, 0).' - '.$form->selectDate($date_end, 'date_end', 0, 0, 0, '', 1, 0); $periodlink = ($year_start ? "".img_previous()." ".img_next()."" : ""); @@ -305,6 +309,11 @@ for ($mois = 1 + $nb_mois_decalage; $mois <= 12 + $nb_mois_decalage; $mois++) if ($mois > 12) {$mois_modulo = $mois - 12; } // ajout if ($year_start == $year_end) { + // If we show only one year or one month, we do not show month before the selected month + if ($mois < $date_startmonth && $year_start <= $date_startyear) { + continue; + } + // If we show only one year or one month, we do not show month after the selected month if ($mois > $date_endmonth && $year_end >= $date_endyear) { break; }