From 04d6bd1e7a5d8528d665ba36f6bad2916e940155 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 24 Jun 2006 19:15:26 +0000 Subject: [PATCH] Fix: Suppression utilisation de dbclone inutile --- htdocs/compta/facture/facture-rec.class.php | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/htdocs/compta/facture/facture-rec.class.php b/htdocs/compta/facture/facture-rec.class.php index 8a55222339f..24b4886d2e4 100644 --- a/htdocs/compta/facture/facture-rec.class.php +++ b/htdocs/compta/facture/facture-rec.class.php @@ -315,6 +315,7 @@ class FactureRec extends Facture $notify = New Notify($this->db); $notify->send($action_notify, $this->socidp, $mesg, "facture", $rowid, $filepdf); + /* * Update Stats * @@ -323,24 +324,25 @@ class FactureRec extends Facture $sql .= " AND fk_product IS NOT NULL"; $result = $this->db->query($sql); - if ($result) { - $num = $this->db->num_rows(); + $num = $this->db->num_rows($result); $i = 0; while ($i < $num) { $obj = $this->db->fetch_object($result); - $sql = "UPDATE ".MAIN_DB_PREFIX."product SET nbvente=nbvente+1 WHERE rowid = ".$obj->fk_product; - $db2 = $this->db->dbclone(); - $result = $db2->query($sql); + $sql = "UPDATE ".MAIN_DB_PREFIX."product"; + $sql.= " SET nbvente=nbvente+1"; + $sql.= " WHERE rowid = ".$obj->fk_product; + $result2 = $db->query($sql); $i++; } } + /* - * Contrats - */ + * Contrats + */ $contrat = new Contrat($this->db); $contrat->create_from_facture($this->id, $user, $this->socidp);