3'@phan-var-force array{nbfield:int,pos?:array<int,int>,val?:array<int,float>} $totalarray';
6if (!empty($subtotalarray[
'totalizable']) && is_array($subtotalarray[
'totalizable'])) {
7 foreach ($subtotalarray[
'totalizable'] as $keytotalizable => $valtotalizable) {
8 $totalarray[
'pos'][$valtotalizable[
'pos']] = $keytotalizable;
9 $subtotalarray[
'val'][$keytotalizable] = isset($valtotalizable[
'total']) ? $valtotalizable[
'total'] : 0;
13if (isset($totalarray[
'pos'])) {
14 print
'<tr class="liste_total">';
16 while ($j < $totalarray[
'nbfield']) {
18 if (!empty($totalarray[
'pos'][$j])) {
19 switch ($totalarray[
'pos'][$j]) {
21 print
'<td class="right">';
22 print(!empty($subtotalarray[
'val'][$totalarray[
'pos'][$j]]) ?
convertSecondToTime($subtotalarray[
'val'][$totalarray[
'pos'][$j]],
'allhourmin') : 0);
26 print
'<td class="left">';
27 print(!empty($subtotalarray[
'val'][$totalarray[
'pos'][$j]]) ? $subtotalarray[
'val'][$totalarray[
'pos'][$j]] :
'');
31 print
'<td class="right">';
32 print
price2num(!empty($subtotalarray[
'val'][$totalarray[
'pos'][$j]]) ? $subtotalarray[
'val'][$totalarray[
'pos'][$j]] : 0,
'MS');
36 print
'<td class="right">';
37 print
price(!empty($subtotalarray[
'val'][$totalarray[
'pos'][$j]]) ? $subtotalarray[
'val'][$totalarray[
'pos'][$j]] : 0);
41 $subtotalarray[
'val'][$totalarray[
'pos'][$j]] = 0;
44 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.