noalyss Version-10
NOALYSS : serveur de comptabilité et ERP (2002)
Loading...
Searching...
No Matches
anc_acc_list.class.php
Go to the documentation of this file.
1<?php
2/*
3 * This file is part of NOALYSS.
4 *
5 * NOALYSS is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
9 *
10 * NOALYSS is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with NOALYSS; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18*/
19
20// Copyright Author Dany De Bontridder danydb@aevalys.eu
21
22/*!\file
23 * \brief Anc_Acc_List Manage the class for reporting about Analytic Accountancy and Accountancy : card - analytic account,
24 * accounting - analytic account,
25 */
26
27/*!
28 * \class Anc_Acc_List
29 * \brief Manage the class for reporting about Analytic Accountancy and Accountancy : card - analytic account,
30 * accounting - analytic account,
31 */
32
34{
35 var $arow; //!< $arow array of row from
37 /**
38 *@brief display form to get the parameter
39 * - card_poste 1 by card, 2 by account
40 * - from_poste
41 * - to_poste
42 * - from from date
43 * - to until date
44 * - pa_id Analytic plan to use
45 */
46 function display_form($p_hidden='')
47 {
48 $r=parent::display_form($p_hidden);
49 $icard=new ISelect('card_poste');
50 $icard->value=array(
51 array('value'=>1,'label'=>_('Fiche /Activité')),
52 array('value'=>2,'label'=>_('Poste comptable/Activité')),
53 array('value'=>3,'label'=>_('Activité/Fiche')),
54 array('value'=>4,'label'=>_('Activité/Poste Comptable'))
55
56 );
57
58 $icard->selected=$this->card_poste;
59 $r.=$icard->input();
60 $r.=HtmlInput::request_to_hidden(array('ac'));
61 return $r;
62 }
63 /**
64 * \brief load the data
65 * does not return anything but give a value to this->aheader and this->arow
66 */
68 {
69 $date=$this->set_sql_filter();
70 $date=($date != '')?" $date":'';
71 $sql_from_poste=($this->from_poste!='')?" and po.po_name >= upper('".Database::escape_string($this->from_poste)."')":'';
72 $sql_to_poste=($this->to_poste!='')?" and po.po_name <= upper('".Database::escape_string($this->to_poste)."')":'';
73 $this->arow=$this->db->get_array("
74 with m as (select oa_id,po_id,
75 coalesce(jrnx.f_id,operation_analytique.f_id) as f_id1,
76 case when jrnx.j_qcode is not null then
77 ( SELECT fiche_detail.ad_value
78 FROM fiche_detail
79 WHERE fiche_detail.ad_id = 1 AND fiche_detail.f_id = jrnx.f_id)
80 when jrnx.f_id is null and operation_analytique.f_id is not null then
81 ( SELECT fiche_detail.ad_value
82 FROM fiche_detail
83 WHERE fiche_detail.ad_id = 1 AND fiche_detail.f_id = operation_analytique.f_id)
84 end
85 AS name,
86 case when jrnx.j_poste is not null then
87 jrnx.j_poste
88 when jrnx.j_poste is null then
89 (SELECT fiche_detail.ad_value
90 FROM fiche_detail
91 WHERE fiche_detail.ad_id = 5 AND fiche_detail.f_id = operation_analytique.f_id) end as j_poste
92 FROM operation_analytique
93 left JOIN jrnx USING (j_id) )
94 SELECT po.po_id, po.pa_id, po.po_name, po.po_description, sum(
95 CASE
96 WHEN operation_analytique.oa_debit = true THEN operation_analytique.oa_amount * (-1)::numeric
97 ELSE operation_analytique.oa_amount
98 END) AS sum_amount, m.j_poste, tmp_pcmn.pcm_lib AS name
99 FROM operation_analytique
100 JOIN poste_analytique po USING (po_id)
101 JOIN m USING (oa_id)
102 JOIN tmp_pcmn ON m.j_poste::text = tmp_pcmn.pcm_val::text
103 where pa_id=$1 ".$date.$sql_from_poste.$sql_to_poste."
104 GROUP BY po.po_id, po.po_name, po.pa_id, m.j_poste, tmp_pcmn.pcm_lib, po.po_description
105 HAVING sum(
106CASE
107 WHEN operation_analytique.oa_debit = true THEN operation_analytique.oa_amount * (-1)::numeric
108 ELSE operation_analytique.oa_amount
109END) <> 0::numeric order by po_id,j_poste
110",array($this->pa_id));
111
112 }
113 /**
114 * \brief load the data
115 * does not return anything but give a value to this->aheader and this->arow
116 */
117 function load_anc_card()
118 {
119 $date=$this->set_sql_filter();
120 $date=($date != '')?" $date":'';
121 $sql_from_poste=($this->from_poste!='')?" and po.po_name >= upper('".Database::escape_string($this->from_poste)."')":'';
122 $sql_to_poste=($this->to_poste!='')?" and po.po_name <= upper('".Database::escape_string($this->to_poste)."')":'';
123 $this->arow=$this->db->get_array("
124with m as (select oa_id, po_id,
125 coalesce(jrnx.f_id,operation_analytique.f_id) as f_id1,
126 case when jrnx.j_qcode is not null then
127 ( SELECT fiche_detail.ad_value
128 FROM fiche_detail
129 WHERE fiche_detail.ad_id = 1 AND fiche_detail.f_id = jrnx.f_id)
130 when jrnx.f_id is null and operation_analytique.f_id is not null then
131 ( SELECT fiche_detail.ad_value
132 FROM fiche_detail
133 WHERE fiche_detail.ad_id = 1 AND fiche_detail.f_id = operation_analytique.f_id)
134 end
135 AS name,
136 case when jrnx.j_qcode is not null then
137 jrnx.j_qcode
138 when jrnx.j_qcode is null then
139 jrnx.j_poste end as j_qcode
140 FROM operation_analytique
141 left JOIN jrnx USING (j_id) )
142SELECT po.po_id, po.pa_id, po.po_name, po.po_description, sum(
143 CASE
144 WHEN operation_analytique.oa_debit = true THEN operation_analytique.oa_amount * (-1)::numeric
145 ELSE operation_analytique.oa_amount
146 END) AS sum_amount, m.f_id1 as f_id, m.j_qcode, m.name
147 FROM operation_analytique
148 JOIN poste_analytique po USING (po_id)
149 JOIN m USING (oa_id) ".
150 " where pa_id=$1 ".$date.$sql_from_poste.$sql_to_poste
151 ."
152 GROUP BY po.po_id, po.po_name, po.pa_id, m.f_id1, m.j_qcode, m.name, po.po_description
153 HAVING sum(
154CASE
155 WHEN operation_analytique.oa_debit = true THEN operation_analytique.oa_amount * (-1)::numeric
156 ELSE operation_analytique.oa_amount
157END) <> 0::numeric order by po_name,name",array($this->pa_id));
158
159 }
160
161 /**
162 * \brief load the data
163 * does not return anything but give a value to this->aheader and this->arow
164 */
165 function load_poste()
166 {
167 $date=$this->set_sql_filter();
168 $date=($date != '')?" $date":'';
169 $sql_from_poste=($this->from_poste!='')?" and po.po_name >= upper('".Database::escape_string($this->from_poste)."')":'';
170 $sql_to_poste=($this->to_poste!='')?" and po.po_name <= upper('".Database::escape_string($this->to_poste)."')":'';
171 $this->arow=$this->db->get_array("
172 with m as (select oa_id,po_id,
173 coalesce(jrnx.f_id,operation_analytique.f_id) as f_id1,
174 case when jrnx.j_qcode is not null then
175 ( SELECT fiche_detail.ad_value
176 FROM fiche_detail
177 WHERE fiche_detail.ad_id = 1 AND fiche_detail.f_id = jrnx.f_id)
178 when jrnx.f_id is null and operation_analytique.f_id is not null then
179 ( SELECT fiche_detail.ad_value
180 FROM fiche_detail
181 WHERE fiche_detail.ad_id = 1 AND fiche_detail.f_id = operation_analytique.f_id)
182 end
183 AS name,
184 case when jrnx.j_poste is not null then
185 jrnx.j_poste
186 when jrnx.j_poste is null then
187 (SELECT fiche_detail.ad_value
188 FROM fiche_detail
189 WHERE fiche_detail.ad_id = 5 AND fiche_detail.f_id = operation_analytique.f_id) end as j_poste
190 FROM operation_analytique
191 left JOIN jrnx USING (j_id) )
192 SELECT po.po_id, po.pa_id, po.po_name, po.po_description, sum(
193 CASE
194 WHEN operation_analytique.oa_debit = true THEN operation_analytique.oa_amount * (-1)::numeric
195 ELSE operation_analytique.oa_amount
196 END) AS sum_amount, m.j_poste, tmp_pcmn.pcm_lib AS name
197 FROM operation_analytique
198 JOIN poste_analytique po USING (po_id)
199 JOIN m USING (oa_id)
200 JOIN tmp_pcmn ON m.j_poste::text = tmp_pcmn.pcm_val::text
201 where
202 pa_id=$1 ".$date.$sql_from_poste.$sql_to_poste."
203 GROUP BY po.po_id, po.po_name, po.pa_id, m.j_poste, tmp_pcmn.pcm_lib, po.po_description
204 HAVING sum(
205CASE
206 WHEN operation_analytique.oa_debit = true THEN operation_analytique.oa_amount * (-1)::numeric
207 ELSE operation_analytique.oa_amount
208END) <> 0::numeric order by po_id,po_name
209
210",array($this->pa_id));
211
212 }
213
214 /**
215 * \brief load the data
216 * does not return anything but give a value to this->aheader and this->arow
217 */
218 function load_card()
219 {
220 $date=$this->set_sql_filter();
221 $date=($date != '')?" $date":'';
222 $sql_from_poste=($this->from_poste!='')?" and po.po_name >= upper('".Database::escape_string($this->from_poste)."')":'';
223 $sql_to_poste=($this->to_poste!='')?" and po.po_name <= upper('".Database::escape_string($this->to_poste)."')":'';
224
225 $this->arow=$this->db->get_array("
226with m as(
227 select
228 oa_id,
229 po_id,
230 case when operation_analytique.oa_debit = true then operation_analytique.oa_amount *(- 1 )::numeric else operation_analytique.oa_amount end as m_amount,
231 coalesce(
232 jrnx.f_id,
233 operation_analytique.f_id
234 ) as f_id1,
235 case
236 when jrnx.j_qcode is not null then(
237 select
238 fiche_detail.ad_value
239 from
240 fiche_detail
241 where
242 fiche_detail.ad_id = 1
243 and fiche_detail.f_id = jrnx.f_id
244 )
245 when jrnx.f_id is null
246 and operation_analytique.f_id is not null then(
247 select
248 fiche_detail.ad_value
249 from
250 fiche_detail
251 where
252 fiche_detail.ad_id = 1
253 and fiche_detail.f_id = operation_analytique.f_id
254 )
255 end as name,
256 case
257 when jrnx.j_qcode is not null then jrnx.j_qcode
258 when jrnx.f_id is null then(
259 select
260 fiche_detail.ad_value
261 from
262 fiche_detail
263 where
264 fiche_detail.ad_id = 23
265 and fiche_detail.f_id = operation_analytique.f_id
266 )
267 end as j_qcode
268 from
269 operation_analytique
270 left join jrnx using(j_id)
271 join poste_analytique using (po_id)
272 where pa_id=$1
273) select
274 po.po_id,
275 po.pa_id,
276 po.po_name,
277 po.po_description,
278 sum( m_amount) as sum_amount,
279 m.f_id1 as f_id,
280 m.j_qcode,
281 m.name
282from
283 operation_analytique join m using(oa_id)
284 join poste_analytique po on (m.po_id=po.po_id)
285where
286 po.pa_id = $1
287 {$date} {$sql_from_poste} {$sql_to_poste}
288group by
289 m.f_id1,
290 m.j_qcode,
291 po.po_id,
292 po.po_name,
293 po.pa_id,
294 m.name,
295 po.po_description
296having
297 sum( m_amount )<> 0::numeric
298order by
299 name,
300 po_name
301
302",array($this->pa_id));
303 }
304 /**
305 *@brief display the button export CSV
306 *@param $p_hidden is a string containing hidden items
307 *@return html string
308 */
309 function show_button($p_hidden="")
310 {
311 $r="";
312 $r.= '<form method="GET" action="export.php" style="display:inline">';
313 $r.= HtmlInput::hidden("act","CSV:AncAccList");
314 $r.= HtmlInput::hidden("to",$this->to);
315 $r.= HtmlInput::hidden("from",$this->from);
316 $r.= HtmlInput::hidden("pa_id",$this->pa_id);
317 $r.= HtmlInput::hidden("from_poste",$this->from_poste);
318 $r.= HtmlInput::hidden("to_poste",$this->to_poste);
319 $r.= HtmlInput::hidden("card_poste",$this->card_poste);
320
321 $r.= $p_hidden;
322 $r.= dossier::hidden();
323 $r.=HtmlInput::submit('bt_csv',"Export en CSV");
324 $r.= '</form>';
325 $r.= '<form method="GET" action="export.php" style="display:inline">';
326 $r.= HtmlInput::hidden("act","PDF:AncAccList");
327 $r.= HtmlInput::hidden("to",$this->to);
328 $r.= HtmlInput::hidden("from",$this->from);
329 $r.= HtmlInput::hidden("pa_id",$this->pa_id);
330 $r.= HtmlInput::hidden("from_poste",$this->from_poste);
331 $r.= HtmlInput::hidden("to_poste",$this->to_poste);
332 $r.= HtmlInput::hidden("card_poste",$this->card_poste);
333
334 $r.= $p_hidden;
335 $r.= dossier::hidden();
336 $r.=HtmlInput::submit('bt_pdf',"Export en PDF");
337 $r.= '</form>';
338 return $r;
339 }
340 /**
341 * Display the result of accountancy and analytic ,
342 * Axis / Card
343 * Card / Axis
344 * Accounting / Axis
345 * Axis / Accounting
346 */
347 function display_html()
348 {
349 bcscale(2);
350 if ( $this->check() != 0)
351 {
352 alert(_('Date invalide'));
353 return;
354 }
355 //---------------------------------------------------------------------------
356 // Card - Acc
357 //---------------------------------------------------------------------------
358
359 if ( $this->card_poste=='1')
360 {
361 $this->load_card();
362
363 /*
364 * Show all the result
365 */
366 $tot_card=0;$prev='';
367 echo '<table class="result" style="margin-left:5px;margin-top:5px">';
368 $tot_glob=0;
369 for ($i=0;$i<count($this->arow);$i++)
370 {
371 if ( $i == 0 )
372 {
373 $prev=$this->arow[$i]['f_id'];
374 echo '<tr><td>['.HtmlInput::history_card ($this->arow[$i]['f_id'],$this->arow[$i]['j_qcode'].'] '.$this->arow[$i]['name'],' display:inline').'</td></tr>';
375 }
376 $style= ( $i % 2 == 0)?' class="odd" ':' class="even" ';
377 if ( $i != 0 && $prev != $this->arow[$i]['f_id'])
378 {
379 echo td('Total');
380 echo td(nbm($tot_card),' class="num"');
381 echo '</tr>';
382 echo '<tr style="padding-top:5px"><td> ['.HtmlInput::history_card($this->arow[$i]['f_id'],$this->arow[$i]['j_qcode'].'] '.$this->arow[$i]['name'],' display:inline ').'</td></tr>';
383 $tot_card=0;
384 $prev = $this->arow[$i]['f_id'];
385 }
386
387 echo '<tr '.$style.'>';
388 $amount=$this->arow[$i]['sum_amount'];
389 if ($amount==null)$amount=0;
390
391 $tot_card=bcadd($tot_card,$amount);
392 $tot_glob=bcadd($tot_glob,$amount);
393 echo td($this->arow[$i]['po_name']." ".
394 $this->arow[$i]['po_description'],'style="padding-left:10"');
395 echo td(nbm($amount),' class="num" ');
396 echo '</tr>';
397
398 }
399 echo '<tr>';
400 echo td('Total');
401 echo td(nbm($tot_card),' class="num"');
402 echo '</tr>';
403
404 echo '</table>';
405 echo '<h2>'._("Résultat global")." ".nbm($tot_glob).'</h2>';
406 }
407 //---------------------------------------------------------------------------
408 // Accountancy - Analytic
409 //---------------------------------------------------------------------------
410
411 if ( $this->card_poste=='2')
412 {
413 $this->load_poste();
414 /*
415 * Show all the result
416 */
417 $tot_card=0;$prev='';
418 echo '<table class="result" style="margin-left:20px;margin-top:5px">';
419 $tot_glob=0;
420 for ($i=0;$i<count($this->arow);$i++)
421 {
422 if ( $i == 0 )
423 {
424 $prev=$this->arow[$i]['j_poste'];
425 echo '<tr><td>['.HtmlInput::history_account ($this->arow[$i]['j_poste'],$this->arow[$i]['j_poste'].'] '.$this->arow[$i]['name'],' display:inline').'</td></tr>';
426 }
427 $style= ( $i % 2 == 0)?' class="odd" ':' class="even" ';
428 if ( $i != 0 && $prev != $this->arow[$i]['j_poste'])
429 {
430 echo td('Total');
431 echo td(nbm($tot_card),' class="num"');
432 echo '</tr>';
433 echo '<tr style="padding-top:5px"><td>['.HtmlInput::history_account($this->arow[$i]['j_poste'],$this->arow[$i]['j_poste'].'] '.$this->arow[$i]['name'],' display:inline ').'</td></tr>';
434 $tot_card=0;
435 $prev = $this->arow[$i]['j_poste'];
436 }
437
438 echo '<tr '.$style.'>';
439 $amount=$this->arow[$i]['sum_amount'];
440 if ($amount==null)$amount=0;
441
442 $tot_card=bcadd($tot_card,$amount);
443 $tot_glob=bcadd($tot_glob,$amount);
444
445
446 echo td($this->arow[$i]['po_name']." ".
447 $this->arow[$i]['po_description'],'style="padding-left:10"');
448 echo td(nbm($amount),' class="num" ');
449 echo '</tr>';
450
451 }
452 echo '<tr>';
453 echo td('Total');
454 echo td(nbm($tot_card),' class="num"');
455 echo '</tr>';
456
457 echo '</table>';
458 echo '<h2>'._("Résultat global")." ".nbm($tot_glob).'</h2>';
459 }
460 //---------------------------------------------------------------------------
461 // Acc after card
462 //---------------------------------------------------------------------------
463 if ( $this->card_poste=='3')
464 {
465 $this->load_anc_card();
466 /*
467 * Show all the result
468 */
469 $tot_card=0;$prev='';
470 echo '<table class="result" style="margin-left:20px;margin-top:5px">';
471 $tot_glob=0;
472 for ($i=0;$i<count($this->arow);$i++)
473 {
474 if ( $i == 0 )
475 {
476 $prev=$this->arow[$i]['po_id'];
477 echo '<tr><td>'.$this->arow[$i]['po_name']." ".$this->arow[$i]['po_description'].'</td></tr>';
478
479 }
480 $style= ( $i % 2 == 0)?' class="odd" ':' class="even" ';
481 if ( $i != 0 && $prev != $this->arow[$i]['po_id'])
482 {
483 echo td('Total');
484 echo td(nbm($tot_card),' class="num"');
485 echo '</tr>';
486 echo '<tr><td>'.$this->arow[$i]['po_name']." ".$this->arow[$i]['po_description'].'</td></tr>';
487
488 $tot_card=0;
489 $prev = $this->arow[$i]['po_id'];
490 }
491
492 echo '<tr '.$style.'>';
493 $amount=$this->arow[$i]['sum_amount'];
494 if ($amount==null)$amount=0;
495
496 $tot_card=bcadd($tot_card,$amount);
497 $tot_glob=bcadd($tot_glob,$amount);
498 echo '<td style="padding-left:10px;">'.HtmlInput::history_card ($this->arow[$i]['f_id'],$this->arow[$i]['j_qcode'].' '.$this->arow[$i]['name'],' display:inline').'</td>';
499
500 echo td(nbm($amount),' class="num" ');
501 echo '</tr>';
502
503 }
504 echo '<tr>';
505 echo td('Total');
506 echo td(nbm($tot_card),' class="num"');
507 echo '</tr>';
508
509 echo '</table>';
510 echo '<h2>'._("Résultat global")." ".nbm($tot_glob).'</h2>';
511 }
512 //---------------------------------------------------------------------------
513 // Analytic - Accountancy
514 //---------------------------------------------------------------------------
515
516
517 if ( $this->card_poste=='4')
518 {
519 $this->load_anc_account();
520
521 /*
522 * Show all the result
523 */
524 $tot_card=0;$prev='';
525 echo '<table class="result" style="margin-left:20px;margin-top:5px">';
526 $tot_glob=0;
527 for ($i=0;$i<count($this->arow);$i++)
528 {
529 if ( $i == 0 )
530 {
531 $prev=$this->arow[$i]['po_id'];
532 echo '<tr><td>'.$this->arow[$i]['po_name']." ".$this->arow[$i]['po_description'].'</td></tr>';
533 }
534 $style= ( $i % 2 == 0)?' class="odd" ':' class="even" ';
535 if ( $i != 0 && $prev != $this->arow[$i]['po_id'])
536 {
537 echo td('Total');
538 echo td(nbm($tot_card),' class="num"');
539 echo '</tr>';
540
541 $tot_card=0;
542 $prev = $this->arow[$i]['po_id'];
543 echo '<tr><td>'.$this->arow[$i]['po_name']." ".$this->arow[$i]['po_description'].'</td></tr>';
544
545 }
546
547 echo '<tr '.$style.'>';
548 $amount=$this->arow[$i]['sum_amount'];
549 if ($amount==null)$amount=0;
550
551 $tot_card=bcadd($tot_card,$amount);
552 $tot_glob=bcadd($tot_glob,$amount);
553 echo '<td style="padding-left:10px;">'.HtmlInput::history_account ($this->arow[$i]['j_poste'],$this->arow[$i]['j_poste'].' '.$this->arow[$i]['name'],' display:inline').'</td>';
554 echo td(nbm($amount),' class="num" ');
555 echo '</tr>';
556
557 }
558 echo '<tr>';
559 echo td('Total');
560 echo td(nbm($tot_card),' class="num"');
561 echo '</tr>';
562
563 echo '</table>';
564 echo '<h2>'._("Résultat global")." ".nbm($tot_glob).'</h2>';
565 }
566
567 }
568 function export_csv()
569 {
570 bcscale(2);
571 $csv=new Noalyss_CSV('export-anc-list');
572 $csv->send_header();
573 if ( $this->check () != 0 ) {throw new Exception (_("date invalide"));}
574 //---------------------------------------------------------------------------
575 // Card - Acc
576 //---------------------------------------------------------------------------
577 if ( $this->card_poste=='1')
578 {
579 $this->load_card();
580
581 /*
582 * Show all the result
583 */
584 $prev='';
585
586 for ($i=0;$i<count($this->arow);$i++)
587 {
588
589 $csv->add($this->arow[$i]['j_qcode']);
590 $csv->add($this->arow[$i]['name']);
591 $csv->add($this->arow[$i]['name']);
592 $csv->add($this->arow[$i]['po_name']);
593 $csv->add($this->arow[$i]['po_description']);
594
595 $amount=$this->arow[$i]['sum_amount'];
596 if ($amount==null)$amount=0;
597 $csv->add($amount,"number");
598
599 $csv->write();
600 }
601 }
602 //---------------------------------------------------------------------------
603 // Accountancy - Analytic
604 //---------------------------------------------------------------------------
605
606 if ( $this->card_poste=='2')
607 {
608 $this->load_poste();
609 /*
610 * Show all the result
611 */
612 for ($i=0;$i<count($this->arow);$i++)
613 {
614 $csv->add( $this->arow[$i]['j_poste']);
615 $csv->add( $this->arow[$i]['name']);
616 $csv->add( $this->arow[$i]['po_name']);
617 $csv->add( $this->arow[$i]['po_description']);
618
619 $amount=$this->arow[$i]['sum_amount'];
620 if ($amount==null)$amount=0;
621 $csv->add($amount,"number");
622
623 $csv->write();
624
625
626 }
627
628 }
629 //---------------------------------------------------------------------------
630 // Acc after card
631 //---------------------------------------------------------------------------
632 if ( $this->card_poste=='3')
633 {
634 $this->load_anc_card();
635 /*
636 * Show all the result
637 */
638 for ($i=0;$i<count($this->arow);$i++)
639 {
640 $csv->add( $this->arow[$i]['po_name']);
641 $csv->add( $this->arow[$i]['po_description']);
642 $csv->add( $this->arow[$i]['j_qcode']);
643 $csv->add( $this->arow[$i]['name']);
644
645 $amount=$this->arow[$i]['sum_amount'];
646 if ($amount==null)$amount=0;
647
648 $csv->add($amount,"number");
649
650 $csv->write();
651
652
653
654 }
655 }
656 //---------------------------------------------------------------------------
657 // Analytic - Accountancy
658 //---------------------------------------------------------------------------
659
660
661 if ( $this->card_poste=='4')
662 {
663 $this->load_anc_account();
664
665 /*
666 * Show all the result
667 */
668 for ($i=0;$i<count($this->arow);$i++)
669 {
670 $csv->add( $this->arow[$i]['po_name']);
671 $csv->add( $this->arow[$i]['po_description']);
672 $csv->add( $this->arow[$i]['j_poste']);
673 $csv->add( $this->arow[$i]['name']);
674
675 $amount=$this->arow[$i]['sum_amount'];
676 if ($amount==null)$amount=0;
677
678 $csv->add($amount,"number");
679
680 $csv->write();
681
682 }
683 }
684
685
686
687
688 }
689
690}
td($p_string='', $p_extra='')
surround the string with td
Definition ac_common.php:83
nbm($p_number, $p_dec=2)
format the number with a sep.
alert($p_msg, $buffer=false)
alert in javascript
catch(Exception $exc) if(! $g_user->can_write_action($ag_id)) $r
$anc pa_id
$anc_grandlivre from_poste
$anc_grandlivre to
$anc_grandlivre to_poste
$anc_grandlivre from
_("actif, passif,charge,...")
Manage the class for reporting about Analytic Accountancy and Accountancy : card - analytic account,...
display_form($p_hidden='')
display form to get the parameter
load_anc_card()
load the data does not return anything but give a value to this->aheader and this->arow
load_poste()
load the data does not return anything but give a value to this->aheader and this->arow
$arow
$arow array of row from
display_html()
Display the result of accountancy and analytic , Axis / Card Card / Axis Accounting / Axis Axis / Acc...
load_anc_account()
load the data does not return anything but give a value to this->aheader and this->arow
show_button($p_hidden="")
display the button export CSV
load_card()
load the data does not return anything but give a value to this->aheader and this->arow
static escape_string($p_string)
wrapper for the function pg_escape_string
Html Input , create a tag <SELECT> ... </SELECT> if readonly == true then display the label correspon...
$SecUser db