phpcompta-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Phpcompta-dev] r4076 - phpcompta/trunk/include


From: phpcompta-dev
Subject: [Phpcompta-dev] r4076 - phpcompta/trunk/include
Date: Mon, 2 May 2011 23:55:48 +0200 (CEST)

Author: danydb
Date: 2011-05-02 23:55:48 +0200 (Mon, 02 May 2011)
New Revision: 4076

Modified:
   phpcompta/trunk/include/impress_fiche.inc.php
Log:
Fix bug when too many card in impress_fiche.php

Modified: phpcompta/trunk/include/impress_fiche.inc.php
===================================================================
--- phpcompta/trunk/include/impress_fiche.inc.php       2011-04-26 21:26:01 UTC 
(rev 4075)
+++ phpcompta/trunk/include/impress_fiche.inc.php       2011-05-02 21:55:48 UTC 
(rev 4076)
@@ -136,6 +136,7 @@
 // Balance
 if ( $_GET['histo'] == 4 || $_GET['histo']==5 )
 {
+  xdebug_start_trace();
     if ( isDate($_REQUEST['start']) == null || isDate ($_REQUEST['end']) == 
null )
     {
         alert('Date invalide !');
@@ -148,8 +149,8 @@
       echo alert("Cette catégorie n'ayant pas de poste comptable n'a pas de 
balance");
       exit;
     }
-    $aCard=$cn->get_array("select f_id,ad_value from fiche join fiche_detail 
using(f_id) where fd_id=$1 and ad_id=1 order by 2 ",array($_REQUEST['cat']));
-    if ( empty($aCard))
+    $ret=$cn->exec_sql("select f_id,ad_value from fiche join fiche_detail 
using(f_id) where fd_id=$1 and ad_id=1 order by 2 ",array($_REQUEST['cat']));
+    if ( $cn->count()==0)
     {
         echo "Aucune fiche trouvée";
         exit;
@@ -164,11 +165,12 @@
         th('D/C','style="text-align:right"')
     );
     $idx=0;
-    for ($i=0;$i < count($aCard);$i++)
+    for ($i=0;$i < Database::num_row($ret);$i++)
     {
         $filter= " (j_date >= to_date('".$_REQUEST['start']."','DD.MM.YYYY') ".
                  " and  j_date <= 
to_date('".$_REQUEST['end']."','DD.MM.YYYY')) ";
-        $oCard=new Fiche($cn,$aCard[$i]['f_id']);
+       $aCard=Database::fetch_array($ret,$i);
+        $oCard=new Fiche($cn,$aCard['f_id']);
         $solde=$oCard->get_solde_detail($filter);
         if ( $solde['debit'] == 0 && $solde['credit']==0) continue;
        /* only not purged card */




reply via email to

[Prev in Thread] Current Thread [Next in Thread]