task #1013 Comptabilité analytique : amélioration quand aucune donnée

Task #1013 - Comptabilité analytique : amélioration quand aucune donnée
This commit is contained in:
Dany De Bontridder 2014-07-20 12:50:12 +02:00
parent 2f95fcac55
commit 2295ffe63e
10 changed files with 80 additions and 39 deletions

View file

@ -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>';
}
}
?>

View file

@ -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>';
}
}
?>

View file

@ -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>';
?>

View file

@ -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>';

View file

@ -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();

View file

@ -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;

View file

@ -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;

View file

@ -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;
}
/*!

View file

@ -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;
}

View file

@ -52,6 +52,7 @@ class Anc_Print
$this->to="";
$this->from_poste="";
$this->to_poste="";
$this->has_data=0;
}
/*!