diff --git a/htdocs/comm/propal/list.php b/htdocs/comm/propal/list.php index 3535ae0cde1..1ccbd22d511 100644 --- a/htdocs/comm/propal/list.php +++ b/htdocs/comm/propal/list.php @@ -1383,10 +1383,24 @@ if ($resql) { if (!empty($arrayfields['sale_representative']['checked'])) { print_liste_field_titre($arrayfields['sale_representative']['label'], $_SERVER["PHP_SELF"], "", "", "$param", '', $sortfield, $sortorder); } + $totalarray = array( + 'nbfield' => 0, + 'val' => array( + 'p.total_ht' => 0, + 'p.total_tva' => 0, + 'p.total_ttc' => 0, + ), + ); // 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['p.datec']['checked'])) { @@ -1412,12 +1426,6 @@ if ($resql) { $now = dol_now(); $i = 0; - $totalarray = array(); - $totalarray['nbfield'] = 0; - $totalarray['val'] = array(); - $totalarray['val']['p.total_ht'] = 0; - $totalarray['val']['p.total_tva'] = 0; - $totalarray['val']['p.total_ttc'] = 0; $typenArray = null; while ($i < min($num, $limit)) { diff --git a/htdocs/core/class/html.formpropal.class.php b/htdocs/core/class/html.formpropal.class.php index b78ff5cfa8e..2773ece2569 100644 --- a/htdocs/core/class/html.formpropal.class.php +++ b/htdocs/core/class/html.formpropal.class.php @@ -104,6 +104,7 @@ class FormPropal print ''; } + $i = 0; foreach ($listofstatus as $key => $obj) { if ($excludedraft) { if ($obj['code'] == 'Draft' || $obj['code'] == 'PR_DRAFT') {