diff --git a/htdocs/core/boxes/box_graph_invoices_permonth.php b/htdocs/core/boxes/box_graph_invoices_permonth.php index 18ffe022610..65498ab6362 100644 --- a/htdocs/core/boxes/box_graph_invoices_permonth.php +++ b/htdocs/core/boxes/box_graph_invoices_permonth.php @@ -146,9 +146,6 @@ class box_graph_invoices_permonth extends ModeleBoxes $filenamenb = $dir."/".$prefix."invoicesnbinyear-".$endyear.".png"; // default value for customer mode $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=billstats&file=invoicesnbinyear-'.$endyear.'.png'; - if ($mode == 'supplier') { - $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=billstatssupplier&file=invoicessuppliernbinyear-'.$endyear.'.png'; - } $px1 = new DolGraph(); $mesg = $px1->isGraphKo(); @@ -189,10 +186,7 @@ class box_graph_invoices_permonth extends ModeleBoxes $filenamenb = $dir."/".$prefix."invoicesamountinyear-".$endyear.".png"; // default value for customer mode - $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=billstats&file=invoicesamountinyear-'.$endyear.'.png'; - if ($mode == 'supplier') { - $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=billstatssupplier&file=invoicessupplieramountinyear-'.$endyear.'.png'; - } + $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=billstats&file=invoicesamountinyear-'.$endyear.'.png'; $px2 = new DolGraph(); $mesg = $px2->isGraphKo(); @@ -251,7 +245,7 @@ class box_graph_invoices_permonth extends ModeleBoxes $stringtoshow .= ' '.$langs->trans("AmountOfBillsByMonthHT"); $stringtoshow .= '
'; $stringtoshow .= $langs->trans("Year").' '; - $stringtoshow .= ''; + $stringtoshow .= ''; $stringtoshow .= ''; $stringtoshow .= ''; if ($shownb && $showtot) { diff --git a/htdocs/core/boxes/box_graph_invoices_supplier_permonth.php b/htdocs/core/boxes/box_graph_invoices_supplier_permonth.php index 3d8cb88938d..4ba27c74b1a 100644 --- a/htdocs/core/boxes/box_graph_invoices_supplier_permonth.php +++ b/htdocs/core/boxes/box_graph_invoices_supplier_permonth.php @@ -125,9 +125,6 @@ class box_graph_invoices_supplier_permonth extends ModeleBoxes $showtot = 1; } $nowarray = dol_getdate(dol_now(), true); - if (empty($year)) { - $year = $nowarray['year']; - } if (empty($endyear)) { $endyear = $nowarray['year']; } @@ -143,12 +140,9 @@ class box_graph_invoices_supplier_permonth extends ModeleBoxes if ($shownb) { $data1 = $stats->getNbByMonthWithPrevYear($endyear, $startyear, (GETPOST('action', 'aZ09') == $refreshaction ?-1 : (3600 * 24)), ($WIDTH < 300 ? 2 : 0), $startmonth); - $filenamenb = $dir."/".$prefix."invoicessuppliernbinyear-".$year.".png"; + $filenamenb = $dir."/".$prefix."invoicessuppliernbinyear-".$endyear.".png"; // default value for customer mode - $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=billstats&file=invoicesnbinyear-'.$year.'.png'; - if ($mode == 'supplier') { - $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=billstatssupplier&file=invoicessuppliernbinyear-'.$year.'.png'; - } + $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=billstatssupplier&file=invoicessuppliernbinyear-'.$endyear.'.png'; $px1 = new DolGraph(); $mesg = $px1->isGraphKo(); @@ -186,12 +180,9 @@ class box_graph_invoices_supplier_permonth extends ModeleBoxes if ($showtot) { $data2 = $stats->getAmountByMonthWithPrevYear($endyear, $startyear, (GETPOST('action', 'aZ09') == $refreshaction ?-1 : (3600 * 24)), ($WIDTH < 300 ? 2 : 0), $startmonth); - $filenamenb = $dir."/".$prefix."invoicessupplieramountinyear-".$year.".png"; + $filenamenb = $dir."/".$prefix."invoicessupplieramountinyear-".$endyear.".png"; // default value for customer mode - $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=billstats&file=invoicesamountinyear-'.$year.'.png'; - if ($mode == 'supplier') { - $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=billstatssupplier&file=invoicessupplieramountinyear-'.$year.'.png'; - } + $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=billstatssupplier&file=invoicessupplieramountinyear-'.$endyear.'.png'; $px2 = new DolGraph(); $mesg = $px2->isGraphKo(); @@ -273,17 +264,12 @@ class box_graph_invoices_supplier_permonth extends ModeleBoxes } $this->info_box_contents[0][0] = array('tr'=>'class="oddeven nohover"', 'td' => 'class="nohover center"', 'textnoformat'=>$stringtoshow); } else { - $this->info_box_contents[0][0] = array( - 'tr'=>'class="oddeven nohover"', - 'td' => 'class="nohover left"', - 'maxlength'=>500, - 'text' => $mesg, - ); + $this->info_box_contents[0][0] = array('tr'=>'class="oddeven nohover"', 'td' => 'class="nohover left"', 'maxlength'=>500, 'text' => $mesg); } } else { $this->info_box_contents[0][0] = array( - 'td' => 'class="nohover opacitymedium left"', - 'text' => $langs->trans("ReadPermissionNotAllowed") + 'td' => 'class="nohover left"', + 'text' => ''.$langs->trans("ReadPermissionNotAllowed").'' ); } }