Qual: Uniformize code.
This commit is contained in:
parent
e461753e43
commit
b49d7f5390
@ -64,12 +64,12 @@ $data = $stats->getNbByMonthWithPrevYear($endyear,$startyear);
|
||||
|
||||
if (!$user->rights->societe->client->voir || $user->societe_id)
|
||||
{
|
||||
$filenamenb = $conf->propal->dir_temp.'/proposalsnbinyear-'.$user->id.'-'.$year.'.png';
|
||||
$filenamenb = $dir.'/proposalsnbinyear-'.$user->id.'-'.$year.'.png';
|
||||
$fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=propalstats&file=proposalsnbinyear-'.$user->id.'-'.$year.'.png';
|
||||
}
|
||||
else
|
||||
{
|
||||
$filenamenb = $conf->propal->dir_temp.'/proposalsnbinyear-'.$year.'.png';
|
||||
$filenamenb = $dir.'/proposalsnbinyear-'.$year.'.png';
|
||||
$fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=propalstats&file=proposalsnbinyear-'.$year.'.png';
|
||||
}
|
||||
|
||||
@ -107,12 +107,12 @@ $data = $stats->getAmountByMonthWithPrevYear($endyear,$startyear);
|
||||
|
||||
if (!$user->rights->societe->client->voir || $user->societe_id)
|
||||
{
|
||||
$filenameamount = $conf->propal->dir_temp.'/proposalsamountinyear-'.$user->id.'-'.$year.'.png';
|
||||
$filenameamount = $dir.'/proposalsamountinyear-'.$user->id.'-'.$year.'.png';
|
||||
$fileurlamount = DOL_URL_ROOT.'/viewimage.php?modulepart=propalstats&file=proposalsamountinyear-'.$user->id.'-'.$year.'.png';
|
||||
}
|
||||
else
|
||||
{
|
||||
$filenameamount = $conf->propal->dir_temp.'/proposalsamountinyear-'.$year.'.png';
|
||||
$filenameamount = $dir.'/proposalsamountinyear-'.$year.'.png';
|
||||
$fileurlamount = DOL_URL_ROOT.'/viewimage.php?modulepart=propalstats&file=proposalsamountinyear-'.$year.'.png';
|
||||
}
|
||||
|
||||
|
||||
@ -114,7 +114,7 @@ class PropaleStats extends Stats
|
||||
{
|
||||
global $user;
|
||||
|
||||
$sql = "SELECT date_format(p.datep,'%m') as dm, sum(p.total_ht)";
|
||||
$sql = "SELECT date_format(p.datep,'%m') as dm, sum(p.".$this->field.")";
|
||||
if (!$user->rights->societe->client->voir && !$user->societe_id) $sql .= ", sc.fk_soc, sc.fk_user";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX.$this->table_element." as p";
|
||||
if (!$user->rights->societe->client->voir && !$user->societe_id) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
||||
@ -132,7 +132,7 @@ class PropaleStats extends Stats
|
||||
{
|
||||
global $user;
|
||||
|
||||
$sql = "SELECT date_format(p.datep,'%m') as dm, avg(p.total_ht)";
|
||||
$sql = "SELECT date_format(p.datep,'%m') as dm, avg(p.".$this->field.")";
|
||||
if (!$user->rights->societe->client->voir && !$this->socid) $sql .= ", sc.fk_soc, sc.fk_user";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX.$this->table_element." as p";
|
||||
if (!$user->rights->societe->client->voir && !$this->socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
||||
|
||||
Loading…
Reference in New Issue
Block a user