mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2026-01-03 23:52:24 +01:00
Fix warnings
This commit is contained in:
@@ -70,7 +70,7 @@ class ReceptionStats extends Stats
|
||||
|
||||
//$this->where.= " AND c.fk_soc = s.rowid AND c.entity = ".$conf->entity;
|
||||
$this->where .= " AND c.entity IN (".getEntity('reception').")";
|
||||
if (empty($user->rights->societe->client->voir) && !$this->socid) {
|
||||
if (!$user->hasRight('societe', 'client', 'voir') && !$this->socid) {
|
||||
$this->where .= " AND c.fk_soc = sc.fk_soc AND sc.fk_user = ".((int) $user->id);
|
||||
}
|
||||
if ($this->socid) {
|
||||
@@ -94,7 +94,7 @@ class ReceptionStats extends Stats
|
||||
|
||||
$sql = "SELECT date_format(c.date_valid,'%m') as dm, COUNT(*) as nb";
|
||||
$sql .= " FROM ".$this->from;
|
||||
if (empty($user->rights->societe->client->voir) && !$this->socid) {
|
||||
if (!$user->hasRight('societe', 'client', 'voir') && !$this->socid) {
|
||||
$sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
||||
}
|
||||
$sql .= " WHERE c.date_valid BETWEEN '".$this->db->idate(dol_get_first_day($year))."' AND '".$this->db->idate(dol_get_last_day($year))."'";
|
||||
@@ -118,7 +118,7 @@ class ReceptionStats extends Stats
|
||||
|
||||
$sql = "SELECT date_format(c.date_valid,'%Y') as dm, COUNT(*) as nb, SUM(c.".$this->field.")";
|
||||
$sql .= " FROM ".$this->from;
|
||||
if (empty($user->rights->societe->client->voir) && !$this->socid) {
|
||||
if (!$user->hasRight('societe', 'client', 'voir') && !$this->socid) {
|
||||
$sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
||||
}
|
||||
$sql .= " WHERE ".$this->where;
|
||||
@@ -141,7 +141,7 @@ class ReceptionStats extends Stats
|
||||
|
||||
$sql = "SELECT date_format(c.date_valid,'%m') as dm, SUM(c.".$this->field.")";
|
||||
$sql .= " FROM ".$this->from;
|
||||
if (empty($user->rights->societe->client->voir) && !$this->socid) {
|
||||
if (!$user->hasRight('societe', 'client', 'voir') && !$this->socid) {
|
||||
$sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
||||
}
|
||||
$sql .= " WHERE c.date_valid BETWEEN '".$this->db->idate(dol_get_first_day($year))."' AND '".$this->db->idate(dol_get_last_day($year))."'";
|
||||
@@ -165,7 +165,7 @@ class ReceptionStats extends Stats
|
||||
|
||||
$sql = "SELECT date_format(c.date_valid,'%m') as dm, AVG(c.".$this->field.")";
|
||||
$sql .= " FROM ".$this->from;
|
||||
if (empty($user->rights->societe->client->voir) && !$this->socid) {
|
||||
if (!$user->hasRight('societe', 'client', 'voir') && !$this->socid) {
|
||||
$sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
||||
}
|
||||
$sql .= " WHERE c.date_valid BETWEEN '".$this->db->idate(dol_get_first_day($year))."' AND '".$this->db->idate(dol_get_last_day($year))."'";
|
||||
@@ -187,7 +187,7 @@ class ReceptionStats extends Stats
|
||||
|
||||
$sql = "SELECT date_format(c.date_valid,'%Y') as year, COUNT(*) as nb, SUM(c.".$this->field.") as total, AVG(".$this->field.") as avg";
|
||||
$sql .= " FROM ".$this->from;
|
||||
if (empty($user->rights->societe->client->voir) && !$this->socid) {
|
||||
if (!$user->hasRight('societe', 'client', 'voir') && !$this->socid) {
|
||||
$sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
||||
}
|
||||
$sql .= " WHERE ".$this->where;
|
||||
|
||||
Reference in New Issue
Block a user