noalyss  Version-6.9.1.8
 All Data Structures Namespaces Files Functions Variables Pages
class_acc_ledger_fin.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 
21 // Copyright Author Dany De Bontridder danydb@aevalys.eu
22 
23 /**\file
24  * \brief the class Acc_Ledger_Fin inherits from Acc_Ledger, this
25  * object permit to manage the financial ledger
26  */
27 require_once NOALYSS_INCLUDE.'/lib/class_idate.php';
28 require_once NOALYSS_INCLUDE.'/lib/class_icard.php';
29 require_once NOALYSS_INCLUDE.'/lib/class_ispan.php';
30 require_once NOALYSS_INCLUDE.'/lib/class_itext.php';
31 require_once NOALYSS_INCLUDE.'/lib/class_iconcerned.php';
32 require_once NOALYSS_INCLUDE.'/lib/class_ifile.php';
33 require_once NOALYSS_INCLUDE.'/lib/class_ihidden.php';
34 require_once NOALYSS_INCLUDE.'/lib/class_iselect.php';
35 require_once NOALYSS_INCLUDE.'/class/class_acc_ledger.php';
36 require_once NOALYSS_INCLUDE.'/lib/ac_common.php';
37 require_once NOALYSS_INCLUDE.'/class/class_acc_reconciliation.php';
38 
40 {
41 
42  function __construct($p_cn, $p_init)
43  {
44  parent::__construct($p_cn, $p_init);
45  $this->type = 'FIN';
46  }
47 
48  /**
49  * Verify that the data are correct before inserting or confirming
50  * @brief verify the data
51  * @param an array (usually $_POST)
52  * @return String
53  * @throw Exception on error occurs
54  */
55 
56  public function verify($p_array)
57  {
58  global $g_user;
59  if (is_array($p_array ) == false || empty($p_array))
60  throw new Exception ("Array empty");
61  /*
62  * Check needed value
63  */
64  check_parameter($p_array,'p_jrn');
65 
66 
67  extract($p_array, EXTR_SKIP);
68  /* check for a double reload */
69  if (isset($mt) && $this->db->count_sql('select jr_mt from jrn where jr_mt=$1', array($mt)) != 0)
70  throw new Exception(_('Double Encodage'), 5);
71 
72  /* check if we can write into this ledger */
73  if ($g_user->check_jrn($p_jrn) != 'W')
74  throw new Exception(_('Accès interdit'), 20);
75 
76  /* check if there is a bank account linked to the ledger */
77  $bank_id = $this->get_bank();
78 
79  if ($this->db->count() == 0)
80  throw new Exception("Ce journal n'a pas de compte en banque, allez dans paramètre->journal pour régler cela");
81  /* check if the accounting of the bank is correct */
82  $fBank = new Fiche($this->db, $bank_id);
83  $bank_accounting = $fBank->strAttribut(ATTR_DEF_ACCOUNT);
84  if (trim($bank_accounting) == '')
85  throw new Exception('Le poste comptable du compte en banque de ce journal est invalide');
86 
87  /* check if the account exists */
88  $poste = new Acc_Account_Ledger($this->db, $bank_accounting);
89  if ($poste->load() == false)
90  throw new Exception('Le poste comptable du compte en banque de ce journal est invalide');
91  if ($chdate != 1 && $chdate != 2) throw new Exception ('Le choix de date est invalide');
92  if ( $chdate == 1 )
93  {
94  /* check if the date is valid */
95  if (isDate($e_date) == null)
96  {
97  throw new Exception('Date invalide', 2);
98  }
99  $oPeriode = new Periode($this->db);
100  if ($this->check_periode() == false)
101  {
102  $periode = $oPeriode->find_periode($e_date);
103  }
104  else
105  {
106  $oPeriode->p_id = $periode;
107  list ($min, $max) = $oPeriode->get_date_limit();
108  if (cmpDate($e_date, $min) < 0 ||
109  cmpDate($e_date, $max) > 0)
110  throw new Exception(_('Date et periode ne correspondent pas'), 6);
111  }
112 
113  /* check if the periode is closed */
114  if ($this->is_closed($periode) == 1)
115  {
116  throw new Exception(_('Periode fermee'), 6);
117  }
118 
119  /* check if we are using the strict mode */
120  if ($this->check_strict() == true)
121  {
122  /* if we use the strict mode, we get the date of the last
123  operation */
124  $last_date = $this->get_last_date();
125  if ($last_date != null && cmpDate($e_date, $last_date) < 0)
126  throw new Exception(_('Vous utilisez le mode strict la dernière operation est à la date du ')
127  . $last_date . _(' vous ne pouvez pas encoder à une date antérieure'), 15);
128  }
129  }
130 
131  $acc_pay = new Acc_Operation($this->db);
132 
133  $nb = 0;
134  $tot_amount = 0;
135  //----------------------------------------
136  // foreach item
137  //----------------------------------------
138  for ($i = 0; $i < $nb_item; $i++)
139  {
140  if (strlen(trim(${'e_other' . $i})) == 0)
141  continue;
142  /* check if amount are numeric and */
143  if (isNumber(${'e_other' . $i . '_amount'}) == 0)
144  throw new Exception('La fiche ' . ${'e_other' . $i} . 'a un montant invalide [' . ${'e_other' . $i . '_amount'} . ']', 6);
145 
146  /* compute the total */
147  $tot_amount+=round(${'e_other' . $i . '_amount'}, 2);
148  /* check if all card has a ATTR_DEF_ACCOUNT */
149  $fiche = new Fiche($this->db);
150  $fiche->get_by_qcode(${'e_other' . $i});
151  if ($fiche->empty_attribute(ATTR_DEF_ACCOUNT) == true)
152  throw new Exception('La fiche ' . ${'e_other' . $i} . 'n\'a pas de poste comptable', 8);
153 
154  $sposte = $fiche->strAttribut(ATTR_DEF_ACCOUNT);
155  // if 2 accounts, take only the debit one for customer
156  if (strpos($sposte, ',') != 0)
157  {
158  $array = explode(',', $sposte);
159  $poste_val = $array[1];
160  }
161  else
162  {
163  $poste_val = $sposte;
164  }
165  /* The account exists */
166  $poste = new Acc_Account_Ledger($this->db, $poste_val);
167  if ($poste->load() == false)
168  {
169  throw new Exception('Pour la fiche ' . ${'e_other' . $i} . ' le poste comptable [' . $poste->id . 'n\'existe pas', 9);
170  }
171  /* Check if the card belong to the ledger */
172  $fiche = new Fiche($this->db);
173  $fiche->get_by_qcode(${'e_other' . $i});
174  if ($fiche->belong_ledger($p_jrn, 'deb') != 1)
175  throw new Exception('La fiche ' . ${'e_other' . $i} . 'n\'est pas accessible à ce journal', 10);
176  if ($chdate == 2)
177  {
178  {/* check if the date is valid */
179  if (isDate(${'dateop' . $i}) == null)
180  {
181  throw new Exception('Date invalide', 2);
182  }
183  $oPeriode = new Periode($this->db);
184  if ($this->check_periode() == false)
185  {
186  $periode = $oPeriode->find_periode(${'dateop' . $i});
187  }
188  else
189  {
190  $oPeriode->p_id = $periode;
191  list ($min, $max) = $oPeriode->get_date_limit();
192  if (cmpDate(${'dateop' . $i}, $min) < 0 ||
193  cmpDate(${'dateop' . $i}, $max) > 0)
194  throw new Exception(_('Date et periode ne correspondent pas'), 6);
195  }
196 
197  /* check if the periode is closed */
198  if ($this->is_closed($periode) == 1)
199  {
200  throw new Exception(_('Periode fermee'), 6);
201  }
202 
203  /* check if we are using the strict mode */
204  if ($this->check_strict() == true)
205  {
206  /* if we use the strict mode, we get the date of the last
207  operation */
208  $last_date = $this->get_last_date();
209  if ($last_date != null && cmpDate(${'dateop' . $i}, $last_date) < 0)
210  throw new Exception(_('Vous utilisez le mode strict la dernière operation est à la date du ')
211  . $last_date . _(' vous ne pouvez pas encoder à une date antérieure'), 15);
212  }
213  }
214  }
215  $nb++;
216  }
217  if ($nb == 0)
218  throw new Exception('Il n\'y a aucune opération', 12);
219 
220  /* Check if the last_saldo and first_saldo are correct */
221  if (strlen(trim($last_sold)) != 0 && isNumber($last_sold) &&
222  strlen(trim($first_sold)) != 0 && isNumber($first_sold))
223  {
224  $diff = $last_sold - $first_sold;
225  $diff = round($diff, 2) - round($tot_amount, 2);
226  if ($first_sold != 0 && $last_sold != 0)
227  {
228  if ($diff != 0)
229  throw new Exception('Le montant de l\'extrait est incorrect' .
230  $tot_amount . ' extrait ' . $diff, 13);
231  }
232  }
233  }
234 
235  /**\brief
236  * \param $p_array contains the value usually it is $_POST
237  * \return string with html code
238  * \note the form tag are not set here
239  */
240 
241  function input($p_array = null, $notused = 0)
242  {
243  global $g_parameter, $g_user;
244  if ($p_array != null)
245  extract($p_array, EXTR_SKIP);
246 
247  $pview_only = false;
248 
249  $min_article=$this->get_min_row();
250 
251  $f_add_button = new IButton('add_card');
252  $f_add_button->label = _('Créer une nouvelle fiche');
253  $f_add_button->set_attribute('ipopup', 'ipop_newcard');
254  $f_add_button->set_attribute('jrn', $this->id);
255  $f_add_button->javascript = " this.jrn=\$('p_jrn').value;select_card_type(this);";
256  $str_add_button = ($g_user->check_action(FICADD) == 1) ? $f_add_button->input() : "";
257 
258  // The first day of the periode
259  $pPeriode = new Periode($this->db);
260  list ($l_date_start, $l_date_end) = $pPeriode->get_date_limit($g_user->get_periode());
261  if ($g_parameter->MY_DATE_SUGGEST == 'Y')
262  $op_date = (!isset($e_date) ) ? $l_date_start : $e_date;
263  else
264  $op_date = (!isset($e_date) ) ? '' : $e_date;
265 
266  $r = "";
267 
268  $r.=dossier::hidden();
269  $f_legend = 'Banque, caisse';
270  // Date
271  //--
272  $Date = new IDate("e_date", $op_date);
273  $Date->setReadOnly($pview_only);
274  $f_date = $Date->input();
275  $f_period = '';
276  if ($this->check_periode() == true)
277  {
278  // Periode
279  //--
280  $l_user_per = (isset($periode)) ? $periode : $g_user->get_periode();
281  $period = new IPeriod();
282  $period->cn = $this->db;
283  $period->type = OPEN;
284  $period->value = $l_user_per;
285  $period->user = $g_user;
286  $period->name = 'periode';
287  try
288  {
289  $l_form_per = $period->input();
290  }
291  catch (Exception $e)
292  {
293  if ($e->getCode() == 1)
294  {
295  throw new Exception(_("Aucune période ouverte"));
296 
297  }
298  }
300  $f_period = "Période comptable $label" . $l_form_per;
301  }
302 
303  // Ledger (p_jrn)
304  //--
305  $onchange="update_bank();ajax_saldo('first_sold');update_name();update_row('fin_item');";
306 
307  if ($g_parameter->MY_DATE_SUGGEST == 'Y')
308  $onchange .= 'get_last_date();';
309  if ($g_parameter->MY_PJ_SUGGEST=='Y')
310  $onchange .= 'update_pj();';
311 
312  $add_js = 'onchange="'.$onchange.'"';
313  $wLedger = $this->select_ledger('FIN', 2);
314  if ($wLedger == null)
315  throw new Exception(_('Pas de journal disponible'));
316 
317  $wLedger->javascript = $add_js;
318 
319  $label = " Journal " . HtmlInput::infobulle(2);
320  $f_jrn = $label . $wLedger->input();
321 
322 
323  // retrieve bank name, code and account from the jrn_def.jrn_def_bank
324 
325  $f_bank = '<span id="bkname">' . $this->get_bank_name() . '</span>';
326  if ($this->bank_id == "")
327  {
328  echo h2("Journal de banque non configuré " . $this->get_name(), ' class="error"');
329  echo '<span class="error"> vous devez donner à ce journal un compte en banque (fiche), modifiez dans CFGLED</span>';
330  alert("Journal de banque non configuré " . $this->get_name());
331  }
332 
333  $f_legend_detail = 'Opérations financières';
334  //--------------------------------------------------
335  // Saldo begin end
336  //-------------------------------------------------
337  // Extrait
338  $default_pj = '';
339  if ($g_parameter->MY_PJ_SUGGEST == 'Y')
340  {
341  $default_pj = $this->guess_pj();
342  }
343  $wPJ = new IText('e_pj');
344  $wPJ->readonly = false;
345  $wPJ->size = 10;
346  $wPJ->value = (isset($e_pj)) ? $e_pj : $default_pj;
347 
348  $f_extrait = $wPJ->input() . HtmlInput::hidden('e_pj_suggest', $default_pj);
350 
351  $first_sold = (isset($first_sold)) ? $first_sold : "";
352  $wFirst = new INum('first_sold', $first_sold);
353 
354  $last_sold = isset($last_sold) ? $last_sold : "";
355  $wLast = new INum('last_sold', $last_sold);
356 
357 
358  $max = (isset($nb_item)) ? $nb_item : $min_article;
359 
360  $r.= HtmlInput::hidden('nb_item', $max);
361  //--------------------------------------------------
362  // financial operation
363  //-------------------------------------------------
364 
365  $array = array();
366  // Parse each " tiers"
367  for ($i = 0; $i < $max; $i++)
368  {
369  $tiers = (isset(${"e_other" . $i})) ? ${"e_other" . $i} : "";
370 
371  $tiers_amount = (isset(${"e_other$i" . "_amount"})) ? round(${"e_other$i" . "_amount"}, 2) : 0;
372 
373  $tiers_comment = (isset(${"e_other$i" . "_comment"})) ? ${"e_other$i" . "_comment"} : "";
374 
375  $operation_date=new IDate("dateop".$i);
376  $operation_date->value=(isset(${'dateop'.$i}))?${'dateop'.$i}:"";
377  $array[$i]['dateop']=$operation_date->input();
378  ${"e_other$i" . "_amount"} = (isset(${"e_other$i" . "_amount"})) ? ${"e_other$i" . "_amount"} : 0;
379 
380  $W1 = new ICard();
381  $W1->label = "";
382  $W1->name = "e_other" . $i;
383  $W1->id = "e_other" . $i;
384  $W1->value = $tiers;
385  $W1->extra = 'deb'; // credits
386  $W1->typecard = 'deb';
387  $W1->style=' style = "vertical-align:65%"';
388  $W1->set_dblclick("fill_ipopcard(this);");
389  $W1->set_attribute('ipopup', 'ipopcard');
390 
391  // name of the field to update with the name of the card
392  $W1->set_attribute('label', 'e_other_name' . $i);
393  // name of the field to update with the name of the card
394  $W1->set_attribute('typecard', 'filter');
395  // Add the callback function to filter the card on the jrn
396  $W1->set_callback('filter_card');
397  $W1->set_function('fill_data');
398  $W1->javascript = sprintf(' onchange="fill_data_onchange(\'%s\');" ', $W1->name);
399  $W1->readonly = $pview_only;
400  $array[$i]['qcode'] = $W1->input();
401  $array[$i]['search'] = $W1->search();
402 
403  // Card name
404  //
405  $card_name = "";
406  if ($tiers != "")
407  {
408  $fiche = new Fiche($this->db);
409  $fiche->get_by_qcode($tiers);
410  $card_name = $this->db->get_value("Select ad_value from fiche_detail where ad_id=$1 and f_id=$2", array(ATTR_DEF_NAME, $fiche->id));
411  }
412 
413  $wcard_name = new IText("e_other_name" . $i, $card_name);
414  $wcard_name->id=$wcard_name->name;
415  $wcard_name->readOnly = true;
416  $array[$i]['cname'] = $wcard_name->input();
417 
418  // Comment
419  $wComment = new IText("e_other$i" . "_comment", $tiers_comment);
420 
421  $wComment->size = 35;
422  $wComment->setReadOnly($pview_only);
423  $array[$i]['comment'] = $wComment->input();
424  // amount
425  $wAmount = new INum("e_other$i" . "_amount", $tiers_amount);
426 
427  $wAmount->size = 7;
428  $wAmount->setReadOnly($pview_only);
429  $array[$i]['amount'] = $wAmount->input();
430  // concerned
431  ${"e_concerned" . $i} = (isset(${"e_concerned" . $i})) ? ${"e_concerned" . $i} : ""
432  ;
433  $wConcerned = new IConcerned("e_concerned" . $i, ${"e_concerned" . $i});
434  $wConcerned->tiers="e_other" . $i;
435  $wConcerned->setReadOnly($pview_only);
436  $wConcerned->amount_id = "e_other" . $i . "_amount";
437 
438  $wConcerned->paid = 'paid';
439  $array[$i]['concerned'] = $wConcerned->input();
440  }
441 
442  ob_start();
443  require_once NOALYSS_TEMPLATE.'/form_ledger_fin.php';
444  $r.=ob_get_contents();
445  ob_end_clean();
446  $r.= create_script("$('".$Date->id."').focus()");
447 
448  return $r;
449  }
450 
451  /**\brief show the summary before inserting into the database, it
452  * calls the function for adding a attachment. The function verify
453  * should be called before
454  * \param $p_array an array usually is $_POST
455  * \return string with code html
456  */
457 
458  public function confirm($p_array, $p_nothing = 0)
459  {
460  global $g_parameter,$g_user;
461  $r = "";
462  bcscale(2);
463  extract($p_array, EXTR_SKIP);
464  $pPeriode = new Periode($this->db);
465  if ($this->check_periode() == true)
466  {
467  $pPeriode->p_id = $periode;
468  }
469  else
470  {
471  if (isDate($e_date) != null) {
472  $pPeriode->find_periode($e_date);
473  } else {
474  $pPeriode->p_id=$g_user->get_periode();
475  }
476  }
477 
478  list ($l_date_start, $l_date_end) = $pPeriode->get_date_limit();
479  $exercice = $pPeriode->get_exercice();
480  $r.='';
481  $r.='<fieldset><legend>Banque, caisse </legend>';
482  $r.= '<div id="jrn_name_div">';
483  $r.='<h2 id="jrn_name" style="display:inline">' . $this->get_name() . '</h2>';
484  $r.= '</div>';
485  $r.='<TABLE width="100%">';
486  // Date
487  //--
488  $r.="<tr>";
489  if ( $chdate == 1 ) $r.='<td> Date : </td><td>' . $e_date;
490  // Periode
491  //--
492  $r.="<td>";
493  $r.="Période comptable </td><td>";
494  $r.=$l_date_start . ' - ' . $l_date_end;
495  $r.="</td>";
496  $r.="</tr>";
497  // Ledger (p_jrn)
498  //--
499  $r.='<tr>';
500  $r.='<td> Journal </td>';
501  $this->id = $p_jrn;
502  $r.='<td>';
503  $r.=h($this->get_name());
504  $r.='</td>';
505  $r.='</tr>';
506 
507  //retrieve bank name
508  $bk_id = $this->get_bank();
509 
510  $fBank = new Fiche($this->db, $bk_id);
511  $e_bank_account_label = $this->get_bank_name();
512 
513  $filter_year = " j_tech_per in (select p_id from parm_periode where p_exercice='" . $exercice . "')";
514 
515  $acc_account = new Acc_Account_Ledger($this->db, $fBank->strAttribut(ATTR_DEF_ACCOUNT));
516  $asolde= $acc_account->get_solde_detail($filter_year);
517  $deb=$asolde['debit'];
518  $cred=$asolde['credit'];
519  $solde= bcsub($deb, $cred);
520  $new_solde=$solde;
521 
522  $r.="<TR><td colspan=\"4\"> Banque ";
523  $r.=$e_bank_account_label;
524 
525  $r.="</TABLE>";
526 
527  $r.='</fieldset>';
528 
529  $r.='<div class="myfieldset"><h1 class="legend">Extrait de compte</h1>';
530  //--------------------------------------------------
531  // Saldo begin end
532  //-------------------------------------------------
533  $r.='<table>';
534  $r.='<tr>';
535  // Extrait
536  //--
537  $r.=tr('<td> Numéro d\'extrait</td>' . td(h($e_pj)));
538  $r.='<tr><td >Solde début extrait </td>';
539  $r.='<td style="num">' . nbm($first_sold) . '</td></tr>';
540  $r.='<tr><td>Solde fin extrait </td>';
541  $r.='<td style="num">' . nbm($last_sold) . '</td></tr>';
542  $r.='</table>';
543 
544  $r.='<h1 class="legend">Opérations financières</h1>';
545  //--------------------------------------------------
546  // financial operation
547  //-------------------------------------------------
548  $r.='<TABLE style="width:100%" id="fin_item">';
549  $r.="<TR>";
550  if ($chdate==2) $r.='<th>Date</th>';
551  $r.="<th style=\"width:auto;text-align:left\" colspan=\"2\">Nom</TH>";
552  $r.="<th style=\"text-align:left\" >Commentaire</TH>";
553  $r.="<th style=\"text-align:right\">Montant</TH>";
554  $r.='<th colspan="2"> Op. Concern&eacute;e(s)</th>';
555 
556  /* if we use the AC */
557  if ($g_parameter->MY_ANALYTIC != 'nu')
558  {
559  $anc = new Anc_Plan($this->db);
560  $a_anc = $anc->get_list();
561  $x = count($a_anc);
562  /* set the width of the col */
563  $r.='<th colspan="' . $x . '">' . _('Compt. Analytique') . '</th>';
564 
565  /* add hidden variables pa[] to hold the value of pa_id */
566  $r.=Anc_Plan::hidden($a_anc);
567  }
568  $r.="</TR>";
569  // Parse each " tiers"
570  $tot_amount = 0;
571  //--------------------------------------------------
572  // For each items
573  //--------------------------------------------------
574  for ($i = 0; $i < $nb_item; $i++)
575  {
576 
577  $tiers = (isset(${"e_other" . $i})) ? ${"e_other" . $i} : ""
578  ;
579 
580  if (strlen(trim($tiers)) == 0)
581  continue;
582  $tiers_label = "";
583  $tiers_amount = round(${"e_other$i" . "_amount"}, 2);
584  $tot_amount = bcadd($tot_amount, $tiers_amount);
585  $tiers_comment = h(${"e_other$i" . "_comment"});
586  // If $tiers has a value
587  $fTiers = new Fiche($this->db);
588  $fTiers->get_by_qcode($tiers);
589 
590  $tiers_label = $fTiers->strAttribut(ATTR_DEF_NAME);
591 
592  $r.="<TR>";
593  if ($chdate==2) $r.=td(${"dateop".$i});
594  $r.="<td>" . ${'e_other' . $i} . "</TD>";
595  // label
596  $r.='<TD style="width:25%;border-bottom:1px dotted grey;">';
597  $r.=$fTiers->strAttribut(ATTR_DEF_NAME);
598  $r.='</td>';
599  // Comment
600  $r.='<td style="width:40%">' . $tiers_comment . '</td>';
601  // amount
602  $r.='<td class="num">' . nbm($tiers_amount) . '</td>';
603  // concerned
604  $r.='<td style="text-align:center">';
605  if (${"e_concerned" . $i} != '')
606  {
607  $jr_internal = $this->db->get_array("select jr_internal from jrn where jr_id in (" . ${"e_concerned" . $i} . ")");
608  $comma="";
609  for ($x = 0; $x < count($jr_internal); $x++)
610  {
611  $r.=$comma.HtmlInput::detail_op(${"e_concerned" . $i}, $jr_internal[$x]['jr_internal']);
612  $comma=" , ";
613  }
614  }
615  $r.='</td>';
616  // encode the pa
617  if ($g_parameter->MY_ANALYTIC != 'nu' && preg_match("/^[6,7]/", $fTiers->strAttribut(ATTR_DEF_ACCOUNT)) == 1) // use of AA
618  {
619  // show form
620  $anc_op = new Anc_Operation($this->db);
621  $null = ($g_parameter->MY_ANALYTIC == 'op') ? 1 : 0;
622  $r.='<td>';
623  $p_mode = 1;
624  $p_array['pa_id'] = $a_anc;
625  /* op is the operation it contains either a sequence or a jrnx.j_id */
626  $r.=HtmlInput::hidden('op[]=', $i);
627  $r.=$anc_op->display_form_plan($p_array, $null, $p_mode, $i, $tiers_amount);
628  $r.='</td>';
629  }
630 
631  $r.='</TR>';
632  }
633  $r.="</TABLE>";
634 
635  // saldo
636  $r.='<br>Ancien solde = ' . $solde;
637  $new_solde+=$tot_amount;
638  $r.='<br>Nouveau solde = ' . $new_solde;
639  $r.='<br>Difference =' . $tot_amount;
640  // check for upload piece
641  $file = new IFile();
642 
643  $r.="<br>Ajoutez une pi&egrave;ce justificative ";
644  $r.=$file->input("pj", "");
645 
646  $r.='</div>';
647  //--------------------------------------------------
648  // Hidden variables
649  //--------------------------------------------------
650  $r.=dossier::hidden();
651  $r.=HtmlInput::hidden('p_jrn', $this->id);
652  $r.=HtmlInput::hidden('nb_item', $nb_item);
653  $r.=HtmlInput::hidden('last_sold', $last_sold);
654  $r.=HtmlInput::hidden('first_sold', $first_sold);
655  $r.=HtmlInput::hidden('e_pj', $e_pj);
656  $r.=HtmlInput::hidden('e_pj_suggest', $e_pj_suggest);
657  $r.=HtmlInput::hidden('e_date', $e_date);
658  $mt = microtime(true);
659  $r.=HtmlInput::hidden('mt', $mt);
660 
661  if (isset($periode))
662  $r.=HtmlInput::hidden('periode', $periode);
663  $r.=dossier::hidden();
664  $r.=HtmlInput::hidden('sa', 'n','chdate');
665  for ($i = 0; $i < $nb_item; $i++)
666  {
667  $tiers = (isset(${"e_other" . $i})) ? ${"e_other" . $i} : "" ;
668  $r.=HtmlInput::hidden('e_other' . $i, $tiers);
669  $r.=HtmlInput::hidden('e_other' . $i, $tiers);
670  $r.=HtmlInput::hidden('e_other' . $i . '_comment', ${'e_other' . $i . '_comment'});
671  $r.=HtmlInput::hidden('e_other' . $i . '_amount', ${'e_other' . $i . '_amount'});
672  $r.=HtmlInput::hidden('e_concerned' . $i, ${'e_concerned' . $i});
673  $r.=HtmlInput::hidden('dateop' . $i, ${'dateop' . $i});
674  $r.=HtmlInput::hidden('chdate' , $chdate);
675  }
676 
677  return $r;
678  }
679 
680  /**\brief save the data into the database, included the attachment,
681  * and the reconciliations
682  * \param $p_array usually $_POST
683  * \return string with HTML code
684  */
685 
686  public function insert($p_array = null)
687  {
688  global $g_parameter;
689  bcscale(2);
690  $internal_code = "";
691  $oid = 0;
692  extract($p_array, EXTR_SKIP);
693  $ret = '';
694  // Debit = banque
695  $bank_id = $this->get_bank();
696  $fBank = new Fiche($this->db, $bank_id);
697  $e_bank_account = $fBank->strAttribut(ATTR_DEF_QUICKCODE);
698  // Get the saldo
699  $pPeriode = new Periode($this->db);
700  $sposte = $fBank->strAttribut(ATTR_DEF_ACCOUNT);
701  // if 2 accounts, take only the debit one for customer
702  if (strpos($sposte, ',') != 0)
703  {
704  $array = explode(',', $sposte);
705  $poste_val = $array[0];
706  }
707  else
708  {
709  $poste_val = $sposte;
710  }
711 
712  $acc_account = new Acc_Account_Ledger($this->db, $poste_val);
713 
714  // If date = deposit date
715  if ($chdate == 1 )
716  {
717  if ($this->check_periode() == true)
718  {
719  $pPeriode->p_id = $periode;
720  }
721  else
722  {
723  $pPeriode->find_periode($e_date);
724  }
725  $exercice = $pPeriode->get_exercice();
726  $filter_year = " j_tech_per in (select p_id from parm_periode where p_exercice='" . $exercice . "')";
727  $asolde= $acc_account->get_solde_detail($filter_year);
728  $deb=$asolde['debit'];
729  $cred=$asolde['credit'];
730  $solde= bcsub($deb, $cred);
731  $new_solde=$solde;
732  }
733 
734 
735 
736 
737 
738  try
739  {
740  $this->db->start();
741  $amount = 0.0;
742  $idx_operation = 0;
743  $ret = '<table class="result" >';
744  $ret.=tr(th('Date').th('n° interne') . th('Quick Code') . th('Nom') . th('Libellé') . th('Montant', ' style="text-align:right"'));
745  // Credit = goods
746  $get_solde=true;
747  for ($i = 0; $i < $nb_item; $i++)
748  {
749  // insert it into the database
750  // and quit the loop ?
751  if (strlen(trim(${"e_other$i"})) == 0)
752  continue;
753 
754  if ( $chdate == 2 ) $e_date=${'dateop'.$i};
755  // if date is date of operation
756  if ($chdate == 2 && $get_solde )
757  {
758  $get_solde=false;
759  if ($this->check_periode() == true && isset($p_array['periode']))
760  {
761  $pPeriode->p_id = $periode;
762  }
763  else
764  {
765  $pPeriode->find_periode($e_date);
766  }
767  $exercice = $pPeriode->get_exercice();
768  $filter_year = " j_tech_per in (select p_id from parm_periode where p_exercice='" .
769  sql_string($exercice ). "')";
770  $solde = $acc_account->get_solde($filter_year);
771  $new_solde = $solde;
772  }
773  $fPoste = new Fiche($this->db);
774  $fPoste->get_by_qcode(${"e_other$i"});
775 
776  // round it
777  ${"e_other$i" . "_amount"} = round(${"e_other$i" . "_amount"}, 2);
778 
779 
780 
781  $amount+=${"e_other$i" . "_amount"};
782  // Record a line for the bank
783  // Compute the j_grpt
784  $seq = $this->db->get_next_seq('s_grpt');
785 
786  $acc_operation = new Acc_Operation($this->db);
787  $acc_operation->date = $e_date;
788  $sposte = $fPoste->strAttribut(ATTR_DEF_ACCOUNT);
789  // if 2 accounts
790  if (strpos($sposte, ',') != 0)
791  {
792  $array = explode(',', $sposte);
793  if (${"e_other$i" . "_amount"} < 0)
794  $poste_val = $array[1];
795  else
796  $poste_val = $array[0];
797  }
798  else
799  {
800  $poste_val = $sposte;
801  }
802 
803 
804  $acc_operation->poste = $poste_val;
805  $acc_operation->amount = ${"e_other$i" . "_amount"} * (-1);
806  $acc_operation->grpt = $seq;
807  $acc_operation->jrn = $p_jrn;
808  $acc_operation->type = 'd';
809 
810  if (isset($periode))
811  $tperiode = $periode;
812  else
813  {
814  $per = new Periode($this->db);
815  $tperiode = $per->find_periode($e_date);
816  }
817  $acc_operation->periode = $tperiode;
818  $acc_operation->qcode = ${"e_other" . $i};
819  $j_id = $acc_operation->insert_jrnx();
820 
821  $acc_operation = new Acc_Operation($this->db);
822  $acc_operation->date = $e_date;
823  $sposte = $fBank->strAttribut(ATTR_DEF_ACCOUNT);
824 
825  // if 2 accounts
826  if (strpos($sposte, ',') != 0)
827  {
828  $array = explode(',', $sposte);
829  if (${"e_other$i" . "_amount"} < 0)
830  $poste_val = $array[1];
831  else
832  $poste_val = $array[0];
833  }
834  else
835  {
836  $poste_val = $sposte;
837  }
838 
839  $acc_operation->poste = $poste_val;
840  $acc_operation->amount = ${"e_other$i" . "_amount"};
841  $acc_operation->grpt = $seq;
842  $acc_operation->jrn = $p_jrn;
843  $acc_operation->type = 'd';
844  $acc_operation->periode = $tperiode;
845  $acc_operation->qcode = $e_bank_account;
846  $acc_operation->insert_jrnx();
847 
848 
849  if (sql_string(${"e_other$i" . "_comment"}) == null)
850  {
851  // if comment is blank set a default one
852  $comment = " compte : " . $fBank->strAttribut(ATTR_DEF_NAME) . ' a ' .
853  $fPoste->strAttribut(ATTR_DEF_NAME);
854  }
855  else
856  {
857  $comment = ${'e_other' . $i . '_comment'};
858  }
859 
860 
861  $acc_operation = new Acc_Operation($this->db);
862  $acc_operation->jrn = $p_jrn;
863  $acc_operation->amount = abs(${"e_other$i" . "_amount"});
864  $acc_operation->date = $e_date;
865  $acc_operation->desc = $comment;
866  $acc_operation->grpt = $seq;
867  $acc_operation->periode = $tperiode;
868  $acc_operation->mt = $mt;
869  $idx_operation++;
870  $acc_operation->pj = '';
871 
872  if (trim($e_pj) != '' && $this->numb_operation() == true)
873  $acc_operation->pj = $e_pj . str_pad($idx_operation, 3, 0, STR_PAD_LEFT);
874 
875  if (trim($e_pj) != '' && $this->numb_operation() == false)
876  $acc_operation->pj = $e_pj;
877 
878  $jr_id = $acc_operation->insert_jrn();
879  // $acc_operation->set_pj();
880  $this->db->exec_sql('update jrn set jr_pj_number=$1 where jr_id=$2', array($acc_operation->pj, $jr_id));
881  $internal = $this->compute_internal_code($seq);
882 
883 
884  if (trim(${"e_concerned" . $i}) != "")
885  {
886  if (strpos(${"e_concerned" . $i}, ',') != 0)
887  {
888  $aRapt = explode(',', ${"e_concerned" . $i});
889  foreach ($aRapt as $rRapt)
890  {
891  // Add a "concerned operation to bound these op.together
892  //
893  $rec = new Acc_Reconciliation($this->db);
894  $rec->set_jr_id($jr_id);
895 
896  if (isNumber($rRapt) == 1)
897  {
898  $rec->insert($rRapt);
899  try {
900  $oppaid=new Acc_Operation($this->db);
901  $oppaid->set_id($rRapt);
902  $oppaid->set_paid();
903  } catch (Exception $ex) {
904  echo _('Attention , erreur Acc_Ledger_Fin::insert , coche paiement');
905  }
906  }
907  }
908  }
909  else
910  if (isNumber(${"e_concerned" . $i}) == 1)
911  {
912  $rec = new Acc_Reconciliation($this->db);
913  $rec->set_jr_id($jr_id);
914  $rec->insert(${"e_concerned$i"});
915  try {
916  $oppaid=new Acc_Operation($this->db);
917  $oppaid->set_id(${"e_concerned" . $i});
918  $conc_amount=$oppaid->get_amount();
919  if ($conc_amount == $acc_operation->amount)
920  {
921  $oppaid->set_paid();
922  }
923  } catch (Exception $ex) {
924  echo _('Attention , erreur Acc_Ledger_Fin::insert , coche paiement');
925  }
926  }
927  }
928 
929  // Set Internal code
930  $this->grpt_id = $seq;
931  /**
932  * save also into quant_fin
933  */
934  $this->insert_quant_fin($fBank->id, $jr_id, $fPoste->id, ${"e_other$i" . "_amount"});
935 
936  if ($g_parameter->MY_ANALYTIC != "nu")
937  {
938  // for each item, insert into operation_analytique */
939  $op = new Anc_Operation($this->db);
940  $op->oa_group = $this->db->get_next_seq("s_oa_group"); /* for analytic */
941  $op->j_id = $j_id;
942  $op->oa_date = $e_date;
943  $op->oa_debit = 'f';
944  $op->oa_description = sql_string($comment);
945  $op->save_form_plan($_POST, $i, $j_id);
946  }
947 
948 
949  $this->update_internal_code($internal);
950 
951  $js_detail = HtmlInput::detail_op($jr_id, $internal);
952  // Compute display
953  $row = td($e_date).td($js_detail) . td(${"e_other$i"}) . td($fPoste->strAttribut(ATTR_DEF_NAME)) . td(${"e_other" . $i . "_comment"}) . td(nbm(${"e_other$i" . "_amount"}), 'class="num"');
954  $class=($i%2==0)?' class="even" ':' class="odd" ';
955  $ret.=tr($row,$class);
956 
957 
958  if ($i == 0)
959  {
960  // first record we upload the files and
961  // keep variable to update other row of jrn
962  if (isset($_FILES))
963  $oid = $this->db->save_receipt($seq);
964  }
965  else
966  {
967  if ($oid != 0)
968  {
969  $this->db->exec_sql("update jrn set jr_pj=$1 , jr_pj_name=$2,
970  jr_pj_type=$3 where jr_grpt_id=$4",
971  array($oid,$_FILES['pj']['name'] ,$_FILES['pj']['type'],$seq));
972  }
973  }
974  } // for nbitem
975  // increment pj
976  if (strlen(trim($e_pj)) != 0)
977  {
978  $this->inc_seq_pj();
979  }
980  $ret.='</table>';
981  }
982  catch (Exception $e)
983  {
984  $r = '<span class="error">' .
985  'Erreur dans l\'enregistrement ' .
986  __FILE__ . ':' . __LINE__ . ' ' .
987  $e->getMessage();
988  $this->db->rollback();
989  throw new Exception($r);
990  }
991  $this->db->commit();
992  $r = "";
993  $r.="<br>Ancien solde " . nbm($solde);
994  $new_solde = bcadd($new_solde, $amount);
995  $r.="<br>Nouveau solde " . nbm($new_solde);
996  $ret.=$r;
997  return $ret;
998  }
999 
1000  /**\brief display operation of a FIN ledger
1001  * \return html code into a string
1002  */
1003 
1004  function show_ledger()
1005  {
1006  global $g_user;
1007  echo dossier::hidden();
1008  $hid = new IHidden();
1009 
1010  $hid->name = "p_action";
1011  $hid->value = "bank";
1012  echo $hid->input();
1013 
1014 
1015  $hid->name = "sa";
1016  $hid->value = "l";
1017  echo $hid->input();
1018 
1019 
1020  $w = new ISelect();
1021  // filter on the current year
1022  $filter_year = " where p_exercice='" . $g_user->get_exercice() . "'";
1023 
1024  $periode_start = $this->db->make_array("select p_id,to_char(p_start,'DD-MM-YYYY') from parm_periode $filter_year order by p_start,p_end", 1);
1025  // User is already set User=new User($this->db);
1026  $current = (isset($_GET['p_periode'])) ? $_GET['p_periode'] : -1;
1027  $w->selected = $current;
1028 
1029  echo '<form>';
1030  echo 'Période ' . $w->input("p_periode", $periode_start);
1031  $wLedger = $this->select_ledger('fin', 3);
1032 
1033  if ($wLedger == null)
1034  throw new Exception(_('Pas de journal disponible'));
1035 
1036  if (count($wLedger->value) > 1)
1037  {
1038  $aValue = $wLedger->value;
1039  $wLedger->value[0] = array('value' => -1, 'label' => _('Tous les journaux financiers'));
1040  $idx = 1;
1041  foreach ($aValue as $a)
1042  {
1043  $wLedger->value[$idx] = $a;
1044  $idx++;
1045  }
1046  }
1047 
1048 
1049 
1050  echo 'Journal ' . $wLedger->input();
1051  $w = new ICard();
1052  $w->noadd = 'no';
1053  $w->jrn = $this->id;
1054  $qcode = (isset($_GET['qcode'])) ? $_GET['qcode'] : "";
1055  echo dossier::hidden();
1056  echo HtmlInput::hidden('p_action', 'bank');
1057  echo HtmlInput::hidden('sa', 'l');
1058  $w->name = 'qcode';
1059  $w->value = $qcode;
1060  $w->label = '';
1061  $this->type = 'FIN';
1062  $all = $this->get_all_fiche_def();
1063  $w->extra = $all;
1064  $w->extra2 = 'QuickCode';
1065  $sp = new ISpan();
1066  echo $sp->input("qcode_label", "", $qcode);
1067  echo $w->input();
1068 
1069  echo HtmlInput::submit('gl_submit', _('Rechercher'));
1070  echo '</form>';
1071 
1072  // Show list of sell
1073  // Date - date of payment - Customer - amount
1074  if ($current != -1)
1075  {
1076  $filter_per = " and jr_tech_per=" . $current;
1077  }
1078  else
1079  {
1080  $filter_per = " and jr_tech_per in (select p_id from parm_periode where p_exercice::integer=" .
1081  $g_user->get_exercice() . ")";
1082  }
1083  /* security */
1084  if ($this->id != -1)
1085  $available_ledger = " and jr_def_id= " . $this->id . " and " . $g_user->get_ledger_sql();
1086  else
1087  $available_ledger = " and " . $g_user->get_ledger_sql();
1088  // Show list of sell
1089  // Date - date of payment - Customer - amount
1090  $sql = SQL_LIST_ALL_INVOICE . $filter_per . " and jr_def_type='FIN'" .
1091  " $available_ledger";
1092  $step = $_SESSION['g_pagesize'];
1093  $page = (isset($_GET['offset'])) ? $_GET['page'] : 1;
1094  $offset = (isset($_GET['offset'])) ? $_GET['offset'] : 0;
1095 
1096  $l = "";
1097 
1098  // check if qcode contains something
1099  if ($qcode != "")
1100  {
1101  // add a condition to filter on the quick code
1102  $l = " and jr_grpt_id in (select j_grpt from jrnx where j_qcode=upper('$qcode')) ";
1103  }
1104 
1105  list($max_line, $list) = ListJrn($this->db, "where jrn_def_type='FIN' $filter_per $l $available_ledger "
1106  , null, $offset, 0);
1108 
1109  echo "<hr> $bar";
1110  echo $list;
1111  echo "$bar <hr>";
1112  }
1113 
1114  /**
1115  * return a string with the bank account, name and quick_code
1116  */
1117  function get_bank_name()
1118  {
1119  $this->bank_id = $this->db->get_value('select jrn_def_bank from jrn_def where jrn_def_id=$1', array($this->id));
1120  $fBank = new Fiche($this->db, $this->bank_id);
1121  $e_bank_account = " : " . $fBank->strAttribut(ATTR_DEF_BQ_NO);
1122  $e_bank_name = " : " . $fBank->strAttribut(ATTR_DEF_NAME);
1123  $e_bank_qcode = ": " . $fBank->strAttribut(ATTR_DEF_QUICKCODE);
1124  return $e_bank_qcode . $e_bank_name . $e_bank_account;
1125  }
1126 
1127  /**
1128  * return the fiche_id of the bank
1129  */
1130  function get_bank()
1131  {
1132  $bank_id = $this->db->get_value('select jrn_def_bank from jrn_def where jrn_def_id=$1', array($this->id));
1133  return $bank_id;
1134  }
1135 
1136  /**
1137  * return true is we numbere each operation
1138  */
1139  function numb_operation()
1140  {
1141  $a = $this->db->get_value('select jrn_def_num_op from jrn_def where jrn_def_id=$1', array($this->id));
1142  if ($a == 1)
1143  return true;
1144  return false;
1145  }
1146 
1147  /**
1148  * insert into the quant_fin table
1149  * @param $bank_id is the f_id of the bank
1150  * @param $jr_id is the jrn.jr_id of the operation
1151  * @param $other is the f_id of the benefit
1152  * @param $amount is the amount
1153  */
1154  function insert_quant_fin($p_bankid, $p_jrid, $p_otherid, $p_amount)
1155  {
1156  $sql = "INSERT INTO quant_fin(qf_bank, jr_id, qf_other, qf_amount)
1157  VALUES ($1, $2, $3, $4);";
1158 
1159  $this->db->exec_sql($sql, array($p_bankid, $p_jrid, $p_otherid, round($p_amount, 2)));
1160  }
1161 
1162 }
get_name()
Return the name of a ledger.
alert($p_msg, $buffer=false)
alert in javascript
Definition: ac_common.php:666
$_GET['qcode']
$_POST['ac']
Definition: do.php:279
get_last_date()
get the date of the last operation
Generate the form for the periode Data Members.
if($g_user->check_dossier(dossier::id(), true)=='X') $op
Definition: ajax_ledger.php:89
this class is used to show the form for entering an operation only FOR analytic operation to save it...
numb_operation()
return true is we numbere each operation
sql_string($p_string)
Fix the problem with the quote char for the database.
Definition: ac_common.php:457
td($p_string='', $p_extra='')
surround the string with td
Definition: ac_common.php:83
static infobulle($p_comment)
const FICADD
$class
show_ledger()
display operation of a FIN ledger
h2($p_string, $p_class="", $raw="")
Definition: ac_common.php:68
th($p_string, $p_extra='', $raw='')
Definition: ac_common.php:58
nbm($p_number, $p_dec=2)
format the number with a sep.
Definition: ac_common.php:121
static hidden($p_array)
return an HTML string containing hidden input type to hold the differant PA_ID
Concerns the Analytic plan (table plan_analytique)
Manage the account from the table jrn, jrnx or tmp_pcmn.
isNumber(&$p_int)
Definition: ac_common.php:202
__construct($p_cn, $p_init)
foreach($array as $idx=> $m) $w
$idx
update_internal_code($p_internal)
$row
row of the ledger
compute_internal_code($p_grpt)
compute the internal code of the saved operation and set the $this->jr_internal to the computed value...
guess_pj()
guess what the next pj should be
get_solde_detail($p_cond="")
give the balance of an account
insert_quant_fin($p_bankid, $p_jrid, $p_otherid, $p_amount)
insert into the quant_fin table
select_ledger($p_type="ALL", $p_access=3)
Show a select list of the ledgers you can access in writing, reading or simply accessing.
if(!isset($_REQUEST['act'])||!isset($_REQUEST['jr_id'])||!isset($_REQUEST['div'])) global $g_parameter
Definition: ajax_ledger.php:46
get_bank_name()
return a string with the bank account, name and quick_code
const OPEN
Definition: constant.php:170
navigation_bar($p_offset, $p_line, $p_size=0, $p_page=1, $p_javascript="")
Create a navigation_bar (pagesize)
Definition: user_common.php:81
check_strict()
Check if a Dossier is using the strict mode or not.
For the periode tables parm_periode and jrn_periode.
is_closed($p_periode)
check if the current ledger is closed
define Class fiche and fiche def, those class are using class attribut. When adding or modifing new c...
Definition: class_fiche.php:44
static submit($p_name, $p_value, $p_javascript="", $p_class="smallbutton")
for($i=0;$i<$nb_jrn;$i++) $deb
global $g_user
Find the default module or the first one.
Definition: action.inc.php:24
Class for jrn, class acc_ledger for manipulating the ledger.
if($ck==0) $anc
setReadOnly($p_read)
function trim(s)
remove trailing and heading space
Definition: scripts.js:95
const SQL_LIST_ALL_INVOICE
Definition: constant.php:293
new class for managing the reconciliation it must be used instead of the function InsertRapt...
cmpDate($p_date, $p_date_oth)
Compare 2 dates.
Definition: ac_common.php:175
$all
if(sizeof($array)==0) $pPeriode
h($p_string)
to protect again bad characters which can lead to a cross scripting attack the string to be diplayed ...
Definition: ac_common.php:38
this file match the tables jrn & jrnx the purpose is to remove or save accountant writing to these ta...
isDate($p_date)
Definition: ac_common.php:223
$input_from type
Definition: balance.inc.php:70
const ATTR_DEF_QUICKCODE
Definition: constant.php:206
Input HTML for the card show buttons, in the file, you have to add card.js How to use : ...
$jr_id
Definition: ajax_ledger.php:56
$db
database connextion
$nb
default number of rows by default 10
$periode_start
Definition: fiche.inc.php:51
tr($p_string, $p_extra='')
Definition: ac_common.php:88
insert($p_array=null)
save the data into the database, included the attachment, and the reconciliations ...
$SecUser db
check_periode()
Check if a Dossier is using the check on the periode, if true than the user has to enter the date and...
const ATTR_DEF_BQ_NO
Definition: constant.php:186
$ex
Definition: balance.inc.php:48
const ATTR_DEF_NAME
Definition: constant.php:185
inc_seq_pj()
increment the sequence for the pj
verify($p_array)
Verify that the data are correct before inserting or confirming.
static detail_op($p_jr_id, $p_mesg)
return a string containing the html code for calling the modifyOperation
const ATTR_DEF_ACCOUNT
Definition: constant.php:184
static hidden($p_name, $p_value, $p_id="")
$oPeriode
Definition: do.php:177
input($p_array=null, $notused=0)
get_bank()
return the fiche_id of the bank
create_script($p_string)
create the HTML for adding the script tags around of the script
check_parameter($p_array, $p_needed)
Check that all the index are in the array, used by function to check if the array contains the needed...
confirm($p_array, $p_nothing=0)
show the summary before inserting into the database, it calls the function for adding a attachment...
Html Input : Input a date format dd.mm.yyyy The property title should be set to indicate what it is e...
Definition: class_idate.php:31
This class handles only the numeric input, the input will call a javascript to change comma to period...
Definition: class_inum.php:40