mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2026-02-08 09:01:40 +01:00
Merge branch '13.0' of git@github.com:Dolibarr/dolibarr.git into develop
Conflicts: htdocs/commande/class/commandestats.class.php htdocs/core/actions_massactions.inc.php htdocs/core/modules/propale/doc/pdf_cyan.modules.php htdocs/holiday/month_report.php htdocs/product/class/product.class.php htdocs/product/stock/class/mouvementstock.class.php htdocs/societe/list.php
This commit is contained in:
@@ -44,7 +44,10 @@ class CommandeStats extends Stats
|
||||
public $userid;
|
||||
|
||||
public $from;
|
||||
public $from_line;
|
||||
public $field;
|
||||
public $field_line;
|
||||
public $categ_link;
|
||||
public $where;
|
||||
public $join;
|
||||
|
||||
@@ -77,6 +80,7 @@ class CommandeStats extends Stats
|
||||
$this->field = 'total_ht';
|
||||
$this->field_line = 'total_ht';
|
||||
//$this->where .= " c.fk_statut > 0"; // Not draft and not cancelled
|
||||
$this->categ_link = MAIN_DB_PREFIX.'categorie_societe';
|
||||
} elseif ($mode == 'supplier') {
|
||||
$object = new CommandeFournisseur($this->db);
|
||||
$this->from = MAIN_DB_PREFIX.$object->table_element." as c";
|
||||
@@ -84,6 +88,7 @@ class CommandeStats extends Stats
|
||||
$this->field = 'total_ht';
|
||||
$this->field_line = 'total_ht';
|
||||
//$this->where .= " c.fk_statut > 2"; // Only approved & ordered
|
||||
$this->categ_link = MAIN_DB_PREFIX.'categorie_fournisseur';
|
||||
}
|
||||
//$this->where.= " AND c.fk_soc = s.rowid AND c.entity = ".$conf->entity;
|
||||
$this->where .= ($this->where ? ' AND ' : '').'c.entity IN ('.getEntity('commande').')';
|
||||
@@ -104,7 +109,7 @@ class CommandeStats extends Stats
|
||||
}
|
||||
|
||||
if ($categid) {
|
||||
$this->join .= ' LEFT JOIN '.MAIN_DB_PREFIX.'categorie_societe as cats ON cats.fk_soc = c.fk_soc';
|
||||
$this->join .= ' LEFT JOIN '.$this->categ_link.' as cats ON cats.fk_soc = c.fk_soc';
|
||||
$this->join .= ' LEFT JOIN '.MAIN_DB_PREFIX.'categorie as cat ON cat.rowid = cats.fk_categorie';
|
||||
$this->where .= ' AND cat.rowid = '.((int) $categid);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user