rank change. if we only have one order we leave the origin rank otherwise we leave the -1 and let the class set the max rank.
This commit is contained in:
parent
244a3fc819
commit
ea52403339
@ -641,7 +641,7 @@ if ($massaction == 'confirm_createbills') { // Create bills from orders.
|
|||||||
$lastref = '';
|
$lastref = '';
|
||||||
|
|
||||||
$db->begin();
|
$db->begin();
|
||||||
|
$nbOrders = is_array($orders) ? count($orders) : 1;
|
||||||
foreach ($orders as $id_order) {
|
foreach ($orders as $id_order) {
|
||||||
$cmd = new Commande($db);
|
$cmd = new Commande($db);
|
||||||
if ($cmd->fetch($id_order) <= 0) {
|
if ($cmd->fetch($id_order) <= 0) {
|
||||||
@ -773,7 +773,7 @@ if ($massaction == 'confirm_createbills') { // Create bills from orders.
|
|||||||
}
|
}
|
||||||
|
|
||||||
$objecttmp->context['createfromclone'];
|
$objecttmp->context['createfromclone'];
|
||||||
|
$rankedLine = ($nbOrders > 1) ? -1 : $lines[$i]->rang;
|
||||||
$result = $objecttmp->addline(
|
$result = $objecttmp->addline(
|
||||||
$desc,
|
$desc,
|
||||||
$lines[$i]->subprice,
|
$lines[$i]->subprice,
|
||||||
@ -793,7 +793,7 @@ if ($massaction == 'confirm_createbills') { // Create bills from orders.
|
|||||||
$product_type,
|
$product_type,
|
||||||
//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
|
//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 will give us the right number
|
||||||
-1, // rank
|
$rankedLine, // rank
|
||||||
$lines[$i]->special_code,
|
$lines[$i]->special_code,
|
||||||
$objecttmp->origin,
|
$objecttmp->origin,
|
||||||
$lines[$i]->rowid,
|
$lines[$i]->rowid,
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user