diff --git a/htdocs/core/actions_massactions.inc.php b/htdocs/core/actions_massactions.inc.php index b98ce37d8f1..5859760d955 100644 --- a/htdocs/core/actions_massactions.inc.php +++ b/htdocs/core/actions_massactions.inc.php @@ -791,7 +791,10 @@ if ($massaction == 'confirm_createbills') { // Create bills from orders. 'HT', 0, $product_type, - $lines[$i]->rang, + + //we have define the max rank for each line which makes it possible not to have a duplicate on the rank field in the case of several orders + //-1 will give us the right number + -1, // rank $lines[$i]->special_code, $objecttmp->origin, $lines[$i]->rowid,