diff --git a/include/anc_balance_double.inc.php b/include/anc_balance_double.inc.php index 6c20904ed..21af8eae8 100644 --- a/include/anc_balance_double.inc.php +++ b/include/anc_balance_double.inc.php @@ -11,7 +11,18 @@ echo $bc->display_form(); echo ''; 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 '
'; + echo _('Aucune donnée trouvée'); + echo '
'; + } + } ?> diff --git a/include/anc_balance_simple.inc.php b/include/anc_balance_simple.inc.php index 91e3b0ca6..de82efa31 100644 --- a/include/anc_balance_simple.inc.php +++ b/include/anc_balance_simple.inc.php @@ -11,7 +11,17 @@ echo $bs->display_form(); echo ''; 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 ''; + echo _('Aucune donnée trouvée'); + echo '
'; + } } ?> diff --git a/include/anc_great_ledger.inc.php b/include/anc_great_ledger.inc.php index 1430384ce..4c8e23383 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 ''; - echo _('Tout sélectionner')." ".ICheckBox::toggle_checkbox('export_pdf_bt1','export_anc_receipt_pdf'); - echo ''; - echo $grandLivre->show_button(); - echo ''; - echo $grandLivre->show_button(); + $result=$grandLivre->display_html(); + if ($grandLivre->has_data != 0 ) + { + echo ''; + echo _('Tout sélectionner')." ".ICheckBox::toggle_checkbox('export_pdf_bt1','export_anc_receipt_pdf'); + echo ''; + echo $grandLivre->show_button(); + echo ''; + echo $grandLivre->show_button(); + } + else + { + echo ''; + echo _('Aucune donnée trouvée'); + echo '
'; + } + } echo ''; ?> diff --git a/include/anc_history.inc.php b/include/anc_history.inc.php index ca712c368..e57ab44bb 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 ''; + echo _('Aucune donnée trouvée'); + echo '
'; + } echo ''; } echo ''; diff --git a/include/class_anc_balance_double.php b/include/class_anc_balance_double.php index da7d9e563..bbb8e2ab3 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 9318ec085..d963d32c9 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 d7a59e113..e37525d06 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.= '