From 7b655a1ae2cc79c5da9abe5461fc5131e701fce1 Mon Sep 17 00:00:00 2001 From: atm-greg Date: Mon, 21 Feb 2022 11:25:28 +0100 Subject: [PATCH] fix missing hooks and line total for totalizable extrafields --- htdocs/reception/list.php | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/htdocs/reception/list.php b/htdocs/reception/list.php index 8f07d1bede7..9f98202099a 100644 --- a/htdocs/reception/list.php +++ b/htdocs/reception/list.php @@ -491,6 +491,9 @@ $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."delivery as l ON l.rowid = ee.fk_target"; if (!$user->rights->societe->client->voir && !$socid) { // Internal user with no permission to see all $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; } +$parameters = array(); +$reshook = $hookmanager->executeHooks('printFieldListFrom', $parameters, $object); // Note that $action and $object may have been modified by hook +$sql .= $hookmanager->resPrint; $sql .= " WHERE e.entity IN (".getEntity('reception').")"; if (!$user->rights->societe->client->voir && !$socid) { // Internal user with no permission to see all $sql .= " AND e.fk_soc = sc.fk_soc"; @@ -976,6 +979,9 @@ while ($i < min($num, $limit)) { { }*/ print "\n"; + if (!$i) { + $totalarray['nbfield']++; + } } if (!empty($arrayfields['l.ref']['checked']) || !empty($arrayfields['l.date_delivery']['checked'])) { @@ -1071,6 +1077,13 @@ if ($num == 0) { print ''.$langs->trans("NoRecordFound").''; } +// Show total line +include DOL_DOCUMENT_ROOT.'/core/tpl/list_print_total.tpl.php'; + +$parameters = array('arrayfields'=>$arrayfields, 'sql'=>$sql); +$reshook = $hookmanager->executeHooks('printFieldListFooter', $parameters); // Note that $action and $object may have been modified by hook +print $hookmanager->resPrint; + print ""; print ""; print '';