noalyss Version-9
fiche.inc.php
Go to the documentation of this file.
1<?php
2
3/*
4 * This file is part of NOALYSS.
5 *
6 * NOALYSS is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * NOALYSS is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with NOALYSS; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 */
20// Copyright Author Dany De Bontridder danydb@aevalys.eu
21/**
22 * \file
23 * \brief printing of category of card : balance, historic
24 */
25if ( ! defined ('ALLOWED') ) die('Appel direct ne sont pas permis');
26
31
32
33/**
34 * Show first the form
35 */
36/* category */
37$categorie = new ISelect('cat');
38$categorie->value = $cn->make_array("select fd_id,fd_label||' ('||(select count(*) from fiche where fiche.fd_id=fiche_def.fd_id)::text||')' from fiche_def order by fd_label");
39$categorie->selected = $http->get('cat','number',0);
41$ac = $http->request('ac');
42$icall = new ICheckBox("allcard", 1);
43$icall->selected = (isset($_GET['allcard'])) ? 1 : 0;
44$str_icall = $icall->input();
45/* periode */
46$exercice = $g_user->get_exercice();
48list ($first, $last) = $iperiode->get_limit($exercice);
49
50$periode_start = new IDate('start');
51$periode_end = new IDate('end');
52
53$periode_start->value = $http->get('start',"date",$first->first_day());
54$periode_end->value = $http->get('end','date', $last->last_day());
55
58
59/* histo ou summary */
60$histo = new ISelect('histo');
61$histo->value = array(
62 array('value' => -1, 'label' => _('Liste')),
63 array('value' => 0, 'label' => _('Historique')),
64 array('value' => 1, 'label' => _('Historique Lettré')),
65 array('value' => 6, 'label' => _('Historique Lettré et montants différents')),
66 array('value' => 2, 'label' => _('Historique non Lettré')),
67 array('value' => 3, 'label' => _('Résumé')),
68 array('value' => 4, 'label' => _('Balance')),
69 array('value' => 8, 'label' => _('Balance âgée')),
70 array('value' => 7, 'label' => _('Balance âgée en-cours')),
71 array('value' => 5, 'label' => _('Balance non soldée'))
72);
73$histo->javascript = 'onchange="if (this.value==3 || this.value==-1) {
74 g(&quot;trstart&quot;).style.display=&quot;none&quot;;g(&quot;trend&quot;).style.display=&quot;none&quot;;g(&quot;allcard&quot;).style.display=&quot;none&quot;;}
75 else {g(&quot;trstart&quot;).style.display=&quot;&quot;;g(&quot;trend&quot;).style.display=&quot;&quot;;g(&quot;allcard&quot;).style.display=&quot;&quot;;}"';
76
77$histo->selected = $http->get('histo',"number", -1);
78$str_histo = $histo->input();
79?>
80<div class="content">
81
82<?php
83echo '<FORM method="GET">';
84echo dossier::hidden();
85echo HtmlInput::hidden('ac', $ac);
86require_once NOALYSS_TEMPLATE.'/impress_cat_card.php';
87echo HtmlInput::submit('cat_display', _('Recherche'));
88echo '</FORM>';
89
90echo '</div>';
91$str = "if (g('histo').value==3 || g('histo').value== -1 ) {
92 g('trstart').style.display='none';g('trend').style.display='none';g('allcard').style.display='none';}
93 else {g('trstart').style.display='';g('trend').style.display='';g('allcard').style.display='';}
94 if ( g('histo').value== -1 ) { g('allcard').style.display='';}
95
96 ";
98echo '<hr>';
99
100//-----------------------------------------------------
101if (!isset($_GET['cat_display']))
102 return;
103
104$fd_id =$categorie->selected ;
105
106$array = Fiche::get_fiche_def($cn,$categorie->selected , 'name_asc');
107
108$h_add_card_b = new IButton('add_card');
109$h_add_card_b->label = _('Créer une nouvelle fiche');
110$h_add_card_b->javascript = "dis_blank_card({gDossier:$gDossier,fd_id:$fd_id,ref:2})";
111$str_add_card = ($g_user->check_action(FICADD) == 1) ? $h_add_card_b->input() : "";
112
113/*
114 * You show now the result
115 */
116
117$allcard = (isset($_GET['allcard'])) ? 1 : 0;
118if ( $allcard == 0 ){
119 $fiche_def=new Fiche_Def($cn,$categorie->selected );
120 $fiche_def->get();
121 echo h1($fiche_def->label,"");
122 echo h2($fiche_def->fd_description,"");
123}
124// if no card found , stop here
125if ($array == null && $allcard == 0 && $histo->selected != 3 )
126{
127 echo '<div class="content">';
128 echo '<h2 class="error"> '._('Aucune fiche trouvée').'</h2>';
129 echo $str_add_card;
130 echo '</div>';
131 return;
132}
133
134echo '<div class="content">';
135/* * *************************************************************************************************************
136 * Liste
137 *
138 * ***************************************************************************************************************/
139if ($histo->selected == -1)
140{
141 $write = $g_user->check_action(FICADD);
142 /**
143 * If ask for move or delete
144 */
145 if (isset($_POST['action']))
146 {
147 if ($write == 1)
148 {
149 $ack = $http->post("f_id","array",[]);
150 /**
151 * Move
152 */
153 if (isset($_POST['move'])&& $_POST['move'] == 1)
154 {
155 $move_to=$http->post("move_to","number");
156 for ($i = 0; $i < count($ack); $i++)
157 {
158 $fiche = new Fiche($cn, $ack[$i]);
159 $fiche->move_to($move_to);
160 }
161 }
162 /**
163 * Delete
164 */
165 if (isset($_POST['delete'])&& $_POST['delete']==1)
166 {
167 $msg="";
168 for ($i = 0; $i < count($ack); $i++)
169 {
170 $fiche = new Fiche($cn, $ack[$i]);
171 if ( $fiche->remove(true) == 1 )
172 {
173 $msg.="\n ".$fiche->strAttribut(ATTR_DEF_QUICKCODE);
174 }
175 }
176 if ($msg != "")
177 {
178 echo '<div class="content">';
179 echo h2(_("Fiche non effacées"), ' class="error" ');
180 echo '<p class="error">'._(" Ces fiches n'ont pas été effacées ").$msg;
181 echo '</div>';
182 }
183 }
184 }
185 else
186 {
187 echo NoAccess();
188 }
189 }
190 $sql = "select f_id from fiche ";
191 if ($allcard == 1)
192 {
193 $cond = "";
194 }
195 else
196 {
197 $p_cat=$http->get("cat","number");
198 $cond = " where f.fd_id = " . sql_string($p_cat);
199 }
200 // Create nav bar
201 $max = $cn->get_value("select count(*) from fiche as f " . $cond);
202
203 $step = $_SESSION[SESSION_KEY.'g_pagesize'];
204 $page=$http->get("page","number",1);
205 $offset=$http->get("offset","number",0);
207 $limit = ($step == -1 ) ? "" : " limit " . $step;
208 $res = $cn->exec_sql("
209 select f_id,
210 (select ad_value from fiche_detail as fd1 where ad_id=1 and fd1.f_id=f.f_id) as name,
211 (select ad_value from fiche_detail as fd1 where ad_id=23 and fd1.f_id=f.f_id) as qcode,
212 fd_label,
213 (select ad_value from fiche_detail as fd1 where ad_id=5 and fd1.f_id=f.f_id) as poste
214 from fiche as f join fiche_def as fd on (fd.fd_id=f.fd_id)
215 $cond order by 2,4 offset $offset $limit
216 ");
217 $nb_line = Database::num_row($res);
218 if ($write != 1 || $allcard != 0 ) $str_add_card="";
219 require_once NOALYSS_TEMPLATE.'/fiche_list.php';
220 echo '<hr>'.$bar;
221 return;
222}
223/* * *********************************************************************************************************************************
224 * Summary
225 *
226 * ******************************************************************************************************************************** */
227if ($histo->selected == 3)
228{
229 $cat_card = new Fiche_Def($cn);
230 $cat_card->id =$http->get('cat','number');
231 $aHeading = $cat_card->getAttribut();
232 $str_add_card="";
233 if ( $allcard == 0 ) {
234 $h_add_card_b = new IButton('add_card');
235 $h_add_card_b->label = _('Créer une nouvelle fiche');
236 $h_add_card_b->javascript = "dis_blank_card({gDossier:$gDossier,fd_id:$fd_id,after_save:1,ref:2})";
238 }
239 echo $str_add_card;
240 require_once NOALYSS_TEMPLATE.'/result_cat_card_summary.php';
241
242 $hid = new IHidden();
243 echo '<form method="GET" ACTION="export.php">' . dossier::hidden() ;
244 echo $str_add_card;
245 echo
246 HtmlInput::submit('bt_csv', _("Export CSV")) .
247 HtmlInput::hidden('act', "CSV:fiche") .
248 $hid->input("type", "fiche") .
249 $hid->input("ac", $http->request('ac')) .
250 $hid->input("fd_id", $http->request('cat',"number"));
251 echo "</form>";
252
253 return;
254}
255$cat=$http->get("cat","number");
256$phisto=$http->get("histo","number");
257
258$export_pdf = '<FORM METHOD="get" ACTION="export.php" style="display:inline">';
260$export_pdf.=HtmlInput::hidden('act', "PDF:fiche_balance") .
261$export_pdf.=HtmlInput::hidden('start', $periode_start->value );
265$export_pdf.=dossier::hidden();
266$export_pdf.=HtmlInput::submit('pdf', _('Export en PDF'));
267$export_pdf.='</FORM>';
268
270
271$export_csv = '<FORM METHOD="get" ACTION="export.php" style="display:inline">';
273$export_csv.=HtmlInput::hidden('act', 'CSV:fiche_balance');
278$export_csv.=dossier::hidden();
279$export_csv.=HtmlInput::submit('CSV', _('Export en CSV'));
280$export_csv.='</FORM>';
281/*
282 * Date is important is requested balance
283 */
284if (isDate($_REQUEST['start']) == null || isDate($_REQUEST['end']) == null)
285{
286 echo h2('Date invalide !', 'class="error"');
287 alert(_('Date invalide !'));
288 return;
289}
290/*************************************************************************************************************************/
291 // Balance agée tous
292/*************************************************************************************************************************/
293if ( $histo->selected == 8)
294{
295 $cat=$http->get("cat","number");
296 $bal=new Balance_Age($cn);
297 $export_csv = '<FORM METHOD="get" ACTION="export.php" style="display:inline">';
298 $export_csv .=HtmlInput::request_to_hidden(array('gDossier','ac','p_let','p_date_start'));
299 $export_csv.=HtmlInput::hidden('p_date_start',$periode_start->value );
300 $export_csv .= HtmlInput::hidden('act','CSV:balance_age');
301 $export_csv .= HtmlInput::hidden('p_let','let');
302 $export_csv .= HtmlInput::hidden('p_type','X');
305 $export_csv .= HtmlInput::submit('csv',_('Export CSV'));
306 $export_csv.='</FORM><p></p>';
307 if ( $allcard == 0 )
308 {
309 echo $export_csv;
310 $bal->display_category($periode_start->value ,$cat,'let');
311 echo $export_csv;
312 }
313 else
314 {
315 echo $export_csv;
316 $a_cat = $cn->get_array("select fd_id from vw_fiche_def where ad_id=" . ATTR_DEF_ACCOUNT . " order by fd_label asc");
317 $nb_cat=count($a_cat);
318 for ($i=0;$i < $nb_cat;$i++)
319 {
320 $bal->display_category($periode_start->value ,$a_cat[$i]['fd_id'],'let');
321 }
322 echo $export_csv;
323 }
324 return;
325}
326/*************************************************************************************************************************/
327 // Balance en-cours
328/*************************************************************************************************************************/
329if ( $histo->selected == 7)
330{
331 $bal=new Balance_Age($cn);
332
333 $cat=$http->get("cat","number");
334 $export_csv = '<FORM METHOD="get" ACTION="export.php" style="display:inline">';
335 $export_csv .=HtmlInput::request_to_hidden(array('gDossier','ac','p_let','p_date_start'));
336 $export_csv.=HtmlInput::hidden('p_date_start', $periode_start->value );
337 $export_csv .= HtmlInput::hidden('act','CSV:balance_age');
338 $export_csv .= HtmlInput::hidden('p_let','unlet');
339 $export_csv .= HtmlInput::hidden('p_type','X');
342 $export_csv .= HtmlInput::submit('csv',_('Export CSV'));
343 $export_csv.='</FORM><p></p>';
344 if ( $allcard == 0 )
345 {
346 echo $export_csv;
347 $bal->display_category($periode_start->value ,$cat,'unlet');
348 echo $export_csv;
349 }
350 else
351 {
352 echo $export_csv;
353 $a_cat = $cn->get_array("select fd_id from vw_fiche_def where ad_id=" . ATTR_DEF_ACCOUNT . " order by fd_label asc");
354 $nb_cat=count($a_cat);
355 for ($i=0;$i < $nb_cat;$i++)
356 {
357 $bal->display_category($periode_start->value ,$a_cat[$i]['fd_id'],'unlet');
358 }
359 echo $export_csv;
360 }
361 return;
362}
363/********************************************************************************************************************************
364 * Balance
365 *
366 **********************************************************************************************************************************/
367if ($histo->selected == 4 || $histo->selected == 5)
368{
369 if ( $allcard == 0 ) echo $str_add_card;
370 echo $export_pdf;
371 echo $export_csv;
372 echo $export_print;
373
374 $fd = new Fiche_Def($cn, $categorie->selected );
375 if ($allcard == 0 && $fd->hasAttribute(ATTR_DEF_ACCOUNT) == false)
376 {
377 echo alert(_("Cette catégorie n'ayant pas de poste comptable n'a pas de balance"));
378 return;
379 }
380 // all card
381 if ($allcard == 1)
382 {
383 $afiche = $cn->get_array("select fd_id from vw_fiche_def where ad_id=" . ATTR_DEF_ACCOUNT . " order by fd_label asc");
384 }
385 else
386 {
387 $afiche[0] = array('fd_id' => $categorie->selected );
388 }
389
390 for ($e = 0; $e < count($afiche); $e++)
391 {
392 $ret = $cn->exec_sql("select f_id,ad_value from fiche join fiche_detail using(f_id) where fd_id=$1 and ad_id=1 order by 2 ", array($afiche[$e]['fd_id']));
393 if ($cn->count() == 0)
394 {
395 if ($allcard == 0)
396 {
397 echo _("Aucune fiche trouvée");
398 return;
399 } else
400 continue;
401 }
402 echo '<h2>' . $cn->get_value("select fd_label from fiche_def where fd_id=$1", array($afiche[$e]['fd_id'])) . '</h2>';
403 $id="table_".$afiche[$e]['fd_id']."_id";
404 echo _('Filtre rapide:').HtmlInput::filter_table($id, '0,1,2', '1');
405 echo '<table class="sortable" id="'.$id.'" class="result" >';
406 echo tr(
407 th(_('Quick Code')) .
408 th(_('Libellé')) .
409 '<th>'._('Poste').Icon_Action::infobulle(27).'</th>'.
410 th(_('Débit'), 'style="text-align:right"') .
411 th(_('Crédit'), 'style="text-align:right"') .
412 th(_('Solde'), 'style="text-align:right"') .
413 th(_('D/C'), 'style="text-align:right"')
414 );
415 $idx = 0;$sum_deb=0;$sum_cred=0;$sum_solde=0;bcscale(4);
416 for ($i = 0; $i < Database::num_row($ret); $i++)
417 {
418 $start=$http->request("start",'date');
419 $end=$http->request("end",'date');
420 $filter = " (j_date >= to_date('" . $start. "','DD.MM.YYYY') " .
421 " and j_date <= to_date('" . $end . "','DD.MM.YYYY')) ";
423 $oCard = new Fiche($cn, $aCard['f_id']);
424 $solde = $oCard->get_solde_detail($filter);
425 if ($solde['debit'] == 0 && $solde['credit'] == 0)
426 continue;
427 /* only not purged card */
428 if ($_GET['histo'] == 5 && $solde['debit'] == $solde['credit'])
429 continue;
430 $class =($idx % 2 == 0) ? 'class="odd"':'class="even"';
431 $idx++;
432 $sum_cred=bcadd($sum_cred,$solde['credit']);
433 $sum_deb=bcadd($sum_deb,$solde['debit']);
434 $sum_solde=bcsub($sum_deb,$sum_cred);
435 echo tr(
436 td(HtmlInput::history_card($oCard->id, $oCard->strAttribut(ATTR_DEF_QUICKCODE))) .
437 td($oCard->strAttribut(ATTR_DEF_NAME)) .
438 td(HtmlInput::history_account($oCard->strAttribut(ATTR_DEF_ACCOUNT),$oCard->strAttribut(ATTR_DEF_ACCOUNT))).
439 td(nbm($solde['debit']), 'class="sorttable_numeric" sorttable_customkey="'.$solde['debit'].'" style="text-align:right"') .
440 td(nbm($solde['credit']), 'class="sorttable_numeric" sorttable_customkey="'.$solde['debit'].'" style="text-align:right"') .
441 td(nbm(abs($solde['solde'])), 'class="sorttable_numeric" sorttable_customkey="'.$solde['solde'].'" style="text-align:right"') .
442 td(findSide($solde['debit'] - $solde['credit']), 'style="text-align:right"'), $class
443 );
444
445
446
447 }
448 echo '<tfoot>';
449 echo tr(
450 td('').
451 td(_('Totaux')).
452 td('').
453 td(nbm($sum_deb), 'style="text-align:right"').
454 td(nbm($sum_cred), 'style="text-align:right"').
455 td(nbm(abs($sum_solde)), 'style="text-align:right"').
456 td(findSide($sum_deb - $sum_cred) , 'style="text-align:right"'),
457 ' class="highlight"');
458 echo '</tfoot>';
459 echo '</table>';
460 }
461 if ( $allcard == 0 ) echo $str_add_card;
462 echo $export_pdf;
463 echo $export_csv;
464 echo $export_print;
465
466 return;
467}
468
469/***********************************************************************************************************************************
470 * Lettering
471 *
472 **********************************************************************************************************************************/
473// all card
474if ($allcard == 1)
475{
476 $afiche = $cn->get_array("select fd_id from vw_fiche_def where ad_id=" . ATTR_DEF_ACCOUNT . " order by fd_label asc");
477}
478else
479{
480
481 $p_cat=$http->request("cat","number");
482 $afiche[0] = array('fd_id' => $p_cat);
483}
484if ( $allcard == 0) echo $str_add_card;
485echo $export_csv;
486echo $export_pdf;
487echo $export_print;
489$histo=$http->get("histo","number");
491$clean_lettering->remove_incoherent();
492
493for ($e = 0; $e < count($afiche); $e++)
494{
495 $array = Fiche::get_fiche_def($cn, $afiche[$e]['fd_id'], 'name_asc');
496
497 foreach ($array as $card)
498 {
499 $row = new Fiche($cn, $card['f_id']);
501 $letter->set_parameter('quick_code', $row->strAttribut(ATTR_DEF_QUICKCODE));
502 $letter->set_parameter('start', $periode_start->value );
503 $letter->set_parameter('end', $periode_end->value );
504 // all
505 if ($histo== 0)
506 {
507 $letter->get_all();
508 }
509
510 // lettered
511 if ($histo == 1)
512 {
513 $letter->get_letter();
514 }
515 // unlettered
516 if ($histo == 2)
517 {
518 $letter->get_unletter();
519 }
520 if ($histo== 6)
521 {
522 $letter->get_letter_diff();
523 }
524 /* skip if nothing to display */
525 if (count($letter->content) == 0)
526 continue;
527 $detail_card = HtmlInput::card_detail($row->strAttribut(ATTR_DEF_QUICKCODE), $row->strAttribut(ATTR_DEF_NAME));
528
529 echo '<h2>' . $detail_card ;
530 echo "poste "
531 . ":".HtmlInput::history_account($row->strAttribut(ATTR_DEF_ACCOUNT),$row->strAttribut(ATTR_DEF_ACCOUNT),'display:inline').Icon_Action::infobulle(27).'</h2>';
532
533 echo '<table class="result">';
534 echo '<tr>';
535 echo th(_('Date'));
536 echo th(_('ref'));
537 echo th(_('Interne'));
538 echo th(_('Comm'));
539 echo th(_('Code Devise'));
540 echo th(_('Devise'),'style="text-align:right"');
541 echo th(_('Débit'), 'style="width:auto;text-align:right" ');
542 echo th(_('Crédit'), 'style="width:auto;text-align:right" ');
543 echo th(_('Prog.'),'style="text-align:right"');
544 echo th(_('Let.'));
545 echo '</tr>';
546 $amount_deb = 0;
547 $amount_cred = 0;
548 $prog = 0;
549 bcscale(2);
550 for ($i = 0; $i < count($letter->content); $i++)
551 {
552 $row = $letter->content[$i];
553 $html_letter="";
554 if ($row['letter']!=-1) {
555 $html_letter=strtoupper(base_convert($row['letter'],10,36));
556 }
557 if ($i % 2 == 0)
558 echo '<tr class="even" name="tr_'.$html_letter.'_">';
559 else
560 echo '<tr class="odd" name="tr_'.$html_letter.'_">';
561
562 echo td($row['j_date_fmt']);
563 echo td(h($row['jr_pj_number']));
564 echo td(HtmlInput::detail_op($row['jr_id'], $row['jr_internal']));
565 echo td(h($row['jr_comment']));
566 echo td($row['cr_code_iso']);
567 $str_currency_amount=($row['currency_id']==0)?"":nbm($row['currency_amount'],2);
568
569 echo td($str_currency_amount,'class="num"');
570 if ($row['j_debit'] == 't')
571 {
572 echo td(nbm($row['j_montant']), ' style="text-align:right"');
573 $amount_deb=bcadd($amount_deb,$row['j_montant']);
574 $prog = bcadd($prog, $row['j_montant']);
575 echo td("");
576 }
577 else
578 {
579 echo td("");
580 echo td(nbm($row['j_montant']), ' style="text-align:right"');
581 $amount_cred=bcadd($amount_cred,$row['j_montant']);
582 $prog = bcsub($prog, $row['j_montant']);
583 }
584 $side = "&nbsp;" . $fiche->get_amount_side($prog);
585 echo td(nbm(abs($prog)) . $side, 'style="text-align:right"');
586 $html_let="";
587 if ($row['letter']!=-1) {
588 $span_error = "";
589 if ($row['letter_diff'] != 0)
590 $span_error = $g_failed;
591 echo '<td>'.HtmlInput::show_reconcile("", $html_letter,$span_error).'</td>';
592 }
593 else
594 echo td('');
595 echo '</tr>';
596 }
597 echo '</table>';
598 echo '<table>';
599 echo '<tr>';
600 echo td(_('Debit'));
601 echo td(nbm($amount_deb), ' style="font-weight:bold;text-align:right"');
602 echo '</tr>';
603 echo '<tr>';
604 echo td(_('Credit'));
605 echo td(nbm($amount_cred), ' style="font-weight:bold;text-align:right"');
606 echo '</tr>';
607 echo '<tr class="highlight">';
608 $solde=abs(round($amount_cred - $amount_deb, 2));
609 if ( $solde == 0)
610 {
611 $s=_('solde');
612 }
613 else if ($amount_deb > $amount_cred)
614 $s = _('solde débiteur');
615 else
616 $s = _('solde crediteur');
617 echo td($s);
618 echo td(nbm($solde), ' style="font-weight:bold;text-align:right"');
619 echo '</tr>';
620 echo '</table>';
621 }
622}
623if ( $allcard == 0) echo $str_add_card;
624echo $export_csv;
625echo $export_pdf;
626echo $export_print;
627?>
628
h2($p_string, $p_class="", $raw="")
Definition: ac_common.php:68
th($p_string, $p_extra='', $raw='')
Definition: ac_common.php:58
findSide($p_number)
return D if the number is smaller than 0 , C if bigger and an empty string if equal to 0.
Definition: ac_common.php:121
isDate($p_date)
Definition: ac_common.php:236
h1($p_string, $p_class="")
Definition: ac_common.php:72
NoAccess($js=1)
Echo no access and stop.
Definition: ac_common.php:480
tr($p_string, $p_extra='')
Definition: ac_common.php:88
sql_string($p_string)
Fix the problem with the quote char for the database.
Definition: ac_common.php:511
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.
Definition: ac_common.php:137
alert($p_msg, $buffer=false)
alert in javascript
Definition: ac_common.php:738
h( $row[ 'oa_description'])
$idx
$_REQUEST['ac']
if(! empty( $error)) for($i=0;$i< count($error);$i++)( $last !=$error[$i]) $last
$filter
$input_from id
Definition: balance.inc.php:63
$_GET['qcode']
if($action=='add_line') if( $action=='remove_line') if($action=='remove_cat') if(isset($_POST['change_name'])) if($action=='save_line') if(isset($_POST['add_modele'])) $fiche_def
$class
compute the ageing balance, currently this code is not used
static fetch_array($ret, $p_indice=0, $p_mode=PGSQL_ASSOC)
wrapper for the function pg_fetch_array
static num_row($ret)
wrapper for the function pg_num_rows
static connect()
define Class fiche and fiche def, those class are using class attribut
define Class fiche and fiche def, those class are using class attribut. When adding or modifing new c...
Definition: fiche.class.php:38
static get_fiche_def($p_cn, $pFd_id, $p_order='')
get all the card from a categorie
static history_account($p_account, $p_mesg, $p_style="", $p_exercice="")
display a div with the history of the account
static detail_op($p_jr_id, $p_mesg)
return a string containing the html code for calling the modifyOperation
static request_to_hidden(array $array)
transform $_REQUEST data to hidden
static print_window()
Javascript to print the current window.
static card_detail($p_qcode, $pname='', $p_style="", $p_nohistory=false, $nofollowup=false)
show the detail of a card
static hidden($p_name, $p_value, $p_id="")
static history_card($f_id, $p_mesg, $p_style="", $p_exercice="")
display a div with the history of the card
static submit($p_name, $p_value, $p_javascript="", $p_class="smallbutton")
manage the http input (get , post, request) and extract from an array
Html Input.
Html Input.
Html Input : Input a date format dd.mm.yyyy The property title should be set to indicate what it is e...
Definition: idate.class.php:34
Html Input.
Html Input , create a tag <SELECT> ... </SELECT> if readonly == true then display the label correspon...
static infobulle($p_comment)
Display a info in a bubble, text is in message_javascript.
only for operation retrieved thanks a quick_code manage the accounting entries for a given card
mother class for the lettering by account and by card use the tables jnt_letter, letter_deb and lette...
For the periode tables parm_periode and jrn_periode.
const ATTR_DEF_NAME
Definition: constant.php:216
const ATTR_DEF_QUICKCODE
Definition: constant.php:237
const ATTR_DEF_ACCOUNT
Definition: constant.php:215
const FICADD
$_POST['ac']
Definition: do.php:310
global $g_failed
Definition: fiche.inc.php:30
$str_categorie
Definition: fiche.inc.php:40
$gDossier
Definition: fiche.inc.php:27
$allcard
Definition: fiche.inc.php:117
$cn
Definition: fiche.inc.php:28
$str_icall
Definition: fiche.inc.php:44
$icall
Definition: fiche.inc.php:42
$phisto
Definition: fiche.inc.php:256
global $g_user
Definition: fiche.inc.php:30
$export_csv
Definition: fiche.inc.php:271
$str_end
Definition: fiche.inc.php:57
$str
Definition: fiche.inc.php:91
$str_start
Definition: fiche.inc.php:56
$http
Definition: fiche.inc.php:29
$periode_start
Definition: fiche.inc.php:50
$ac
Definition: fiche.inc.php:41
$str_add_card
Definition: fiche.inc.php:111
$export_print
Definition: fiche.inc.php:269
$h_add_card_b
Definition: fiche.inc.php:108
$fiche
Definition: fiche.inc.php:488
$afiche[0]
Definition: fiche.inc.php:482
$str_histo
Definition: fiche.inc.php:78
$iperiode
Definition: fiche.inc.php:47
$clean_lettering
Definition: fiche.inc.php:490
if( $histo->selected==-1) if($histo->selected==3) $cat
Definition: fiche.inc.php:255
$array
Definition: fiche.inc.php:106
$categorie
Show first the form.
Definition: fiche.inc.php:37
$exercice
Definition: fiche.inc.php:46
$export_pdf
Definition: fiche.inc.php:258
$histo
Definition: fiche.inc.php:60
$fd_id
Definition: fiche.inc.php:104
$periode_end
Definition: fiche.inc.php:51
create_script($p_string)
create the HTML for adding the script tags around of the script
$amount_cred
Definition: letter_all.php:6
$amount_deb
Definition: letter_all.php:6
$side
navigation_bar($p_offset, $p_line, $p_size=0, $p_page=1, $p_javascript="")
Create a navigation_bar (pagesize)
Definition: user_common.php:76