diff --git a/htdocs/commande/list_det.php b/htdocs/commande/list_det.php
index 8dce1c91576..2ef2d429900 100644
--- a/htdocs/commande/list_det.php
+++ b/htdocs/commande/list_det.php
@@ -1531,10 +1531,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 {
@@ -1543,6 +1540,9 @@ if ($resql) {
if (!$i) {
$totalarray['nbfield']++;
}
+ if (!$i) {
+ $totalarray['pos'][$totalarray['nbfield']] = 'cdet.qty';
+ }
}
// Ref