NEW : addline with position choice when MAIN_VIEW_LINE_NUMBER is enabled

This commit is contained in:
Gauthier PC portable 024
2021-11-16 14:09:18 +01:00
parent e188855dca
commit 1e0d7d92a9
14 changed files with 65 additions and 9 deletions

View File

@@ -1658,6 +1658,11 @@ class Commande extends CommonOrder
{
// Reorder if child line
if (!empty($fk_parent_line)) $this->line_order(true, 'DESC');
elseif($ranktouse > 0 && $ranktouse <= count($this->lines)) { // Update all rank of all other lines
for ($ii = $ranktouse; $ii <= count($this->lines); $ii++) {
$this->updateRangOfLine($this->lines[$ii - 1]->id, $ii + 1);
}
}
// Mise a jour informations denormalisees au niveau de la commande meme
$result = $this->update_price(1, 'auto', 0, $mysoc); // This method is designed to add line from user input so total calculation must be done using 'auto' mode.