mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2026-02-12 19:02:35 +01:00
Fix: pgsql compatibility
This commit is contained in:
@@ -100,13 +100,14 @@ class CommandeStats extends Stats
|
||||
if (!$user->rights->societe->client->voir && !$this->socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
||||
$sql.= " WHERE date_format(c.date_commande,'%Y') = ".$year;
|
||||
$sql.= " AND ".$this->where;
|
||||
$sql.= " GROUP BY dm DESC";
|
||||
$sql.= " GROUP BY dm";
|
||||
$sql.= $this->db->order('dm','DESC');
|
||||
|
||||
return $this->_getNbByMonth($year, $sql);
|
||||
}
|
||||
|
||||
/**
|
||||
* Renvoie le nombre de commande par ann<EFBFBD>e
|
||||
* Renvoie le nombre de commande par annee
|
||||
*
|
||||
*/
|
||||
function getNbByYear()
|
||||
@@ -118,13 +119,14 @@ class CommandeStats extends Stats
|
||||
$sql.= " FROM ".$this->from;
|
||||
if (!$user->rights->societe->client->voir && !$this->socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
||||
$sql.= " WHERE ".$this->where;
|
||||
$sql.= " GROUP BY dm DESC";
|
||||
$sql.= " GROUP BY dm";
|
||||
$sql.= $this->db->order('dm','DESC');
|
||||
|
||||
return $this->_getNbByYear($sql);
|
||||
}
|
||||
|
||||
/**
|
||||
* Renvoie le nombre de commande par mois pour une ann<EFBFBD>e donn<EFBFBD>e
|
||||
* Renvoie le nombre de commande par mois pour une annee donnee
|
||||
*
|
||||
*/
|
||||
function getAmountByMonth($year)
|
||||
@@ -137,13 +139,14 @@ class CommandeStats extends Stats
|
||||
if (!$user->rights->societe->client->voir && !$this->socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
||||
$sql.= " WHERE date_format(c.date_commande,'%Y') = ".$year;
|
||||
$sql.= " AND ".$this->where;
|
||||
$sql.= " GROUP BY dm DESC";
|
||||
$sql.= " GROUP BY dm";
|
||||
$sql.= $this->db->order('dm','DESC');
|
||||
|
||||
return $this->_getAmountByMonth($year, $sql);
|
||||
}
|
||||
|
||||
/**
|
||||
* Renvoie le nombre de commande par mois pour une ann<EFBFBD>e donn<EFBFBD>e
|
||||
* Renvoie le nombre de commande par mois pour une annee donnee
|
||||
*
|
||||
*/
|
||||
function getAverageByMonth($year)
|
||||
@@ -156,7 +159,8 @@ class CommandeStats extends Stats
|
||||
if (!$user->rights->societe->client->voir && !$this->socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
||||
$sql.= " WHERE date_format(c.date_commande,'%Y') = ".$year;
|
||||
$sql.= " AND ".$this->where;
|
||||
$sql.= " GROUP BY dm DESC";
|
||||
$sql.= " GROUP BY dm";
|
||||
$sql.= $this->db->order('dm','DESC');
|
||||
|
||||
return $this->_getAverageByMonth($year, $sql);
|
||||
}
|
||||
@@ -174,7 +178,8 @@ class CommandeStats extends Stats
|
||||
$sql.= " FROM ".$this->from;
|
||||
if (!$user->rights->societe->client->voir && !$this->socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
||||
$sql.= " WHERE ".$this->where;
|
||||
$sql.= " GROUP BY year DESC";
|
||||
$sql.= " GROUP BY year";
|
||||
$sql.= $this->db->order('year','DESC');
|
||||
|
||||
return $this->_getAllByYear($sql);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user