rank change. if we only have one order we leave the origin rank otherwhise we pass -1

This commit is contained in:
jpb 2022-07-08 12:32:17 +02:00
parent 1820276ac7
commit 226488b7ed

View File

@ -604,7 +604,7 @@ if ($massaction == 'confirm_createbills') // Create bills from orders
$nb_bills_created = 0;
$db->begin();
$nbOrders = is_array($orders) ? count($orders) : 1;
foreach ($orders as $id_order)
{
$cmd = new Commande($db);
@ -726,7 +726,7 @@ if ($massaction == 'confirm_createbills') // Create bills from orders
$lines[$i]->fetch_optionals();
$array_options = $lines[$i]->array_options;
}
$rankedLine = ($nbOrders > 1) ? -1 : $lines[$i]->rang;
$result = $objecttmp->addline(
$desc,
$lines[$i]->subprice,
@ -744,7 +744,7 @@ if ($massaction == 'confirm_createbills') // Create bills from orders
'HT',
0,
$product_type,
$lines[$i]->rang,
$rankedLine,
$lines[$i]->special_code,
$objecttmp->origin,
$lines[$i]->rowid,