🚀 Hostinger Optimized
🖥️ Server: Apache
💻 System: Linux webm015.cluster127.gra.hosting.ovh.net 6.18.42-ovh-vps-grsec-zfs+ #1 SMP PREEMPT_DYNAMIC Wed Aug 5 15:59:48 CEST 2026 x86_64
👤 User: stakrfrcol (69043)
🐘 PHP: 8.3.31
🚫 Disabled: _dyuweyrj4,_dyuweyrj4r,dl

💻 Terminal

📁 /home/stakrfrcol/agency
$

📄 list_print_subtotal.tpl.php

📁 Path: /home/s/t/a/stakrfrcol/dolibarr/htdocs/core/tpl/list_print_subtotal.tpl.php
📊 Size: 1.76 KB
🔒 Perm: 0604
📝 MIME: text/x-php
<?php

'@phan-var-force array{nbfield:int,pos?:array<int,int>,val?:array<int,float>} $totalarray';

// Move fields of totalizable into the common array pos and val
if (!empty($subtotalarray['totalizable']) && is_array($subtotalarray['totalizable'])) {
	foreach ($subtotalarray['totalizable'] as $keytotalizable => $valtotalizable) {
		$totalarray['pos'][$valtotalizable['pos']] = $keytotalizable;
		$subtotalarray['val'][$keytotalizable] = isset($valtotalizable['total']) ? $valtotalizable['total'] : 0;
	}
}
// Show total line
if (isset($totalarray['pos'])) {
	print '<tr class="liste_total">';
	$j = 0;
	while ($j < $totalarray['nbfield']) {
		$j++;
		if (!empty($totalarray['pos'][$j])) {
			switch ($totalarray['pos'][$j]) {
				case 'duration':
					print '<td class="right">';
					print(!empty($subtotalarray['val'][$totalarray['pos'][$j]]) ? convertSecondToTime($subtotalarray['val'][$totalarray['pos'][$j]], 'allhourmin') : 0);
					print '</td>';
					break;
				case 'string':
					print '<td class="left">';
					print(!empty($subtotalarray['val'][$totalarray['pos'][$j]]) ? $subtotalarray['val'][$totalarray['pos'][$j]] : '');
					print '</td>';
					break;
				case 'stock':
					print '<td class="right">';
					print price2num(!empty($subtotalarray['val'][$totalarray['pos'][$j]]) ? $subtotalarray['val'][$totalarray['pos'][$j]] : 0, 'MS');
					print '</td>';
					break;
				default:
					print '<td class="right">';
					print price(!empty($subtotalarray['val'][$totalarray['pos'][$j]]) ? $subtotalarray['val'][$totalarray['pos'][$j]] : 0);
					print '</td>';
					break;
			}
			$subtotalarray['val'][$totalarray['pos'][$j]] = 0;
		} else {
			if ($j == 1) {
				print '<td>'.$langs->trans("SubTotal").'</td>';
			} else {
				print '<td></td>';
			}
		}
	}
	print '</tr>';
}
← Back📥 Raw✏️ Edit🔒 Chmod
✨ File Manager Magic ✨