Plugins  LAST
 All Data Structures Files Functions Variables Pages
Public Member Functions
Anc_Grandlivre_Ext Class Reference

extends class_anc_grandlivre More...

Inheritance diagram for Anc_Grandlivre_Ext:
Inheritance graph
Collaboration diagram for Anc_Grandlivre_Ext:
Collaboration graph

Public Member Functions

 show_button ($p_string="")
 Show the button to export in PDF or CSV. More...
 
 button_export_pdf ($p_string="")
 Show the button to export in PDF all the receipt. More...
 
 display_html ()
 compute the html display More...
 

Detailed Description

extends class_anc_grandlivre

Author
dany

Definition at line 27 of file class_anc_grandlivre_ext.php.

Member Function Documentation

Anc_Grandlivre_Ext::button_export_pdf (   $p_string = "")

Show the button to export in PDF all the receipt.

Parameters
$p_stringextra hidden value
Returns
string with the button

Definition at line 63 of file class_anc_grandlivre_ext.php.

References $r.

64  {
65  $r = "";
66  $r.= HtmlInput::hidden("to", $this->to);
67  $r.= HtmlInput::hidden("from", $this->from);
68  $r.= HtmlInput::hidden("pa_id", $this->pa_id);
69  $r.= HtmlInput::hidden("from_poste", $this->from_poste);
70  $r.= HtmlInput::hidden("to_poste", $this->to_poste);
71  $r.= $p_string;
72  $r.= dossier::hidden();
73  $r.=HtmlInput::submit('bt_receipt_anal_pdf', _("Export des pièces en PDF"));
74  return $r;
75  }
$r
Anc_Grandlivre_Ext::display_html ( )

compute the html display

Returns
string

Definition at line 84 of file class_anc_grandlivre_ext.php.

References $array, $ck, $class, $detail, $r, and $row.

85  {
86  $r = "";
87  //---Html
88  $array = $this->load();
89  if (is_array($array) == false)
90  {
91  return $array;
92  }
93 
94  if (empty($array))
95  {
96  $r.= _("aucune donnée");
97  return $r;
98  }
99  $r.= '<table class="result" style="width=100%">';
100  $ix = 0;
101  $prev = 'xx';
102  $idx = 0;
103  $tot_deb = $tot_cred = 0;
104 
105  foreach ($array as $row)
106  {
107  if ($prev != $row['po_name'])
108  {
109  if ($ix > 0)
110  {
111  $r.='<tr>';
112  $tot_solde = bcsub($tot_cred, $tot_deb);
113  $sign = ($tot_solde > 0) ? 'C' : 'D';
114  $r.=td('') . td('') . td('') . td('') . td('') . td(nbm($tot_deb), ' class="num"') . td(nbm($tot_cred), ' class="num"') . td(nbm($tot_solde) . $sign, ' class="num"');
115  }
116  $r.='<tr>' . '<td colspan="7" style="width:auto">' . '<h2>' . h($row['po_name'] . ' ' . $row['po_description']) . '</td></tr>';
117  $r.= '<tr>' .
118  '<th>' . '</th>' .
119  '<th>' . _('Date') . '</th>' .
120  '<th>' . _('Poste') . '</th>' .
121  '<th>' . _('Quick_code') . '</th>' .
122  '<th>' . _('Libellé') . '</th>' .
123  '<th>' . _('Document') . '</th>' .
124  '<th>' . _('Pièce') . '</th>' .
125  '<th>' . _('Num.interne') . '</th>' .
126  '<th style="text-align:right">' . _('Debit') . '</th>' .
127  '<th style="text-align:right">' . _('Credit') . '</th>' .
128  '</tr>';
129 
130  $tot_deb = $tot_cred = 0;
131  $prev = $row['po_name'];
132  $ix++;
133  }
134  $class = ($idx % 2 == 0) ? 'even' : 'odd';
135  $idx++;
136  $r.='<tr class="' . $class . '">';
137  $detail = ($row['jr_id'] != null) ? HtmlInput::detail_op($row['jr_id'], $row['jr_internal']) : '';
138  $post_detail = ($row['j_poste'] != null) ? HtmlInput::history_account($row['j_poste'], $row['j_poste']) : '';
139  $card_detail = ($row['f_id'] != null) ? HtmlInput::history_card($row['f_id'], $row['qcode']) : '';
140  $amount_deb = ($row['oa_debit'] == 't') ? $row['oa_amount'] : 0;
141  $amount_cred = ($row['oa_debit'] == 'f') ? $row['oa_amount'] : 0;
142  $tot_deb = bcadd($tot_deb, $amount_deb);
143  $tot_cred = bcadd($tot_cred, $amount_cred);
144 
145  /*
146  * Checked button
147  */
148  $str_ck = "";
149  $str_document = "";
150  if ($row['jr_id'] != null)
151  {
152  /*
153  * Get receipt info
154  */
155  $str_document = HtmlInput::show_receipt_document($row['jr_id']);
156  if ($str_document != "")
157  {
158  $ck = new ICheckBox('ck[]', $row['jr_id']);
159  $str_ck = $ck->input();
160  }
161  }
162 
163  $r.=
164  '<td>' . $str_ck . '</td>' .
165  '<td>' . $row['oa_date'] . '</td>' .
166  td($post_detail) .
167  td($card_detail) .
168  td($row['jr_comment']) .
169  '<td>' . $str_document . '</td>' .
170  td($row['jr_pj_number']) .
171  '<td>' . $detail . '</td>' .
172  '<td class="num">' . nbm($amount_deb) . '</td>' .
173  '<td class="num">' . nbm($amount_cred)
174  . '</td>';
175  $r.= '</tr>';
176  }
177  $r.='<tr>';
178  $tot_solde = bcsub($tot_cred, $tot_deb);
179  $sign = ($tot_solde > 0) ? 'C' : 'D';
180  $r.=td('') . td('') . td('') . td('') . td('') . td(nbm($tot_deb), ' class="num"') . td(nbm($tot_cred), ' class="num"') . td(nbm($tot_solde) . $sign, ' class="num"');
181 
182  $r.= '</table>';
183  return $r;
184  }
else $class
Definition: show_import.php:25
$ck
Definition: am_card.php:41
for($i=0;$i< Database::num_row($ret);$i++) $row
$r
if(isset($_POST['remove'])) $array
Anc_Grandlivre_Ext::show_button (   $p_string = "")

Show the button to export in PDF or CSV.

Parameters
$url_csvurl of the csv
$url_pdfurl of the pdf
$p_stringhidden data to include in the form
Returns
string with the button

Definition at line 39 of file class_anc_grandlivre_ext.php.

References $r.

40  {
41  $r = "";
42  $r.= '<form method="GET" action="export.php" style="display:inline">';
43  $r.= HtmlInput::hidden("act", "CSV:AncGrandLivre");
44  $r.= HtmlInput::hidden("to", $this->to);
45  $r.= HtmlInput::hidden("from", $this->from);
46  $r.= HtmlInput::hidden("pa_id", $this->pa_id);
47  $r.= HtmlInput::hidden("from_poste", $this->from_poste);
48  $r.= HtmlInput::hidden("to_poste", $this->to_poste);
49  $r.= $p_string;
50  $r.= dossier::hidden();
51  $r.=HtmlInput::submit('bt_csv', "Export en CSV");
52  $r.= '</form>';
53  return $r;
54  }
$r

The documentation for this class was generated from the following file: