4if (!empty($totalarray[
'totalizable']) && is_array($totalarray[
'totalizable'])) {
5 foreach ($totalarray[
'totalizable'] as $keytotalizable => $valtotalizable) {
6 $totalarray[
'pos'][$valtotalizable[
'pos']] = $keytotalizable;
7 $totalarray[
'val'][$keytotalizable] = isset($valtotalizable[
'total']) ? $valtotalizable[
'total'] : 0;
11if (isset($totalarray[
'pos'])) {
12 print
'<tr class="liste_total">';
14 while ($i < $totalarray[
'nbfield']) {
16 if (!empty($totalarray[
'pos'][$i])) {
18 if (empty($totalarray[
'type'][$i])) {
19 $totalarray[
'type'][$i] =
'real';
21 switch ($totalarray[
'type'][$i]) {
23 print
'<td class="right">';
24 print (!empty($totalarray[
'val'][$totalarray[
'pos'][$i]]) ?
convertSecondToTime($totalarray[
'val'][$totalarray[
'pos'][$i]],
'allhourmin') : 0);
28 print
'<td class="left">';
29 print (!empty($totalarray[
'val'][$totalarray[
'pos'][$i]]) ? $totalarray[
'val'][$totalarray[
'pos'][$i]] :
'');
33 print
'<td class="right">';
34 print
price2num(!empty($totalarray[
'val'][$totalarray[
'pos'][$i]]) ? $totalarray[
'val'][$totalarray[
'pos'][$i]] : 0,
'MS');
38 print
'<td class="right">';
39 print
price(!empty($totalarray[
'val'][$totalarray[
'pos'][$i]]) ? $totalarray[
'val'][$totalarray[
'pos'][$i]] : 0);
45 if (is_null($limit) || $num < $limit) {
46 print
'<td>'.$langs->trans(
"Total").
'</td>';
49 if (is_object($form)) {
50 print $form->textwithpicto($langs->trans(
"Total"), $langs->transnoentitiesnoconv(
"Totalforthispage"));
52 print $langs->trans(
"Totalforthispage");
convertSecondToTime($iSecond, $format='all', $lengthOfDay=86400, $lengthOfWeek=7)
Return, in clear text, value of a number of seconds in days, hours and minutes.
price2num($amount, $rounding='', $option=0)
Function that return a number with universal decimal format (decimal separator is '.
price($amount, $form=0, $outlangs='', $trunc=1, $rounding=-1, $forcerounding=-1, $currency_code='')
Function to format a value into an amount for visual output Function used into PDF and HTML pages.