diff --git a/htdocs/facture.class.php b/htdocs/facture.class.php index 73b7090ae27..3004470d4c1 100644 --- a/htdocs/facture.class.php +++ b/htdocs/facture.class.php @@ -5,6 +5,7 @@ * Copyright (C) 2004 Benoit Mortier * Copyright (C) 2005 Marc Barilley / Ocebo * Copyright (C) 2006 Andre Cianfarani + * Copyright (C) 2007 Franky Van Liedekerke * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -1786,11 +1787,13 @@ class Facture extends CommonObject $resql=$this->db->query($sql); if ($resql) { - $obj = $this->db->fetch_object($resql); - if ($obj) + $num = $this->db->num_rows(); + $i = 0; + while ($i < $num) { - // Si il y en a - $idarray[]=$obj->rowid; + $row = $this->db->fetch_row($i); + $idarray[]=$row[0]; + $i++; } } else