diff --git a/htdocs/compta/facture/list.php b/htdocs/compta/facture/list.php index a64a24c791fbf..8ea6fbf00715e 100644 --- a/htdocs/compta/facture/list.php +++ b/htdocs/compta/facture/list.php @@ -187,10 +187,10 @@ // Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context $object = new Facture($db); -$hookmanager->initHooks(array('invoicelist')); +$hookmanager->initHooks(array($contextpage)); $extrafields = new ExtraFields($db); -// fetch optionals attributes and labels +// Fetch optionals attributes and labels $extrafields->fetch_name_optionals_label($object->table_element); $search_array_options = $extrafields->getOptionalsFromPost($object->table_element, '', 'search_'); @@ -609,6 +609,8 @@ $parameters = array(); $reshook = $hookmanager->executeHooks('printFieldListSelect', $parameters, $object, $action); // Note that $action and $object may have been modified by hook $sql .= $hookmanager->resPrint; +$sql = preg_replace('/,\s*$/', '', $sql); +//$sql .= ", COUNT(rc.rowid) as anotherfield"; $sqlfields = $sql; // $sql fields to remove for count total @@ -975,7 +977,10 @@ exit; } - llxHeader('', $langs->trans('CustomersInvoices'), 'EN:Customers_Invoices|FR:Factures_Clients|ES:Facturas_a_clientes'); + // Output page + // -------------------------------------------------------------------- + + llxHeader('', $title, 'EN:Customers_Invoices|FR:Factures_Clients|ES:Facturas_a_clientes'); if ($socid > 0) { $soc = new Societe($db); @@ -1209,7 +1214,6 @@ $i = 0; print '