2
0
forked from Wavyzz/dolibarr

Merge branch '21.0' of git@github.com:Dolibarr/dolibarr.git into 22.0

This commit is contained in:
ldestailleur
2025-07-22 13:00:31 +02:00
12 changed files with 181 additions and 68 deletions

View File

@@ -1829,9 +1829,12 @@ class Commande extends CommonOrder
$this->line_order(true, 'DESC');
} elseif ($ranktouse > 0 && $ranktouse <= count($this->lines)) {
// Update all rank of all other lines starting from the same $ranktouse
$linecount = count($this->lines);
for ($ii = $ranktouse; $ii <= $linecount; $ii++) {
$this->updateRangOfLine($this->lines[$ii - 1]->id, $ii + 1);
foreach ($this->lines as $tmpline) {
if ($tmpline->rang >= $ranktouse) {
if (!empty($tmpline->id)) {
$this->updateRangOfLine($tmpline->id, $tmpline->rang + 1);
}
}
}
}