diff --git a/htdocs/commande/list.php b/htdocs/commande/list.php index 503c125b59c..b0685b8b64b 100644 --- a/htdocs/commande/list.php +++ b/htdocs/commande/list.php @@ -1345,10 +1345,25 @@ if ($resql) { print_liste_field_titre($arrayfields['sale_representative']['label'], $_SERVER["PHP_SELF"], "", "", "$param", '', $sortfield, $sortorder); } + $totalarray = array( + 'nbfield' => 0, + 'val' => array( + 'c.total_ht' => 0, + 'c.total_tva' => 0, + 'c.total_ttc' => 0, + ), + 'pos' => array(), + ); // Extra fields include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_title.tpl.php'; // Hook fields - $parameters = array('arrayfields'=>$arrayfields, 'param'=>$param, 'sortfield'=>$sortfield, 'sortorder'=>$sortorder); + $parameters = array( + 'arrayfields' => $arrayfields, + 'param' => $param, + 'sortfield' => $sortfield, + 'sortorder' => $sortorder, + 'totalarray' => &$totalarray, + ); $reshook = $hookmanager->executeHooks('printFieldListTitle', $parameters); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; if (!empty($arrayfields['c.datec']['checked'])) { @@ -1388,7 +1403,6 @@ if ($resql) { $generic_product = new Product($db); $userstatic = new User($db); $i = 0; - $totalarray = array('nbfield' => 0, 'val' => array(), 'pos' => array()); while ($i < min($num, $limit)) { $obj = $db->fetch_object($resql);