diff --git a/htdocs/core/class/html.formprojet.class.php b/htdocs/core/class/html.formprojet.class.php
index 47bbdec0fb2..e6a580a7f71 100644
--- a/htdocs/core/class/html.formprojet.class.php
+++ b/htdocs/core/class/html.formprojet.class.php
@@ -372,7 +372,7 @@ class FormProjets
include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
$comboenhancement = ajax_combobox($htmlname, '', 0, $forcefocus);
$out .= $comboenhancement;
- $morecss = 'minwidth200 maxwidth500';
+ $morecss .= ' minwidth200 maxwidth500';
}
if (empty($option_only)) {
diff --git a/htdocs/expedition/class/expeditionstats.class.php b/htdocs/expedition/class/expeditionstats.class.php
index 8eb31896f38..aa4e40fcb8f 100644
--- a/htdocs/expedition/class/expeditionstats.class.php
+++ b/htdocs/expedition/class/expeditionstats.class.php
@@ -131,6 +131,54 @@ class ExpeditionStats extends Stats
return $this->_getNbByYear($sql);
}
+ /**
+ * Return the orders amount by month for a year
+ *
+ * @param int $year Year to scan
+ * @param int $format 0=Label of abscissa is a translated text, 1=Label of abscissa is month number, 2=Label of abscissa is first letter of month
+ * @return array Array with amount by month
+ */
+ public function getAmountByMonth($year, $format = 0)
+ {
+ global $user;
+
+ $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) {
+ $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
+ }
+ $sql .= $this->join;
+ $sql .= " WHERE ".$this->where;
+ $sql .= " GROUP BY dm";
+ $sql .= $this->db->order('dm', 'DESC');
+
+ $res = $this->_getAmountByMonth($year, $sql, $format);
+ return $res;
+ }
+
+ /**
+ * Return the orders amount average by month for a year
+ *
+ * @param int $year year for stats
+ * @return array array with number by month
+ */
+ public function getAverageByMonth($year)
+ {
+ global $user;
+
+ $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) {
+ $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
+ }
+ $sql .= $this->join;
+ $sql .= " WHERE ".$this->where;
+ $sql .= " GROUP BY dm";
+ $sql .= $this->db->order('dm', 'DESC');
+
+ return $this->_getAverageByMonth($year, $sql);
+ }
+
/**
* Return nb, total and average
*