|
@@ -274,6 +274,10 @@ if (empty($conf->global->STOCK_SUPPORTS_SERVICES)) {
|
|
|
if (!empty($canvas)) {
|
|
|
$sql .= " AND p.canvas = '".$db->escape($canvas)."'";
|
|
|
}
|
|
|
+// Add where from hooks
|
|
|
+$parameters = array();
|
|
|
+$reshook = $hookmanager->executeHooks('printFieldListWhere', $parameters); // Note that $action and $object may have been modified by hook
|
|
|
+$sql .= $hookmanager->resPrint;
|
|
|
if ($fk_warehouse > 0) {
|
|
|
$sql .= ' GROUP BY p.rowid, p.ref, p.label, p.description, p.price, p.price_ttc, p.price_base_type, p.fk_product_type, p.desiredstock, p.seuil_stock_alerte,';
|
|
|
$sql .= ' p.tms, p.duration, p.tobuy, p.stock';
|
|
@@ -281,10 +285,6 @@ if ($fk_warehouse > 0) {
|
|
|
$sql .= ' GROUP BY p.rowid, p.ref, p.label, p.description, p.price, p.price_ttc, p.price_base_type, p.fk_product_type, p.desiredstock, p.seuil_stock_alerte,';
|
|
|
$sql .= ' p.tms, p.duration, p.tobuy, p.stock';
|
|
|
}
|
|
|
-// Add where from hooks
|
|
|
-$parameters = array();
|
|
|
-$reshook = $hookmanager->executeHooks('printFieldListWhere', $parameters); // Note that $action and $object may have been modified by hook
|
|
|
-$sql .= $hookmanager->resPrint;
|
|
|
|
|
|
if ($sortfield == 'stock_reel' && $fk_warehouse <= 0) {
|
|
|
$sortfield = 'stock';
|