From c2ed0356082393d7f2aacb7a3a40542a0a6cf995 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 5 Jan 2010 00:04:45 +0000 Subject: [PATCH] Add option in function --- htdocs/commonobject.class.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/htdocs/commonobject.class.php b/htdocs/commonobject.class.php index 61a3c4fc8b0..1a69e3e21a4 100644 --- a/htdocs/commonobject.class.php +++ b/htdocs/commonobject.class.php @@ -573,8 +573,9 @@ class CommonObject /** * \brief Stocke un numero de rang pour toutes les lignes de * detail d'une facture qui n'en ont pas. + * \param renum true to renum all already ordered lines, false to renum only not already ordered lines. */ - function line_order() + function line_order($renum=false) { if (! $this->table_element_line) { @@ -589,7 +590,7 @@ class CommonObject $sql = 'SELECT count(rowid) FROM '.MAIN_DB_PREFIX.$this->table_element_line; $sql.= ' WHERE '.$this->fk_element.'='.$this->id; - $sql.= ' AND rang = 0'; + if (! $renum) $sql.= ' AND rang = 0'; $resql = $this->db->query($sql); if ($resql) {