diff --git a/htdocs/core/tpl/list_print_total.tpl.php b/htdocs/core/tpl/list_print_total.tpl.php index 929ea2df50f..b015dc51fdc 100644 --- a/htdocs/core/tpl/list_print_total.tpl.php +++ b/htdocs/core/tpl/list_print_total.tpl.php @@ -13,7 +13,13 @@ if (isset($totalarray['pos'])) { while ($i < $totalarray['nbfield']) { $i++; if (!empty($totalarray['pos'][$i])) { - print ''.price(!empty($totalarray['val'][$totalarray['pos'][$i]])?$totalarray['val'][$totalarray['pos'][$i]]:0).''; + print ''; + if ($totalarray['type'][$i] == 'duration') { + print (!empty($totalarray['val'][$totalarray['pos'][$i]])?convertSecondToTime($totalarray['val'][$totalarray['pos'][$i]], 'allhourmin'):0); + } else { + print price(!empty($totalarray['val'][$totalarray['pos'][$i]])?$totalarray['val'][$totalarray['pos'][$i]]:0); + } + print ''; } else { if ($i == 1) { if (is_null($limit) || $num < $limit) { diff --git a/htdocs/fichinter/list.php b/htdocs/fichinter/list.php index d710d7cd6cc..c61fa4b1393 100644 --- a/htdocs/fichinter/list.php +++ b/htdocs/fichinter/list.php @@ -7,6 +7,7 @@ * Copyright (C) 2015 Jean-François Ferry * Copyright (C) 2018 Ferran Marcet * Copyright (C) 2021 Frédéric France + * Copyright (C) 2022 Charlène Benke * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -739,6 +740,7 @@ if ($resql) { $totalarray['nbfield']++; } if (!$i) { + $totalarray['type'][$totalarray['nbfield']] = 'duration'; $totalarray['pos'][$totalarray['nbfield']] = 'fd.duree'; } $totalarray['val']['fd.duree'] += $obj->duree;