From 00a2add1358c48c71d0f69aeeabb267989d36c3c Mon Sep 17 00:00:00 2001 From: Rodolphe Quiedeville Date: Mon, 16 Jan 2006 15:56:11 +0000 Subject: [PATCH] Bugfix --- .../facture-detail-tableur-two.class.php | 31 ++++++++++--------- 1 file changed, 17 insertions(+), 14 deletions(-) diff --git a/htdocs/telephonie/script/facture-detail-tableur-two.class.php b/htdocs/telephonie/script/facture-detail-tableur-two.class.php index afda21cd01b..54739162c8b 100644 --- a/htdocs/telephonie/script/facture-detail-tableur-two.class.php +++ b/htdocs/telephonie/script/facture-detail-tableur-two.class.php @@ -96,26 +96,29 @@ class FactureDetailTableurTwo { if ($resql) { - while ($row = $this->db->fetch_row[$resql]) + $num = $this->db->num_rows($resql); + $total = 0; + dolibarr_syslog($num." lignes trouvées"); + while ($row = $this->db->fetch_row($resql)) { - $sql = "SELECT ligne, date, numero, dest, dureetext, duree, cout_vente"; - $sql .= " FROM ".MAIN_DB_PREFIX."telephonie_communications_details"; - $sql .= " WHERE fk_ligne = '".$row[1]."'"; - $sql .= " AND fk_telephonie_facture = ".$row[0]; - $sql .= " ORDER BY date ASC"; + $sq = "SELECT ligne, date, numero, dest, dureetext, duree, cout_vente"; + $sq .= " FROM ".MAIN_DB_PREFIX."telephonie_communications_details"; + $sq .= " WHERE fk_ligne = '".$row[1]."'"; + $sq .= " AND fk_telephonie_facture = ".$row[0]; + $sq .= " ORDER BY date ASC"; - $resql = $this->db->query($sql); + $resq = $this->db->query($sq); - if ($resql) + if ($resq) { $i = 0; - $numsql = $this->db->num_rows($resql); + $numsq = $this->db->num_rows($resq); + $total = $total + $numsq; + dolibarr_syslog("Ligne : ".$row[1] . " : ".$numsq . " Total : ".$total); - dolibarr_syslog("Ligne : ".$this->ligne->id . " : ".$numsql); - - while ($i < $numsql) + while ($i < $numsq) { - $obj = $this->db->fetch_object($resql); + $obj = $this->db->fetch_object($resq); $xx = $i + 1; @@ -128,7 +131,7 @@ class FactureDetailTableurTwo { $i++; } - $this->db->free($resql); + $this->db->free($resq); } else {