diff --git a/htdocs/bom/class/bom.class.php b/htdocs/bom/class/bom.class.php index 35aaf18c9ae..01e327fd19b 100644 --- a/htdocs/bom/class/bom.class.php +++ b/htdocs/bom/class/bom.class.php @@ -1404,6 +1404,7 @@ class BOM extends CommonObject $reshook = $hookmanager->executeHooks('calculateCostsBom', $parameters, $this); // Note that $action and $object may have been modified by hook if ($reshook > 0) { + $hookmanager->executeHooks('calculateCostsBomAfter', $parameters, $this); // Note that $action and $object may have been modified by hook return $hookmanager->resPrint; } @@ -1501,6 +1502,7 @@ class BOM extends CommonObject $this->unit_cost = (float) price2num($this->total_cost * $this->qty, 'MU'); } } + $hookmanager->executeHooks('calculateCostsBomAfter', $parameters, $this); return 1; } diff --git a/htdocs/core/boxes/box_graph_invoices_permonth.php b/htdocs/core/boxes/box_graph_invoices_permonth.php index af0dcbac277..9401154cefa 100644 --- a/htdocs/core/boxes/box_graph_invoices_permonth.php +++ b/htdocs/core/boxes/box_graph_invoices_permonth.php @@ -132,7 +132,7 @@ class box_graph_invoices_permonth extends ModeleBoxes $HEIGHT = '192'; $stats = new FactureStats($this->db, $socid, $mode, 0); - $stats->where = "f.fk_statut > 0"; + $stats->where = "f.entity IN (".getEntity('invoice').") AND f.fk_statut > 0"; $px1 = null; $px2 = null; diff --git a/htdocs/core/boxes/box_graph_invoices_peryear.php b/htdocs/core/boxes/box_graph_invoices_peryear.php index fccfa5b7530..b52fb20adfd 100644 --- a/htdocs/core/boxes/box_graph_invoices_peryear.php +++ b/htdocs/core/boxes/box_graph_invoices_peryear.php @@ -126,7 +126,7 @@ class box_graph_invoices_peryear extends ModeleBoxes $HEIGHT = '192'; $stats = new FactureStats($this->db, $socid, $mode, 0); - $stats->where = "f.fk_statut > 0"; + $stats->where = "f.entity IN (".getEntity('invoice').") AND f.fk_statut > 0"; // Build graphic amount of object. $data = array(array('Lib',val1,val2,val3),...) $data2 = $stats->getAmountByYear($numberyears);