noalyss-commit
[Top][All Lists]
Advanced

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

[Noalyss-commit] [noalyss] 01/01: task #1013 Comptabilité analytique :


From: Dany De Bontridder
Subject: [Noalyss-commit] [noalyss] 01/01: task #1013 Comptabilité analytique : amélioration quand aucune donnée Task #1013 - Comptabilité analytique : amélioration quand aucune donnée
Date: Sun, 20 Jul 2014 10:54:15 +0000

sparkyx pushed a commit to branch master
in repository noalyss.

commit 2295ffe63e780ca66359d81f3fb8b0cd3e87f243
Author: Dany De Bontridder <address@hidden>
Date:   Sun Jul 20 12:50:12 2014 +0200

    task #1013 Comptabilité analytique : amélioration quand aucune donnée
    Task #1013 - Comptabilité analytique : amélioration quand aucune donnée
---
 include/anc_balance_double.inc.php   |   15 ++++++++++++-
 include/anc_balance_simple.inc.php   |   14 +++++++++++-
 include/anc_great_ledger.inc.php     |   35 ++++++++++++++++++++++-----------
 include/anc_history.inc.php          |   14 +++++++++++-
 include/class_anc_balance_double.php |    2 +-
 include/class_anc_balance_simple.php |    5 +++-
 include/class_anc_grandlivre.php     |   12 ++--------
 include/class_anc_listing.php        |   19 +++++++++--------
 include/class_anc_operation.php      |    2 +-
 include/class_anc_print.php          |    1 +
 10 files changed, 80 insertions(+), 39 deletions(-)

diff --git a/include/anc_balance_double.inc.php 
b/include/anc_balance_double.inc.php
index 6c20904..21af8ea 100644
--- a/include/anc_balance_double.inc.php
+++ b/include/anc_balance_double.inc.php
@@ -11,7 +11,18 @@ echo $bc->display_form();
 echo '</form>';
 if (isset($_GET['result']))
 {
-    echo $bc->show_button();
-    echo $bc->display_html();
+    $result=$bc->display_html();
+    if ($bc->has_data > 0)
+    {
+        echo $bc->show_button();
+        echo $result;
+    }
+    else
+    {
+        echo '<p class="notice">';
+        echo _('Aucune donnée trouvée');
+        echo '</p>';
+    }
+        
 }
 ?>
diff --git a/include/anc_balance_simple.inc.php 
b/include/anc_balance_simple.inc.php
index 91e3b0c..de82efa 100644
--- a/include/anc_balance_simple.inc.php
+++ b/include/anc_balance_simple.inc.php
@@ -11,7 +11,17 @@ echo $bs->display_form();
 echo '</form>';
 if (isset($_GET['result']))
 {
-    echo $bs->show_button();
-    echo $bs->display_html();
+    $result= $bs->display_html();
+    if ( $bs->has_data > 0)
+    {
+        echo $bs->show_button();
+        echo $result;
+    }
+ else
+    {
+        echo '<p class="notice">';
+        echo _('Aucune donnée trouvée');
+        echo '</p>';
+    }
 }
 ?>
diff --git a/include/anc_great_ledger.inc.php b/include/anc_great_ledger.inc.php
index 1430384..4c8e233 100644
--- a/include/anc_great_ledger.inc.php
+++ b/include/anc_great_ledger.inc.php
@@ -24,18 +24,29 @@ $result=HtmlInput::default_value_request('result',null);
 
 if ($result != null)
 {
-    echo '<span style="display:block">';
-      echo _('Tout sélectionner')." 
".ICheckBox::toggle_checkbox('export_pdf_bt1','export_anc_receipt_pdf');
-    echo '</span>';
-    echo $grandLivre->show_button();
-    echo '<form method="GET" id="export_anc_receipt_pdf" action="export.php" 
style="display:inline">';
-  
-    echo $grandLivre->button_export_pdf();
-    echo $grandLivre->display_html();
-    echo $grandLivre->button_export_pdf();
-    echo HtmlInput::get_to_hidden(array('ac','gDossier','sa'));
-    echo '</form>';
-    echo $grandLivre->show_button();
+    $result=$grandLivre->display_html();
+    if ($grandLivre->has_data != 0 )
+    {
+        echo '<span style="display:block">';
+          echo _('Tout sélectionner')." 
".ICheckBox::toggle_checkbox('export_pdf_bt1','export_anc_receipt_pdf');
+        echo '</span>';
+        echo $grandLivre->show_button();
+        echo '<form method="GET" id="export_anc_receipt_pdf" 
action="export.php" style="display:inline">';
+
+        echo $grandLivre->button_export_pdf();
+        echo $grandLivre->display_html();
+        echo $grandLivre->button_export_pdf();
+        echo HtmlInput::get_to_hidden(array('ac','gDossier','sa'));
+        echo '</form>';
+        echo $grandLivre->show_button();
+    }
+    else
+    {
+        echo '<p class="notice">';
+        echo _('Aucune donnée trouvée');
+        echo '</p>';
+    }
+    
 }
 echo '</div>';
 ?>
diff --git a/include/anc_history.inc.php b/include/anc_history.inc.php
index ca712c3..e57ab44 100644
--- a/include/anc_history.inc.php
+++ b/include/anc_history.inc.php
@@ -18,8 +18,18 @@ if (isset($_GET['result']))
     //--------------------------------
     // export Buttons
     //---------------------------------
