diff --git a/htdocs/comm/propal/list.php b/htdocs/comm/propal/list.php index 4f59682abb8..3e467539c88 100644 --- a/htdocs/comm/propal/list.php +++ b/htdocs/comm/propal/list.php @@ -696,6 +696,11 @@ $parameters = array(); $reshook = $hookmanager->executeHooks('printFieldListWhere', $parameters); // Note that $action and $object may have been modified by hook $sql .= $hookmanager->resPrint; +// Add HAVING from hooks +$parameters = array(); +$reshook = $hookmanager->executeHooks('printFieldListHaving', $parameters, $object); // Note that $action and $object may have been modified by hook +$sql .= !empty($hookmanager->resPrint) ? (' HAVING 1=1 ' . $hookmanager->resPrint) : ''; + $sql .= $db->order($sortfield, $sortorder); $sql .= ', p.ref DESC'; diff --git a/htdocs/commande/list.php b/htdocs/commande/list.php index 9c278359acc..b534d915914 100644 --- a/htdocs/commande/list.php +++ b/htdocs/commande/list.php @@ -628,6 +628,11 @@ $parameters = array(); $reshook = $hookmanager->executeHooks('printFieldListWhere', $parameters); // Note that $action and $object may have been modified by hook $sql .= $hookmanager->resPrint; +// Add HAVING from hooks +$parameters = array(); +$reshook = $hookmanager->executeHooks('printFieldListHaving', $parameters, $object); // Note that $action and $object may have been modified by hook +$sql .= !empty($hookmanager->resPrint) ? (' HAVING 1=1 ' . $hookmanager->resPrint) : ''; + $sql .= $db->order($sortfield, $sortorder); // Count total nb of records diff --git a/htdocs/expedition/list.php b/htdocs/expedition/list.php index 6a1b26fa19f..79ed3b52215 100644 --- a/htdocs/expedition/list.php +++ b/htdocs/expedition/list.php @@ -373,6 +373,11 @@ $parameters = array(); $reshook = $hookmanager->executeHooks('printFieldListWhere', $parameters); // Note that $action and $object may have been modified by hook $sql .= $hookmanager->resPrint; +// Add HAVING from hooks +$parameters = array(); +$reshook = $hookmanager->executeHooks('printFieldListHaving', $parameters, $object); // Note that $action and $object may have been modified by hook +$sql .= !empty($hookmanager->resPrint) ? (' HAVING 1=1 ' . $hookmanager->resPrint) : ''; + $sql .= $db->order($sortfield, $sortorder); $nbtotalofrecords = '';