diff --git a/htdocs/commande/list_det.php b/htdocs/commande/list_det.php index fd36f229e5c..a763394b15b 100644 --- a/htdocs/commande/list_det.php +++ b/htdocs/commande/list_det.php @@ -1509,10 +1509,7 @@ if ($resql) { } // Product QtyOrdered if (!empty($arrayfields['cdet.qty']['checked'])) { - print ''.$obj->qty.''; - if (!$i) { - $totalarray['pos'][$totalarray['nbfield']] = 'cdet.qty'; - } + print ''.$obj->qty.''; if (isset($totalarray['val']['cdet.qty'])) { $totalarray['val']['cdet.qty'] += $obj->qty; } else { @@ -1521,6 +1518,9 @@ if ($resql) { if (!$i) { $totalarray['nbfield']++; } + if (!$i) { + $totalarray['pos'][$totalarray['nbfield']] = 'cdet.qty'; + } } // Ref