4if (!empty($subtotalarray[
'totalizable']) && is_array($subtotalarray[
'totalizable'])) {
5 foreach ($subtotalarray[
'totalizable'] as $keytotalizable => $valtotalizable) {
6 $totalarray[
'pos'][$valtotalizable[
'pos']] = $keytotalizable;
7 $subtotalarray[
'val'][$keytotalizable] = isset($valtotalizable[
'total']) ? $valtotalizable[
'total'] : 0;
11if (isset($totalarray[
'pos'])) {
12 print
'<tr class="liste_total">';
14 while ($j < $totalarray[
'nbfield']) {
16 if (!empty($totalarray[
'pos'][$j])) {
17 switch ($totalarray[
'pos'][$j]) {
19 print
'<td class="right">';
20 print(!empty($subtotalarray[
'val'][$totalarray[
'pos'][$j]]) ?
convertSecondToTime($subtotalarray[
'val'][$totalarray[
'pos'][$j]],
'allhourmin') : 0);
24 print
'<td class="left">';
25 print(!empty($subtotalarray[
'val'][$totalarray[
'pos'][$j]]) ? $subtotalarray[
'val'][$totalarray[
'pos'][$j]] :
'');
29 print
'<td class="right">';
30 print
price2num(!empty($subtotalarray[
'val'][$totalarray[
'pos'][$j]]) ? $subtotalarray[
'val'][$totalarray[
'pos'][$j]] : 0,
'MS');
34 print
'<td class="right">';
35 print
price(!empty($subtotalarray[
'val'][$totalarray[
'pos'][$j]]) ? $subtotalarray[
'val'][$totalarray[
'pos'][$j]] : 0);
39 $subtotalarray[
'val'][$totalarray[
'pos'][$j]] = 0;
42 print
'<td>'.$langs->trans(
"SubTotal").
'</td>';
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.