Qual: Uniformize code.
This commit is contained in:
parent
ead04cbddc
commit
74801a2914
@ -659,7 +659,11 @@ if ($_POST['action'] == "addligne" && $user->rights->propale->creer)
|
|||||||
if ($_POST['action'] == 'updateligne' && $user->rights->propale->creer && $_POST["save"] == $langs->trans("Save"))
|
if ($_POST['action'] == 'updateligne' && $user->rights->propale->creer && $_POST["save"] == $langs->trans("Save"))
|
||||||
{
|
{
|
||||||
$propal = new Propal($db);
|
$propal = new Propal($db);
|
||||||
if (! $propal->fetch($_POST['propalid']) > 0) dolibarr_print_error($db);
|
if (! $propal->fetch($_POST['propalid']) > 0)
|
||||||
|
{
|
||||||
|
dolibarr_print_error($db,$propal->error);
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
|
||||||
// Define info_bits
|
// Define info_bits
|
||||||
$info_bits=0;
|
$info_bits=0;
|
||||||
@ -671,9 +675,12 @@ if ($_POST['action'] == 'updateligne' && $user->rights->propale->creer && $_POST
|
|||||||
|
|
||||||
// On vérifie que le prix minimum est respecté
|
// On vérifie que le prix minimum est respecté
|
||||||
$productid = $_POST['productid'] ;
|
$productid = $_POST['productid'] ;
|
||||||
|
if ($productid)
|
||||||
|
{
|
||||||
$pruduct = new Product($db) ;
|
$pruduct = new Product($db) ;
|
||||||
$pruduct->fetch($productid) ;
|
$res=$pruduct->fetch($productid) ;
|
||||||
if ($pruduct->price_min && ($_POST['productid']!='')&&( price2num($_POST['subprice'])*(1-price2num($_POST['remise_percent'])/100) < price2num($pruduct->price_min)))
|
}
|
||||||
|
if ($productid && $pruduct->price_min && ( price2num($_POST['subprice'])*(1-price2num($_POST['remise_percent'])/100) < price2num($pruduct->price_min)))
|
||||||
{
|
{
|
||||||
$mesg = '<div class="error">'.$langs->trans("CantBeLessThanMinPrice",price2num($pruduct->price_min,'MU').' '.$langs->trans("Currency".$conf->monnaie)).'</div>' ;
|
$mesg = '<div class="error">'.$langs->trans("CantBeLessThanMinPrice",price2num($pruduct->price_min,'MU').' '.$langs->trans("Currency".$conf->monnaie)).'</div>' ;
|
||||||
}
|
}
|
||||||
@ -1913,18 +1920,24 @@ else
|
|||||||
|
|
||||||
if ($result)
|
if ($result)
|
||||||
{
|
{
|
||||||
$num = $db->num_rows($result);
|
|
||||||
$propalstatic=new Propal($db);
|
$propalstatic=new Propal($db);
|
||||||
print_barre_liste($langs->trans('ListOfProposals'), $page,'propal.php','&socid='.$socid.'&viewstatut='.$viewstatut,$sortfield,$sortorder,'',$num);
|
|
||||||
|
$num = $db->num_rows($result);
|
||||||
|
|
||||||
|
$param='&socid='.$socid.'&viewstatut='.$viewstatut;
|
||||||
|
if ($month) $param.='&month='.$month;
|
||||||
|
if ($year) $param.='&year='.$year;
|
||||||
|
print_barre_liste($langs->trans('ListOfProposals'), $page,'propal.php',$param,$sortfield,$sortorder,'',$num);
|
||||||
|
|
||||||
$i = 0;
|
$i = 0;
|
||||||
print '<table class="liste" width="100%">';
|
print '<table class="liste" width="100%">';
|
||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
print_liste_field_titre($langs->trans('Ref'),$_SERVER["PHP_SELF"],'p.ref','','&socid='.$socid.'&viewstatut='.$viewstatut,'',$sortfield,$sortorder);
|
print_liste_field_titre($langs->trans('Ref'),$_SERVER["PHP_SELF"],'p.ref','',$param,'',$sortfield,$sortorder);
|
||||||
print_liste_field_titre($langs->trans('Company'),$_SERVER["PHP_SELF"],'s.nom','','&socid='.$socid.'&viewstatut='.$viewstatut,'',$sortfield,$sortorder);
|
print_liste_field_titre($langs->trans('Company'),$_SERVER["PHP_SELF"],'s.nom','',$param,'',$sortfield,$sortorder);
|
||||||
print_liste_field_titre($langs->trans('Date'),$_SERVER["PHP_SELF"],'p.datep','','&socid='.$socid.'&viewstatut='.$viewstatut, 'align="center"',$sortfield,$sortorder);
|
print_liste_field_titre($langs->trans('Date'),$_SERVER["PHP_SELF"],'p.datep','',$param, 'align="center"',$sortfield,$sortorder);
|
||||||
print_liste_field_titre($langs->trans('DateEndPropalShort'),$_SERVER["PHP_SELF"],'dfv','','&socid='.$socid.'&viewstatut='.$viewstatut, 'align="center"',$sortfield,$sortorder);
|
print_liste_field_titre($langs->trans('DateEndPropalShort'),$_SERVER["PHP_SELF"],'dfv','',$param, 'align="center"',$sortfield,$sortorder);
|
||||||
print_liste_field_titre($langs->trans('Price'),$_SERVER["PHP_SELF"],'p.total_ht','','&socid='.$socid.'&viewstatut='.$viewstatut, 'align="right"',$sortfield,$sortorder);
|
print_liste_field_titre($langs->trans('Price'),$_SERVER["PHP_SELF"],'p.total_ht','',$param, 'align="right"',$sortfield,$sortorder);
|
||||||
print_liste_field_titre($langs->trans('Status'),$_SERVER["PHP_SELF"],'p.fk_statut','','&socid='.$socid.'&viewstatut='.$viewstatut,'align="right"',$sortfield,$sortorder);
|
print_liste_field_titre($langs->trans('Status'),$_SERVER["PHP_SELF"],'p.fk_statut','',$param,'align="right"',$sortfield,$sortorder);
|
||||||
print '<td class="liste_titre"> </td>';
|
print '<td class="liste_titre"> </td>';
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
// Lignes des champs de filtre
|
// Lignes des champs de filtre
|
||||||
@ -1938,12 +1951,11 @@ else
|
|||||||
print '<input class="flat" type="text" size="40" name="search_societe" value="'.$_GET['search_societe'].'">';
|
print '<input class="flat" type="text" size="40" name="search_societe" value="'.$_GET['search_societe'].'">';
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '<td class="liste_titre" colspan="1" align="right">';
|
print '<td class="liste_titre" colspan="1" align="right">';
|
||||||
print $langs->trans('Month').': <input class="flat" type="text" size="2" maxlength="2" name="month" value="'.$month.'">';
|
print $langs->trans('Month').': <input class="flat" type="text" size="1" maxlength="2" name="month" value="'.$month.'">';
|
||||||
print ' '.$langs->trans('Year').': ';
|
print ' '.$langs->trans('Year').': ';
|
||||||
$max_year = date("Y");
|
$max_year = date("Y");
|
||||||
$syear = $year;
|
$syear = $year;
|
||||||
if($syear == '')
|
//if($syear == '') $syear = date("Y");
|
||||||
$syear = date("Y");
|
|
||||||
$html->select_year($syear,'year',1, '', $max_year);
|
$html->select_year($syear,'year',1, '', $max_year);
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '<td class="liste_titre" colspan="1"> </td>';
|
print '<td class="liste_titre" colspan="1"> </td>';
|
||||||
@ -2015,7 +2027,7 @@ else
|
|||||||
// Date fin validite
|
// Date fin validite
|
||||||
if ($objp->dfv)
|
if ($objp->dfv)
|
||||||
{
|
{
|
||||||
print '<td align="center">'.dolibarr_print_date($objp->dfv);
|
print '<td align="center">'.dolibarr_print_date($objp->dfv,'day');
|
||||||
print '</td>';
|
print '</td>';
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|||||||
@ -31,28 +31,46 @@ require_once(DOL_DOCUMENT_ROOT."/core/dolgraph.class.php");
|
|||||||
$WIDTH=500;
|
$WIDTH=500;
|
||||||
$HEIGHT=200;
|
$HEIGHT=200;
|
||||||
|
|
||||||
|
// Sécurité accés client
|
||||||
|
if ($user->societe_id > 0)
|
||||||
|
{
|
||||||
|
$action = '';
|
||||||
|
$socid = $user->societe_id;
|
||||||
|
}
|
||||||
|
|
||||||
|
$year = strftime("%Y", time());
|
||||||
|
$startyear=$year-2;
|
||||||
|
$endyear=$year;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* View
|
||||||
|
*/
|
||||||
|
|
||||||
llxHeader();
|
llxHeader();
|
||||||
|
|
||||||
print_fiche_titre($langs->trans("ProposalsStatistics"), $mesg);
|
print_fiche_titre($langs->trans("ProposalsStatistics"), $mesg);
|
||||||
|
|
||||||
$stats = new PropaleStats($db);
|
$dir=$conf->propal->dir_temp;
|
||||||
$year = strftime("%Y", time());
|
|
||||||
$startyear=$year-2;
|
create_exdir($dir);
|
||||||
$endyear=$year;
|
|
||||||
$data = $stats->getNbByMonthWithPrevYear($endyear,$startyear);
|
$stats = new PropaleStats($db, $socid);
|
||||||
|
|
||||||
|
// Build graphic number of object
|
||||||
|
$data = $stats->getNbByMonthWithPrevYear($endyear,$startyear);
|
||||||
|
//var_dump($data);
|
||||||
|
// $data = array(array('Lib',val1,val2,val3),...)
|
||||||
|
|
||||||
create_exdir($conf->propal->dir_temp);
|
|
||||||
|
|
||||||
if (!$user->rights->societe->client->voir || $user->societe_id)
|
if (!$user->rights->societe->client->voir || $user->societe_id)
|
||||||
{
|
{
|
||||||
$filename = $conf->propal->dir_temp.'/nbpropale2year-'.$user->id.'-'.$year.'.png';
|
$filenamenb = $conf->propal->dir_temp.'/proposalsnbinyear-'.$user->id.'-'.$year.'.png';
|
||||||
$fileurl = DOL_URL_ROOT.'/viewimage.php?modulepart=propalstats&file=nbpropale2year-'.$user->id.'-'.$year.'.png';
|
$fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=propalstats&file=proposalsnbinyear-'.$user->id.'-'.$year.'.png';
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$filename = $conf->propal->dir_temp.'/nbpropale2year-'.$year.'.png';
|
$filenamenb = $conf->propal->dir_temp.'/proposalsnbinyear-'.$year.'.png';
|
||||||
$fileurl = DOL_URL_ROOT.'/viewimage.php?modulepart=propalstats&file=nbpropale2year-'.$year.'.png';
|
$fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=propalstats&file=proposalsnbinyear-'.$year.'.png';
|
||||||
}
|
}
|
||||||
|
|
||||||
$px = new DolGraph();
|
$px = new DolGraph();
|
||||||
@ -69,6 +87,7 @@ if (! $mesg)
|
|||||||
}
|
}
|
||||||
$px->SetLegend($legend);
|
$px->SetLegend($legend);
|
||||||
$px->SetMaxValue($px->GetCeilMaxValue());
|
$px->SetMaxValue($px->GetCeilMaxValue());
|
||||||
|
$px->SetMinValue(min(0,$px->GetFloorMinValue()));
|
||||||
$px->SetWidth($WIDTH);
|
$px->SetWidth($WIDTH);
|
||||||
$px->SetHeight($HEIGHT);
|
$px->SetHeight($HEIGHT);
|
||||||
$px->SetYLabel($langs->trans("NbOfProposals"));
|
$px->SetYLabel($langs->trans("NbOfProposals"));
|
||||||
@ -76,61 +95,110 @@ if (! $mesg)
|
|||||||
$px->SetHorizTickIncrement(1);
|
$px->SetHorizTickIncrement(1);
|
||||||
$px->SetPrecisionY(0);
|
$px->SetPrecisionY(0);
|
||||||
$px->mode='depth';
|
$px->mode='depth';
|
||||||
$px->draw($filename);
|
$px->SetTitle($langs->trans("NbOfProposals"));
|
||||||
|
|
||||||
|
$px->draw($filenamenb);
|
||||||
}
|
}
|
||||||
|
|
||||||
$sql = "SELECT count(*) as nb, date_format(p.datep,'%Y') as dm, sum(p.total) as total_ttc";
|
// Build graphic amount of object
|
||||||
if (!$user->rights->societe->client->voir && !$user->societe_id) $sql .= ", sc.fk_soc, sc.fk_user";
|
$data = $stats->getAmountByMonthWithPrevYear($endyear,$startyear);
|
||||||
$sql.= " FROM ".MAIN_DB_PREFIX."propal as p";
|
//var_dump($data);
|
||||||
if (!$user->rights->societe->client->voir && !$user->societe_id) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
// $data = array(array('Lib',val1,val2,val3),...)
|
||||||
$sql.= " WHERE fk_statut > 0";
|
|
||||||
if (!$user->rights->societe->client->voir && !$user->societe_id) $sql .= " AND p.fk_soc = sc.fk_soc AND sc.fk_user = " .$user->id;
|
|
||||||
if($user->societe_id)
|
|
||||||
{
|
|
||||||
$sql .= " AND p.fk_soc = ".$user->societe_id;
|
|
||||||
}
|
|
||||||
$sql.= " GROUP BY dm DESC ";
|
|
||||||
$result=$db->query($sql);
|
|
||||||
if ($result)
|
|
||||||
{
|
|
||||||
$num = $db->num_rows($result);
|
|
||||||
|
|
||||||
print '<table class="border" width="100%" cellspacing="0" cellpadding="2">';
|
if (!$user->rights->societe->client->voir || $user->societe_id)
|
||||||
print '<tr><td align="center">'.$langs->trans("Year").'</td><td width="10%" align="center">'.$langs->trans("NbOfProposals").'</td><td align="center">'.$langs->trans("AmountTotal").'</td>';
|
|
||||||
print '<td align="center" valign="top" rowspan="'.($num + 1).'">';
|
|
||||||
|
|
||||||
if ($mesg)
|
|
||||||
{
|
{
|
||||||
print "$mesg";
|
$filenameamount = $conf->propal->dir_temp.'/proposalsamountinyear-'.$user->id.'-'.$year.'.png';
|
||||||
|
$fileurlamount = DOL_URL_ROOT.'/viewimage.php?modulepart=propalstats&file=proposalsamountinyear-'.$user->id.'-'.$year.'.png';
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
print '<img src="'.$fileurl.'" alt="Nombre de proposition par mois">';
|
$filenameamount = $conf->propal->dir_temp.'/proposalsamountinyear-'.$year.'.png';
|
||||||
|
$fileurlamount = DOL_URL_ROOT.'/viewimage.php?modulepart=propalstats&file=proposalsamountinyear-'.$year.'.png';
|
||||||
}
|
}
|
||||||
|
|
||||||
print '</td></tr>';
|
$px = new DolGraph();
|
||||||
$i = 0;
|
$mesg = $px->isGraphKo();
|
||||||
while ($i < $num)
|
if (! $mesg)
|
||||||
{
|
{
|
||||||
$obj = $db->fetch_object($result);
|
$px->SetData($data);
|
||||||
$nbproduct = $obj->nb;
|
$px->SetPrecisionY(0);
|
||||||
$year = $obj->dm;
|
$i=$startyear;
|
||||||
print "<tr>";
|
while ($i <= $endyear)
|
||||||
print '<td align="center"><a href="month.php?year='.$year.'">'.$year.'</a></td>';
|
{
|
||||||
print '<td align="center">'.$nbproduct.'</td>';
|
$legend[]=$i;
|
||||||
print '<td align="center">'.price($obj->total_ttc).'</td></tr>';
|
|
||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
|
$px->SetLegend($legend);
|
||||||
|
$px->SetMaxValue($px->GetCeilMaxValue());
|
||||||
|
$px->SetMinValue(min(0,$px->GetFloorMinValue()));
|
||||||
|
$px->SetWidth($WIDTH);
|
||||||
|
$px->SetHeight($HEIGHT);
|
||||||
|
$px->SetYLabel($langs->trans("AmountOfProposals"));
|
||||||
|
$px->SetShading(3);
|
||||||
|
$px->SetHorizTickIncrement(1);
|
||||||
|
$px->SetPrecisionY(0);
|
||||||
|
$px->mode='depth';
|
||||||
|
$px->SetTitle($langs->trans("AmountOfProposalsByMonthHT"));
|
||||||
|
|
||||||
|
$px->draw($filenameamount);
|
||||||
|
}
|
||||||
|
|
||||||
|
print '<table class="notopnoleftnopadd" width="100%"><tr>';
|
||||||
|
print '<td align="center" valign="top">';
|
||||||
|
|
||||||
|
// Show array
|
||||||
|
$data = $stats->getAllByYear();
|
||||||
|
|
||||||
|
print '<table class="border" width="100%">';
|
||||||
|
print '<tr height="24">';
|
||||||
|
print '<td align="center">'.$langs->trans("Year").'</td>';
|
||||||
|
print '<td align="center">'.$langs->trans("NbOfProposals").'</td>';
|
||||||
|
print '<td align="center">'.$langs->trans("AmountTotal").'</td>';
|
||||||
|
print '<td align="center">'.$langs->trans("AmountAverage").'</td>';
|
||||||
|
print '</tr>';
|
||||||
|
|
||||||
|
$oldyear=0;
|
||||||
|
foreach ($data as $val)
|
||||||
|
{
|
||||||
|
$year = $val['year'];
|
||||||
|
print $avg;
|
||||||
|
while ($oldyear > $year+1)
|
||||||
|
{ // If we have empty year
|
||||||
|
$oldyear--;
|
||||||
|
print '<tr height="24">';
|
||||||
|
print '<td align="center"><a href="month.php?year='.$oldyear.'&mode='.$mode.'">'.$oldyear.'</a></td>';
|
||||||
|
print '<td align="right">0</td>';
|
||||||
|
print '<td align="right">0</td>';
|
||||||
|
print '<td align="right">0</td>';
|
||||||
|
print '</tr>';
|
||||||
|
}
|
||||||
|
print '<tr height="24">';
|
||||||
|
print '<td align="center"><a href="month.php?year='.$year.'">'.$year.'</a></td>';
|
||||||
|
print '<td align="right">'.$val['nb'].'</td>';
|
||||||
|
print '<td align="right">'.price(price2num($val['total'],'MT'),1).'</td>';
|
||||||
|
print '<td align="right">'.price(price2num($val['avg'],'MT'),1).'</td>';
|
||||||
|
print '</tr>';
|
||||||
|
$oldyear=$year;
|
||||||
|
}
|
||||||
|
|
||||||
print '</table>';
|
print '</table>';
|
||||||
$db->free($result);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
dolibarr_print_error($db);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
print '</td>';
|
||||||
|
print '<td align="center" valign="top">';
|
||||||
|
|
||||||
|
// Show graphs
|
||||||
|
print '<table class="border" width="100%"><tr valign="top"><td align="center">';
|
||||||
|
if ($mesg) { print $mesg; }
|
||||||
|
else {
|
||||||
|
print '<img src="'.$fileurlnb.'" title="'.$langs->trans("NbOfProposals").'" alt="'.$langs->trans("NbOfProposals").'">';
|
||||||
|
print "<br>\n";
|
||||||
|
print '<img src="'.$fileurlamount.'" title="'.$langs->trans("AmountTotal").'" alt="'.$langs->trans("AmountTotal").'">';
|
||||||
|
}
|
||||||
|
print '</td></tr></table>';
|
||||||
|
|
||||||
|
print '</td></tr></table>';
|
||||||
|
|
||||||
$db->close();
|
$db->close();
|
||||||
|
|
||||||
llxFooter('$Date$ - $Revision$');
|
llxFooter('$Date$ - $Revision$');
|
||||||
|
|||||||
@ -28,39 +28,48 @@ require("./pre.inc.php");
|
|||||||
require_once(DOL_DOCUMENT_ROOT."/comm/propal/stats/propalestats.class.php");
|
require_once(DOL_DOCUMENT_ROOT."/comm/propal/stats/propalestats.class.php");
|
||||||
require_once(DOL_DOCUMENT_ROOT."/core/dolgraph.class.php");
|
require_once(DOL_DOCUMENT_ROOT."/core/dolgraph.class.php");
|
||||||
|
|
||||||
|
$GRAPHWIDTH=500;
|
||||||
|
$GRAPHHEIGHT=200;
|
||||||
|
|
||||||
|
// Check security access
|
||||||
|
if ($user->societe_id > 0)
|
||||||
|
{
|
||||||
|
$action = '';
|
||||||
|
$socid = $user->societe_id;
|
||||||
|
}
|
||||||
|
|
||||||
|
$year = isset($_GET["year"])?$_GET["year"]:date("Y",time());
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* View
|
||||||
|
*/
|
||||||
|
|
||||||
llxHeader();
|
llxHeader();
|
||||||
|
|
||||||
$year = isset($_GET["year"])?$_GET["year"]:date("Y",time());
|
$dir=$conf->propal->dir_temp;
|
||||||
|
|
||||||
$mesg = '<a href="month.php?year='.($year - 1).'">'.img_previous().'</a> ';
|
$mesg = '<a href="month.php?year='.($year - 1).'">'.img_previous().'</a> ';
|
||||||
$mesg.= $langs->trans("Year")." $year";
|
$mesg.= $langs->trans("Year")." $year";
|
||||||
$mesg.= ' <a href="month.php?year='.($year + 1).'">'.img_next().'</a>';
|
$mesg.= ' <a href="month.php?year='.($year + 1).'">'.img_next().'</a>';
|
||||||
|
|
||||||
$WIDTH=500;
|
|
||||||
$HEIGHT=200;
|
|
||||||
|
|
||||||
/*
|
|
||||||
*
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
print_fiche_titre($langs->trans("ProposalsStatistics"), $mesg);
|
print_fiche_titre($langs->trans("ProposalsStatistics"), $mesg);
|
||||||
|
|
||||||
$stats = new PropaleStats($db);
|
create_exdir($dir);
|
||||||
$data = $stats->getNbByMonth($year);
|
|
||||||
|
|
||||||
create_exdir($conf->propal->dir_temp);
|
$stats = new PropaleStats($db, $socid);
|
||||||
|
|
||||||
|
|
||||||
|
$data = $stats->getNbByMonth($year);
|
||||||
|
|
||||||
if (!$user->rights->societe->client->voir || $user->societe_id)
|
if (!$user->rights->societe->client->voir || $user->societe_id)
|
||||||
{
|
{
|
||||||
$filename = $conf->propal->dir_temp.'/propale-'.$user->id.'-'.$year.'.png';
|
$filename = $dir.'/proposalsnb-'.$user->id.'-'.$year.'.png';
|
||||||
$fileurl = DOL_URL_ROOT.'/viewimage.php?modulepart=propalstats&file=propale-'.$user->id.'-'.$year.'.png';
|
$fileurl = DOL_URL_ROOT.'/viewimage.php?modulepart=propalstats&file=proposalsnb-'.$user->id.'-'.$year.'.png';
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$filename = $conf->propal->dir_temp.'/propale'.$year.'.png';
|
$filename = $dir.'/proposalsnb-'.$year.'.png';
|
||||||
$fileurl = DOL_URL_ROOT.'/viewimage.php?modulepart=propalstats&file=propale'.$year.'.png';
|
$fileurl = DOL_URL_ROOT.'/viewimage.php?modulepart=propalstats&file=proposalsnb-'.$year.'.png';
|
||||||
}
|
}
|
||||||
|
|
||||||
$px = new DolGraph();
|
$px = new DolGraph();
|
||||||
@ -68,34 +77,29 @@ $mesg = $px->isGraphKo();
|
|||||||
if (! $mesg)
|
if (! $mesg)
|
||||||
{
|
{
|
||||||
$px->SetData($data);
|
$px->SetData($data);
|
||||||
$px->SetPrecisionY(0);
|
|
||||||
$px->SetMaxValue($px->GetCeilMaxValue());
|
$px->SetMaxValue($px->GetCeilMaxValue());
|
||||||
$px->SetWidth($WIDTH);
|
$px->SetMinValue($px->GetFloorMinValue());
|
||||||
$px->SetHeight($HEIGHT);
|
$px->SetWidth($GRAPHWIDTH);
|
||||||
|
$px->SetHeight($GRAPHHEIGHT);
|
||||||
$px->SetShading(3);
|
$px->SetShading(3);
|
||||||
$px->SetHorizTickIncrement(1);
|
$px->SetHorizTickIncrement(1);
|
||||||
$px->SetPrecisionY(0);
|
$px->SetPrecisionY(0);
|
||||||
$px->draw($filename);
|
$px->draw($filename);
|
||||||
}
|
}
|
||||||
|
|
||||||
$res = $stats->getAmountByMonth($year);
|
|
||||||
|
|
||||||
$data = array();
|
|
||||||
|
|
||||||
for ($i = 1 ; $i < 13 ; $i++)
|
$data = $stats->getAmountByMonth($year);
|
||||||
{
|
|
||||||
$data[$i-1] = array(ucfirst(substr(strftime("%b",dolibarr_mktime(12,12,12,$i,1,$year)),0,3)), $res[$i]);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!$user->rights->societe->client->voir || $user->societe_id)
|
if (!$user->rights->societe->client->voir || $user->societe_id)
|
||||||
{
|
{
|
||||||
$filename_amount = $conf->propal->dir_temp.'/propaleamount-'.$user->id.'-'.$year.'.png';
|
$filename_amount = $dir.'/proposalsamount-'.$user->id.'-'.$year.'.png';
|
||||||
$fileurl_amount = DOL_URL_ROOT.'/viewimage.php?modulepart=propalstats&file=propaleamount-'.$user->id.'-'.$year.'.png';
|
$fileurl_amount = DOL_URL_ROOT.'/viewimage.php?modulepart=propalstats&file=proposalsamount-'.$user->id.'-'.$year.'.png';
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$filename_amount = $conf->propal->dir_temp.'/propaleamount'.$year.'.png';
|
$filename_amount = $dir.'/proposalsamount-'.$year.'.png';
|
||||||
$fileurl_amount = DOL_URL_ROOT.'/viewimage.php?modulepart=propalstats&file=propaleamount'.$year.'.png';
|
$fileurl_amount = DOL_URL_ROOT.'/viewimage.php?modulepart=propalstats&file=proposalsamount-'.$year.'.png';
|
||||||
}
|
}
|
||||||
|
|
||||||
$px = new DolGraph();
|
$px = new DolGraph();
|
||||||
@ -103,16 +107,18 @@ $mesg = $px->isGraphKo();
|
|||||||
if (! $mesg)
|
if (! $mesg)
|
||||||
{
|
{
|
||||||
$px->SetData($data);
|
$px->SetData($data);
|
||||||
$px->SetPrecisionY(0);
|
|
||||||
$px->SetYLabel($langs->trans("AmountTotal"));
|
$px->SetYLabel($langs->trans("AmountTotal"));
|
||||||
$px->SetMaxValue($px->GetCeilMaxValue());
|
$px->SetMaxValue($px->GetCeilMaxValue());
|
||||||
$px->SetWidth($WIDTH);
|
$px->SetMinValue($px->GetFloorMinValue());
|
||||||
$px->SetHeight($HEIGHT);
|
$px->SetWidth($GRAPHWIDTH);
|
||||||
|
$px->SetHeight($GRAPHHEIGHT);
|
||||||
$px->SetShading(3);
|
$px->SetShading(3);
|
||||||
$px->SetHorizTickIncrement(1);
|
$px->SetHorizTickIncrement(1);
|
||||||
$px->SetPrecisionY(0);
|
$px->SetPrecisionY(0);
|
||||||
$px->draw($filename_amount, $data, $year);
|
$px->draw($filename_amount);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
$res = $stats->getAverageByMonth($year);
|
$res = $stats->getAverageByMonth($year);
|
||||||
|
|
||||||
$data = array();
|
$data = array();
|
||||||
@ -124,13 +130,13 @@ for ($i = 1 ; $i < 13 ; $i++)
|
|||||||
|
|
||||||
if (!$user->rights->societe->client->voir || $user->societe_id)
|
if (!$user->rights->societe->client->voir || $user->societe_id)
|
||||||
{
|
{
|
||||||
$filename_avg = $conf->propal->dir_temp.'/propaleaverage-'.$user->id.'-'.$year.'.png';
|
$filename_avg = $dir.'/proposalsaverage-'.$user->id.'-'.$year.'.png';
|
||||||
$fileurl_avg = DOL_URL_ROOT.'/viewimage.php?modulepart=propalstats&file=propaleaverage-'.$user->id.'-'.$year.'.png';
|
$fileurl_avg = DOL_URL_ROOT.'/viewimage.php?modulepart=propalstats&file=proposalsaverage-'.$user->id.'-'.$year.'.png';
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$filename_avg = $conf->propal->dir_temp.'/propaleaverage'.$year.'.png';
|
$filename_avg = $dir.'/proposalsaverage-'.$year.'.png';
|
||||||
$fileurl_avg = DOL_URL_ROOT.'/viewimage.php?modulepart=propalstats&file=propaleaverage'.$year.'.png';
|
$fileurl_avg = DOL_URL_ROOT.'/viewimage.php?modulepart=propalstats&file=proposalsaverage-'.$year.'.png';
|
||||||
}
|
}
|
||||||
|
|
||||||
$px = new DolGraph();
|
$px = new DolGraph();
|
||||||
@ -141,8 +147,9 @@ if (! $mesg)
|
|||||||
$px->SetPrecisionY(0);
|
$px->SetPrecisionY(0);
|
||||||
$px->SetYLabel($langs->trans("AmountAverage"));
|
$px->SetYLabel($langs->trans("AmountAverage"));
|
||||||
$px->SetMaxValue($px->GetCeilMaxValue());
|
$px->SetMaxValue($px->GetCeilMaxValue());
|
||||||
$px->SetWidth($WIDTH);
|
$px->SetMinValue($px->GetFloorMinValue());
|
||||||
$px->SetHeight($HEIGHT);
|
$px->SetWidth($GRAPHWIDTH);
|
||||||
|
$px->SetHeight($GRAPHHEIGHT);
|
||||||
$px->SetShading(3);
|
$px->SetShading(3);
|
||||||
$px->SetHorizTickIncrement(1);
|
$px->SetHorizTickIncrement(1);
|
||||||
$px->SetPrecisionY(0);
|
$px->SetPrecisionY(0);
|
||||||
|
|||||||
@ -15,32 +15,58 @@
|
|||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program; if not, write to the Free Software
|
* along with this program; if not, write to the Free Software
|
||||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
*
|
|
||||||
* $Id$
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
\file htdocs/comm/propal/stats/propalestats.class.php
|
* \file htdocs/comm/propal/stats/propalestats.class.php
|
||||||
\ingroup propales
|
* \ingroup propales
|
||||||
\brief Fichier de la classe de gestion des stats des propales
|
* \brief Fichier de la classe de gestion des stats des propales
|
||||||
\version $Revision$
|
* \version $Id$
|
||||||
*/
|
*/
|
||||||
|
|
||||||
include_once DOL_DOCUMENT_ROOT . "/stats.class.php";
|
include_once DOL_DOCUMENT_ROOT . "/stats.class.php";
|
||||||
|
include_once DOL_DOCUMENT_ROOT . "/propal.class.php";
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
\class PropaleStats
|
* \class PropaleStats
|
||||||
\brief Classe permettant la gestion des stats des propales
|
* \brief Classe permettant la gestion des stats des propales
|
||||||
*/
|
*/
|
||||||
|
|
||||||
class PropaleStats extends Stats
|
class PropaleStats extends Stats
|
||||||
{
|
{
|
||||||
var $db ;
|
var $db ;
|
||||||
|
|
||||||
function PropaleStats($DB)
|
var $socid;
|
||||||
|
var $where;
|
||||||
|
|
||||||
|
var $table_element;
|
||||||
|
var $field;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Constructor
|
||||||
|
*
|
||||||
|
* @param $DB Database handler
|
||||||
|
* @param $socid Id third party
|
||||||
|
* @return PropaleStats
|
||||||
|
*/
|
||||||
|
function PropaleStats($DB, $socid=0)
|
||||||
{
|
{
|
||||||
|
global $user;
|
||||||
|
|
||||||
$this->db = $DB;
|
$this->db = $DB;
|
||||||
|
|
||||||
|
$object=new Propal($this->db);
|
||||||
|
$this->table_element=$object->table_element;
|
||||||
|
$this->field='total';
|
||||||
|
|
||||||
|
$this->socid = $socid;
|
||||||
|
$this->where.= " fk_statut > 0";
|
||||||
|
if (!$user->rights->societe->client->voir && !$user->societe_id) $this->where .= " AND p.fk_soc = sc.fk_soc AND sc.fk_user = " .$user->id;
|
||||||
|
if($this->socid)
|
||||||
|
{
|
||||||
|
$this->where .= " AND p.fk_soc = ".$this->socid;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -133,6 +159,25 @@ class PropaleStats extends Stats
|
|||||||
|
|
||||||
return $this->_getAverageByMonth($year, $sql);
|
return $this->_getAverageByMonth($year, $sql);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Return nb, total and average
|
||||||
|
* \return array Array of values
|
||||||
|
*/
|
||||||
|
function getAllByYear()
|
||||||
|
{
|
||||||
|
global $user;
|
||||||
|
|
||||||
|
$sql = "SELECT date_format(p.datep,'%Y') as year, count(*) as nb, sum(".$this->field.") as total, avg(".$this->field.") as avg";
|
||||||
|
if (!$user->rights->societe->client->voir && !$user->societe_id) $sql .= ", sc.fk_soc, sc.fk_user";
|
||||||
|
$sql.= " FROM ".MAIN_DB_PREFIX."propal as p";
|
||||||
|
if (!$user->rights->societe->client->voir && !$user->societe_id) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
||||||
|
$sql.= " WHERE ".$this->where;
|
||||||
|
$sql.= " GROUP BY year DESC";
|
||||||
|
|
||||||
|
return $this->_getAllByYear($sql);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
?>
|
?>
|
||||||
|
|||||||
@ -41,6 +41,14 @@ class FactureStats extends Stats
|
|||||||
var $table_element;
|
var $table_element;
|
||||||
var $field;
|
var $field;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Constructor
|
||||||
|
*
|
||||||
|
* @param $DB Database handler
|
||||||
|
* @param $socid Id third party
|
||||||
|
* @param $mode Option
|
||||||
|
* @return FactureStats
|
||||||
|
*/
|
||||||
function FactureStats($DB, $socid=0, $mode)
|
function FactureStats($DB, $socid=0, $mode)
|
||||||
{
|
{
|
||||||
$this->db = $DB;
|
$this->db = $DB;
|
||||||
|
|||||||
@ -69,14 +69,14 @@ create_exdir($dir);
|
|||||||
$stats = new FactureStats($db, $socid, $mode);
|
$stats = new FactureStats($db, $socid, $mode);
|
||||||
|
|
||||||
|
|
||||||
// Build graphic number of invoices
|
// Build graphic number of object
|
||||||
$data = $stats->getNbByMonthWithPrevYear($endyear,$startyear);
|
$data = $stats->getNbByMonthWithPrevYear($endyear,$startyear);
|
||||||
//var_dump($data);
|
//var_dump($data);
|
||||||
// $data = array(array('Lib',val1,val2,val3),...)
|
// $data = array(array('Lib',val1,val2,val3),...)
|
||||||
|
|
||||||
$filenamenbinvoices = $dir."/invoicesnbinyear-".$year.".png";
|
$filenamenb = $dir."/invoicesnbinyear-".$year.".png";
|
||||||
if ($mode == 'customer') $fileurlnbinvoices = DOL_URL_ROOT.'/viewimage.php?modulepart=billstats&file=invoicesnbinyear-'.$year.'.png';
|
if ($mode == 'customer') $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=billstats&file=invoicesnbinyear-'.$year.'.png';
|
||||||
if ($mode == 'supplier') $fileurlnbinvoices = DOL_URL_ROOT.'/viewimage.php?modulepart=billstatssupplier&file=invoicesnbinyear-'.$year.'.png';
|
if ($mode == 'supplier') $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=billstatssupplier&file=invoicesnbinyear-'.$year.'.png';
|
||||||
|
|
||||||
$px = new DolGraph();
|
$px = new DolGraph();
|
||||||
$mesg = $px->isGraphKo();
|
$mesg = $px->isGraphKo();
|
||||||
@ -101,17 +101,17 @@ if (! $mesg)
|
|||||||
$px->mode='depth';
|
$px->mode='depth';
|
||||||
$px->SetTitle($langs->trans("NumberOfBillsByMonth"));
|
$px->SetTitle($langs->trans("NumberOfBillsByMonth"));
|
||||||
|
|
||||||
$px->draw($filenamenbinvoices);
|
$px->draw($filenamenb);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Build graphic amount of invoices
|
// Build graphic amount of object
|
||||||
$data = $stats->getAmountByMonthWithPrevYear($endyear,$startyear);
|
$data = $stats->getAmountByMonthWithPrevYear($endyear,$startyear);
|
||||||
//var_dump($data);
|
//var_dump($data);
|
||||||
// $data = array(array('Lib',val1,val2,val3),...)
|
// $data = array(array('Lib',val1,val2,val3),...)
|
||||||
|
|
||||||
$filenameamountinvoices = $dir."/invoicesamountinyear-".$year.".png";
|
$filenameamount = $dir."/invoicesamountinyear-".$year.".png";
|
||||||
if ($mode == 'customer') $fileurlamountinvoices = DOL_URL_ROOT.'/viewimage.php?modulepart=billstats&file=invoicesamountinyear-'.$year.'.png';
|
if ($mode == 'customer') $fileurlamount = DOL_URL_ROOT.'/viewimage.php?modulepart=billstats&file=invoicesamountinyear-'.$year.'.png';
|
||||||
if ($mode == 'supplier') $fileurlamountinvoices = DOL_URL_ROOT.'/viewimage.php?modulepart=billstatssupplier&file=invoicesamountinyear-'.$year.'.png';
|
if ($mode == 'supplier') $fileurlamount = DOL_URL_ROOT.'/viewimage.php?modulepart=billstatssupplier&file=invoicesamountinyear-'.$year.'.png';
|
||||||
|
|
||||||
$px = new DolGraph();
|
$px = new DolGraph();
|
||||||
$mesg = $px->isGraphKo();
|
$mesg = $px->isGraphKo();
|
||||||
@ -137,7 +137,7 @@ if (! $mesg)
|
|||||||
$px->mode='depth';
|
$px->mode='depth';
|
||||||
$px->SetTitle($langs->trans("AmountOfBillsByMonthHT"));
|
$px->SetTitle($langs->trans("AmountOfBillsByMonthHT"));
|
||||||
|
|
||||||
$px->draw($filenameamountinvoices);
|
$px->draw($filenameamount);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -192,9 +192,9 @@ print '<td align="center" valign="top">';
|
|||||||
print '<table class="border" width="100%"><tr valign="top"><td align="center">';
|
print '<table class="border" width="100%"><tr valign="top"><td align="center">';
|
||||||
if ($mesg) { print $mesg; }
|
if ($mesg) { print $mesg; }
|
||||||
else {
|
else {
|
||||||
print '<img src="'.$fileurlnbinvoices.'" title="'.$langs->trans("NumberOfBills").'" alt="'.$langs->trans("NumberOfBills").'">';
|
print '<img src="'.$fileurlnb.'" title="'.$langs->trans("NumberOfBills").'" alt="'.$langs->trans("NumberOfBills").'">';
|
||||||
print "<br>\n";
|
print "<br>\n";
|
||||||
print '<img src="'.$fileurlamountinvoices.'" title="'.$langs->trans("AmountOfBills").'" alt="'.$langs->trans("AmountOfBills").'">';
|
print '<img src="'.$fileurlamount.'" title="'.$langs->trans("AmountOfBills").'" alt="'.$langs->trans("AmountOfBills").'">';
|
||||||
}
|
}
|
||||||
print '</td></tr></table>';
|
print '</td></tr></table>';
|
||||||
|
|
||||||
|
|||||||
@ -73,9 +73,9 @@ $stats = new FactureStats($db, $socid, $mode);
|
|||||||
|
|
||||||
$data = $stats->getNbByMonth($year);
|
$data = $stats->getNbByMonth($year);
|
||||||
|
|
||||||
$filename = $dir."/invoices-".$year.".png";
|
$filename = $dir."/invoicesnb-".$year.".png";
|
||||||
if ($mode == 'customer') $fileurl = DOL_URL_ROOT.'/viewimage.php?modulepart=billstats&file=invoices-'.$year.'.png';
|
if ($mode == 'customer') $fileurl = DOL_URL_ROOT.'/viewimage.php?modulepart=billstats&file=invoicesnb-'.$year.'.png';
|
||||||
if ($mode == 'supplier') $fileurl = DOL_URL_ROOT.'/viewimage.php?modulepart=billstatssupplier&file=invoices-'.$year.'.png';
|
if ($mode == 'supplier') $fileurl = DOL_URL_ROOT.'/viewimage.php?modulepart=billstatssupplier&file=invoicesnb-'.$year.'.png';
|
||||||
|
|
||||||
$px = new DolGraph();
|
$px = new DolGraph();
|
||||||
$mesg = $px->isGraphKo();
|
$mesg = $px->isGraphKo();
|
||||||
@ -84,7 +84,6 @@ if (! $mesg)
|
|||||||
$px->SetData($data);
|
$px->SetData($data);
|
||||||
$px->SetMaxValue($px->GetCeilMaxValue());
|
$px->SetMaxValue($px->GetCeilMaxValue());
|
||||||
$px->SetMinValue($px->GetFloorMinValue());
|
$px->SetMinValue($px->GetFloorMinValue());
|
||||||
$px->SetPrecisionY(0);
|
|
||||||
$px->SetWidth($GRAPHWIDTH);
|
$px->SetWidth($GRAPHWIDTH);
|
||||||
$px->SetHeight($GRAPHHEIGHT);
|
$px->SetHeight($GRAPHHEIGHT);
|
||||||
$px->SetShading(3);
|
$px->SetShading(3);
|
||||||
@ -109,7 +108,6 @@ if (! $mesg)
|
|||||||
$px->SetYLabel($langs->trans("AmountTotal"));
|
$px->SetYLabel($langs->trans("AmountTotal"));
|
||||||
$px->SetMaxValue($px->GetCeilMaxValue());
|
$px->SetMaxValue($px->GetCeilMaxValue());
|
||||||
$px->SetMinValue($px->GetFloorMinValue());
|
$px->SetMinValue($px->GetFloorMinValue());
|
||||||
$px->SetPrecisionY(0);
|
|
||||||
$px->SetWidth($GRAPHWIDTH);
|
$px->SetWidth($GRAPHWIDTH);
|
||||||
$px->SetHeight($GRAPHHEIGHT);
|
$px->SetHeight($GRAPHHEIGHT);
|
||||||
$px->SetShading(3);
|
$px->SetShading(3);
|
||||||
@ -144,7 +142,7 @@ if (! $mesg)
|
|||||||
$px->SetMinValue($px->GetFloorMinValue());
|
$px->SetMinValue($px->GetFloorMinValue());
|
||||||
$px->SetWidth($GRAPHWIDTH);
|
$px->SetWidth($GRAPHWIDTH);
|
||||||
$px->SetHeight($GRAPHHEIGHT);
|
$px->SetHeight($GRAPHHEIGHT);
|
||||||
$px->SetShading(5);
|
$px->SetShading(3);
|
||||||
$px->SetHorizTickIncrement(1);
|
$px->SetHorizTickIncrement(1);
|
||||||
$px->SetPrecisionY(0);
|
$px->SetPrecisionY(0);
|
||||||
$px->draw($filename_avg);
|
$px->draw($filename_avg);
|
||||||
|
|||||||
@ -37,10 +37,9 @@ require_once(DOL_DOCUMENT_ROOT ."/contact.class.php");
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
\class Propal
|
* \class Propal
|
||||||
\brief Classe permettant la gestion des propales
|
* \brief Classe permettant la gestion des propales
|
||||||
*/
|
*/
|
||||||
|
|
||||||
class Propal extends CommonObject
|
class Propal extends CommonObject
|
||||||
{
|
{
|
||||||
var $db;
|
var $db;
|
||||||
@ -95,9 +94,9 @@ class Propal extends CommonObject
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief Constructeur
|
* \brief Constructeur
|
||||||
* \param DB Handler d'acc<EFBFBD>s base
|
* \param DB Database handler
|
||||||
* \param socid Id de la soci<EFBFBD>t<EFBFBD>
|
* \param socid Id third party
|
||||||
* \param propalid Id de la propal
|
* \param propalid Id proposal
|
||||||
*/
|
*/
|
||||||
function Propal($DB, $socid="", $propalid=0)
|
function Propal($DB, $socid="", $propalid=0)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -111,6 +111,7 @@ class Stats
|
|||||||
{
|
{
|
||||||
$result = array();
|
$result = array();
|
||||||
|
|
||||||
|
dolibarr_syslog("Stats::_getNbByYear sql=".$sql);
|
||||||
$resql=$this->db->query($sql);
|
$resql=$this->db->query($sql);
|
||||||
if ($resql)
|
if ($resql)
|
||||||
{
|
{
|
||||||
@ -139,6 +140,7 @@ class Stats
|
|||||||
{
|
{
|
||||||
$result = array();
|
$result = array();
|
||||||
|
|
||||||
|
dolibarr_syslog("Stats::_getAllByYear sql=".$sql);
|
||||||
$resql=$this->db->query($sql);
|
$resql=$this->db->query($sql);
|
||||||
if ($resql)
|
if ($resql)
|
||||||
{
|
{
|
||||||
@ -169,8 +171,8 @@ class Stats
|
|||||||
{
|
{
|
||||||
$result = array();
|
$result = array();
|
||||||
|
|
||||||
$resql=$this->db->query($sql);
|
|
||||||
dolibarr_syslog("Stats::_getNbByMonth sql=".$sql);
|
dolibarr_syslog("Stats::_getNbByMonth sql=".$sql);
|
||||||
|
$resql=$this->db->query($sql);
|
||||||
if ($resql)
|
if ($resql)
|
||||||
{
|
{
|
||||||
$num = $this->db->num_rows($resql);
|
$num = $this->db->num_rows($resql);
|
||||||
@ -248,7 +250,7 @@ class Stats
|
|||||||
{
|
{
|
||||||
$result = array();
|
$result = array();
|
||||||
|
|
||||||
dolibarr_syslog("Stats::_getAmountByMonth sql=".$sql);
|
dolibarr_syslog("Stats::_getAverageByMonth sql=".$sql);
|
||||||
$resql=$this->db->query($sql);
|
$resql=$this->db->query($sql);
|
||||||
if ($resql)
|
if ($resql)
|
||||||
{
|
{
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user