-    echo $list->show_button();
-    echo $list->display_html();
+    $result=$list->display_html();
+    if ( $list->has_data > 0)
+    {
+        echo $list->show_button();
+        echo $result;
+    }
+    else
+    {
+        echo '<p class="notice">';
+        echo _('Aucune donnée trouvée');
+        echo '</p>';
+    }
     echo '</div>';
 }
 echo '</div>';
diff --git a/include/class_anc_balance_double.php 
b/include/class_anc_balance_double.php
index da7d9e5..bbb8e2a 100644
--- a/include/class_anc_balance_double.php
+++ b/include/class_anc_balance_double.php
@@ -463,7 +463,7 @@ class Anc_Balance_Double extends Anc_Print
 
 
         $res=$this->db->exec_sql($sql);
-
+        $this->has_data=Database::num_row($res);
         if ( Database::num_row($res) == 0 )
             return null;
         $a=array();
diff --git a/include/class_anc_balance_simple.php 
b/include/class_anc_balance_simple.php
index 9318ec0..d963d32 100644
--- a/include/class_anc_balance_simple.php
+++ b/include/class_anc_balance_simple.php
@@ -59,8 +59,10 @@ class Anc_Balance_Simple extends Anc_Print
         $sql.=" order by po_id";
         $res=$this->db->exec_sql($sql);
 
-        if ( Database::num_row($res) == 0 )
+        if ( Database::num_row($res) == 0 ) {
+            $this->has_data=0;
             return null;
+        }
         $a=array();
         $count=0;
         $array=Database::fetch_all($res);
@@ -74,6 +76,7 @@ class Anc_Balance_Simple extends Anc_Print
             
$a[$count]['debit']=($row['sum_deb']>$row['sum_cred'])?"debit":"credit";
             $count++;
         }
+        $this->has_data=$count;
         return $a;
 
 
diff --git a/include/class_anc_grandlivre.php b/include/class_anc_grandlivre.php
index d7a59e1..e37525d 100644
--- a/include/class_anc_grandlivre.php
+++ b/include/class_anc_grandlivre.php
@@ -81,7 +81,7 @@ class Anc_GrandLivre extends Anc_Print
        left join jrn on  (j_grpt=jr_grpt_id)
              where $pa_id_cond oa_amount <> 0.0  $cond_poste  $filter_date
        order by po_name,oa_date::date,qcode,j_poste");
-
+        $this->has_data=count($array);
         return $array;
     }
 
@@ -159,15 +159,9 @@ class Anc_GrandLivre extends Anc_Print
         $r = "";
         //---Html
         $array = $this->load();
-        if (is_array($array) == false)
+        if (is_array($array) == false || empty($array))
         {
-            return $array;
-        }
-
-        if (empty($array))
-        {
-            $r.= _("aucune donnée");
-            return $r;
+            return 0;
         }
         $r.= '<table class="result" style="width=100%">';
         $ix = 0;
diff --git a/include/class_anc_listing.php b/include/class_anc_listing.php
index 6f49a01..276c704 100644
--- a/include/class_anc_listing.php
+++ b/include/class_anc_listing.php
@@ -66,16 +66,9 @@ class Anc_Listing extends Anc_Print
         $r="";
         //---Html
         $array=$this->load();
-        if ( is_array($array) == false )
+        if ( is_array($array) == false ||  empty($array) )
         {
-            return $array;
-
-        }
-
-        if ( empty($array) )
-        {
-            $r.= _("aucune donnée");
-            return $r;
+            return 0;
         }
         $r.= '<table class="result" style="width=100%">';
         $r.= '<tr>'.
@@ -123,6 +116,14 @@ class Anc_Listing extends Anc_Print
         $op=new Anc_Operation ($this->db);
         $op->pa_id=$this->pa_id;
         
$array=$op->get_list($this->from,$this->to,$this->from_poste,$this->to_poste);
+        if (! $array ) 
+        {
+            $this->has_data=0;
+        }
+        else 
+        {
+            $this->has_data=count($array);
+        }
         return $array;
     }
     /*!
diff --git a/include/class_anc_operation.php b/include/class_anc_operation.php
index 6c0fd8e..24896b9 100644
--- a/include/class_anc_operation.php
+++ b/include/class_anc_operation.php
@@ -69,6 +69,7 @@ class Anc_Operation
         $this->id=$p_id;
         $this->oa_jrnx_id_source=null;
         $this->oa_positive='Y';
+        $this->has_data=0;
     }
     /*!\brief add a row  to the table operation_analytique
      * \note if $this->oa_group if 0 then a sequence id will be computed for
@@ -179,7 +180,6 @@ class Anc_Operation
        order by jr_date,oa_group,oa_debit desc,oa_id";
 
         $RetSql=$this->db->exec_sql($sql);
-
         $array=Database::fetch_all($RetSql);
         return $array;
     }
diff --git a/include/class_anc_print.php b/include/class_anc_print.php
index 56fc8c4..7596d56 100644
--- a/include/class_anc_print.php
+++ b/include/class_anc_print.php
@@ -52,6 +52,7 @@ class Anc_Print
         $this->to="";
         $this->from_poste="";
         $this->to_poste="";
+        $this->has_data=0;
 
     }
     /*!



reply via email to

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