Plugins  LAST
 All Data Structures Files Functions Variables Pages
class_ext_tva.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 /* $Revision$ */
20 
21 // Copyright (c) 2002 Author Dany De Bontridder dany@alchimerys.be
22 
23 /*!\file
24  * \brief
25  */
26 require_once('class_ext_tvagen.php');
27 require_once('class_tva_parameter.php');
28 require_once('class_tva_amount.php');
29 require_once NOALYSS_INCLUDE.'/lib/class_html_input.php';
30 class Ext_Tva extends Ext_Tva_Gen
31 {
32  protected $variable=array(
33  "d00"=>"d00",
34  "d01"=>"d01",
35  "d02"=>"d02",
36  "d03"=>"d03",
37  "d44"=>"d44",
38  "d45"=>"d45",
39  "d46"=>"d46",
40  "d47"=>"d47",
41  "d48"=>"d48",
42  "d49"=>"d49",
43  "d81"=>"d81",
44  "d82"=>"d82",
45  "d83"=>"d83",
46  "d84"=>"d84",
47  "d85"=>"d85",
48  "d86"=>"d86",
49  "d54"=>"d54",
50  "d55"=>"d55",
51  "d56"=>"d56",
52  "d57"=>"d57",
53  "d63"=>"d63",
54  "dxx"=>"dxx",
55  "d59"=>"d59",
56  "d61"=>"d61",
57  "d62"=>"d62",
58  "d64"=>"d64",
59  "dyy"=>"dyy",
60  "d71"=>"d71",
61  "d72"=>"d72",
62  "d82"=>"d82",
63  "d87"=>"d87",
64  "d88"=>"d88",
65  "d91"=>"d91",
66  "id"=>"da_id",
67  "date_decl"=>"date_decl",
68  "start_periode"=>"start_periode",
69  "end_periode"=>"end_periode",
70  "xml_file"=>"xml_file",
71  "num_tva"=>"num_tva",
72  "name"=>"tva_name",
73  "adress"=>"adress",
74  "country"=>"country",
75  "flag_periode"=>"flag_periode",
76  "exercice"=>"exercice",
77  "periode_dec"=>"periode_dec"
78  );
79 
80  /**
81  *@brief retrieve * row thanks a condition
82  */
83  public function seek($cond,$p_array=null)
84  {
85  }
86  public function from_array($p_array) {
87  $val=$p_array['val'];
88  $code=$p_array['tvacode'];
89  for ($i=0;$i<count($val);$i++) {
90  $this->$code[$i]=$val[$i];
91  }
92  $this->start_periode=$p_array['start_periode'];
93  $this->end_periode=$p_array['end_periode'];
94  $this->flag_periode=$p_array['flag_periode'];
95  $this->tva_name=$p_array['name'];
96  $this->num_tva=$p_array['num_tva'];
97  $this->adress=$p_array['adress'];
98  $this->country=$p_array['country'];
99  $this->periode_dec=$p_array['periode_dec'];
100  $this->exercice=$p_array['exercice'];
101 
102  }
103  public function insert() {
104 
105  if ( $this->verify() != 0 ) return;
106  $sql="INSERT INTO tva_belge.declaration_amount(
107  d00, d01, d02, d03, d44, d45, d46, d47, d48, d49, d81,
108  d82, d83, d84, d85, d86, d87, d88, d54, d55, d56, d57, d61, d63,
109  dxx, d59, d62, d64, dyy, d71, d72, d91, start_date, end_date,
110  periodicity,tva_name,num_tva,adress,country,periode_dec,exercice)
111  VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12,
112  $13, $14, $15, $16, $17, $18, $19, $20, $21, $22, $23, $24, $25,
113  $26, $27, $28, $29, $30, $31, $32, to_date($33,'DD.MM.YYYY'), to_date($34,'DD.MM.YYYY'), $35,$36,
114  $37,$38,$39,$40,$41)
115  returning da_id;";
116  $this->da_id=$this->db->get_value($sql,
117  array($this->d00, /* 1 */
118  $this->d01, /* 2 */
119  $this->d02, /* 3 */
120  $this->d03, /* 4 */
121  $this->d44, /* 5 */
122  $this->d45, /* 6 */
123  $this->d46, /* 7 */
124  $this->d47, /* 8 */
125  $this->d48, /* 9 */
126  $this->d49, /* 10 */
127  $this->d81, /* 11 */
128  $this->d82, /* 12 */
129  $this->d83, /* 13 */
130  $this->d84, /* 14 */
131  $this->d85, /* 15 */
132  $this->d86, /* 16 */
133  $this->d87, /* 17 */
134  $this->d88, /* 18 */
135  $this->d54, /* 19 */
136  $this->d55, /* 20 */
137  $this->d56, /* 21 */
138  $this->d57, /* 22 */
139  $this->d61, /* 23 */
140  $this->d63, /* 24 */
141  $this->dxx, /* 25 */
142  $this->d59, /* 26 */
143  $this->d62, /* 27 */
144  $this->d64, /* 28 */
145  $this->dyy, /* 29 */
146  $this->d71, /* 30 */
147  $this->d72, /* 31 */
148  $this->d91, /* 32 */
149  $this->start_periode, /* 33 */
150  $this->end_periode, /* 34 */
151  $this->flag_periode, /* 35 */
152  $this->tva_name, /* 36 */
153  $this->num_tva, /* 37 */
154  $this->adress, /* 38 */
155  $this->country, /* 39 */
156  $this->periode_dec, /* 40 */
157  $this->exercice, /* 41 */
158 
159  ));
160  }
161 
162  public function update() {
163  if ( $this->verify() != 0 ) return;
164 
165  }
166 
167  public function load() {
168 
169  $sql="select * from tva_belge.declaration_amount where da_id=$1";
170 
171  $res=$this->db->get_array(
172  $sql,
173  array($this->da_id)
174  );
175  if ( $this->db->count() == 0 ) return;
176  foreach ($res[0] as $idx=>$value) { $this->$idx=$value; }
177  }
178  public function delete() {
179 /* $sql="delete from tva_rate where tva_id=$1";
180  $res=$this->cn->exec_sql($sql,array($this->tva_id));
181 */
182  }
183 
184  function verify() {
185  /**
186  *@todo
187  * MY_NAME can not be empty
188  * MY_TVA contains BE and has 10 digits
189  * this->adress and $this->country can not be empty
190  */
191  return 0;
192  }
193 
194  /**
195  *@brief compute the amount
196  */
197  function compute() {
198  // check that this exercice exist
199  $exist=$this->db->get_value('select count(*) from jrn join parm_periode on (p_id=jr_tech_per) where date_part(\'year\',p_start)=$1',array($this->exercice));
200  if ( $exist==0 ) { alert(_("Cette exercice comptable n'est pas dans ce dossier")); throw new Exception('INVALYEAR',1 ) ;}
201 
202  // set default value 0 for all
203  $keys=array_keys($this->variable);
204  for ($i = 0;$i < count($this->variable);$i++) {
205  $idx=$keys[$i];
206  $this->$idx=0;
207  if ( $idx=='d91') break;
208  }
209 
210  $ctva=new Tva_Parameter($this->db);
211  /**
212  *@todo on ne peut pas calculer de cette façon à cause des opérations qui comprennent plusieurs taux de tva diff.
213  *il faut aller chercher les montants dans les tables quant_*
214  */
215  $array=array('00','01','02','03','44','45','46','47','48','49');
216  for ($e=0;$e<count($array);$e++) {
217  // Compute frame 2
218  $oTva=new Tva_amount($this->db,'out',$this->start_periode,$this->end_periode);
219  $oTva->set_parameter('grid','GRIL'.$array[$e]);
220  $amount=$oTva->amount_operation();
221  $this->set_parameter('d'.$array[$e],$amount);
222  }
223 
224  $array=array('81','82','83','84','85','86','87','88');
225  for ($e=0;$e<count($array);$e++) {
226  // Compute frame 3
227  $oTva=new Tva_amount($this->db,'in',$this->start_periode,$this->end_periode);
228  $oTva->set_parameter('grid','GRIL'.$array[$e]);
229  $amount=$oTva->amount_operation();
230  $this->set_parameter('d'.$array[$e],$amount);
231 
232  }
233  //Frame IV
234  $array=array('54','55','56','57','61','63');
235  for ($e=0;$e<count($array);$e++) {
236  $oTva=new Tva_amount($this->db,'out',$this->start_periode,$this->end_periode);
237  $oTva->set_parameter('grid','GRIL'.$array[$e]);
238  $amount=$oTva->amount_vat();
239  $this->set_parameter('d'.$array[$e],$amount);
240 
241  }
242 
243 
244  $array=array('59','62','64');
245  for ($e=0;$e<count($array);$e++) {
246  $oTva=new Tva_amount($this->db,'in',$this->start_periode,$this->end_periode);
247  $oTva->set_parameter('grid','GRIL'.$array[$e]);
248  $amount=$oTva->amount_vat();
249  $this->set_parameter('d'.$array[$e],$amount);
250 
251  }
252  // for intracom, we compute a false VAT, have to paid it and deduce
253  $this->d55=round($this->d86*0.21+$this->d88*0.21,2);
254  $this->d59+=$this->d55;
255  /**
256  *@todo
257  * GRIL56 - GRIL57 - GRIL61 - GRIL63
258  */
259 
260  //GRILXX
261  $amount=$this->d54+$this->d55+$this->d56+$this->d57+$this->d61+$this->d63;
262  $this->set_parameter('dxx',$amount);
263 
264 
265  // GRILYY
266  $this->dyy=round($this->d59+$this->d62+$this->d64,2);
267 
268 
269  //Fram VI
270  if ( $this->dxx > $this->dyy ) $this->d71=$this->dxx-$this->dyy;
271  if ( $this->dxx < $this->dyy ) $this->d72=$this->dyy-$this->dxx;
272 
273  }
274  /**
275  *@brief get into the table quant_purchase or quant_sold the amount
276  * of VAT
277  *@param
278  *@param
279  *@return
280  *@see
281  */
282 
284  $itext_00=new INum('val[]',$this->get_parameter('d00')); $str_00=$itext_00->input().HtmlInput::hidden('tvacode[]','d00');
285  $itext_01=new INum('val[]',$this->get_parameter('d01')); $str_01=$itext_01->input().HtmlInput::hidden('tvacode[]','d01');
286  $itext_02=new INum('val[]',$this->get_parameter('d02')); $str_02=$itext_02->input().HtmlInput::hidden('tvacode[]','d02');
287  $itext_03=new INum('val[]',$this->get_parameter('d03')); $str_03=$itext_03->input().HtmlInput::hidden('tvacode[]','d03');
288  $itext_44=new INum('val[]',$this->get_parameter('d44')); $str_44=$itext_44->input().HtmlInput::hidden('tvacode[]','d44');
289  $itext_45=new INum('val[]',$this->get_parameter('d45')); $str_45=$itext_45->input().HtmlInput::hidden('tvacode[]','d45');
290  $itext_46=new INum('val[]',$this->get_parameter('d46')); $str_46=$itext_46->input().HtmlInput::hidden('tvacode[]','d46');
291  $itext_47=new INum('val[]',$this->get_parameter('d47')); $str_47=$itext_47->input().HtmlInput::hidden('tvacode[]','d47');
292  $itext_48=new INum('val[]',$this->get_parameter('d48')); $str_48=$itext_48->input().HtmlInput::hidden('tvacode[]','d48');
293  $itext_49=new INum('val[]',$this->get_parameter('d49')); $str_49=$itext_49->input().HtmlInput::hidden('tvacode[]','d49');
294  $itext_81=new INum('val[]',$this->get_parameter('d81')); $str_81=$itext_81->input().HtmlInput::hidden('tvacode[]','d81');
295  $itext_82=new INum('val[]',$this->get_parameter('d82')); $str_82=$itext_82->input().HtmlInput::hidden('tvacode[]','d82');
296  $itext_83=new INum('val[]',$this->get_parameter('d83')); $str_83=$itext_83->input().HtmlInput::hidden('tvacode[]','d83');
297  $itext_84=new INum('val[]',$this->get_parameter('d84')); $str_84=$itext_84->input().HtmlInput::hidden('tvacode[]','d84');
298  $itext_85=new INum('val[]',$this->get_parameter('d85')); $str_85=$itext_85->input().HtmlInput::hidden('tvacode[]','d85');
299  $itext_86=new INum('val[]',$this->get_parameter('d86')); $str_86=$itext_86->input().HtmlInput::hidden('tvacode[]','d86');
300  $itext_87=new INum('val[]',$this->get_parameter('d87')); $str_87=$itext_87->input().HtmlInput::hidden('tvacode[]','d87');
301  $itext_88=new INum('val[]',$this->get_parameter('d88')); $str_88=$itext_88->input().HtmlInput::hidden('tvacode[]','d88');
302 
303  $itext_54=new INum('val[]',$this->get_parameter('d54')); $str_54=$itext_54->input().HtmlInput::hidden('tvacode[]','d54');
304  $itext_55=new INum('val[]',$this->get_parameter('d55')); $str_55=$itext_55->input().HtmlInput::hidden('tvacode[]','d55');
305  $itext_56=new INum('val[]',$this->get_parameter('d56')); $str_56=$itext_56->input().HtmlInput::hidden('tvacode[]','d56');
306  $itext_57=new INum('val[]',$this->get_parameter('d57')); $str_57=$itext_57->input().HtmlInput::hidden('tvacode[]','d57');
307  $itext_63=new INum('val[]',$this->get_parameter('d63')); $str_63=$itext_63->input().HtmlInput::hidden('tvacode[]','d63');
308  $itext_61=new INum('val[]',$this->get_parameter('d61')); $str_61=$itext_61->input().HtmlInput::hidden('tvacode[]','d61');
309  $itext_xx=new INum('val[]',$this->get_parameter('dxx')); $str_xx=$itext_xx->input().HtmlInput::hidden('tvacode[]','dxx');
310  $itext_59=new INum('val[]',$this->get_parameter('d59')); $str_59=$itext_59->input().HtmlInput::hidden('tvacode[]','d59');
311  $itext_62=new INum('val[]',$this->get_parameter('d62')); $str_62=$itext_62->input().HtmlInput::hidden('tvacode[]','d62');
312  $itext_64=new INum('val[]',$this->get_parameter('d64')); $str_64=$itext_64->input().HtmlInput::hidden('tvacode[]','d64');
313  $itext_yy=new INum('val[]',$this->get_parameter('dyy')); $str_yy=$itext_yy->input().HtmlInput::hidden('tvacode[]','dyy');
314  $itext_71=new INum('val[]',$this->get_parameter('d71')); $str_71=$itext_71->input().HtmlInput::hidden('tvacode[]','d71');
315  $itext_72=new INum('val[]',$this->get_parameter('d72')); $str_72=$itext_72->input().HtmlInput::hidden('tvacode[]','d72');
316  $itext_91=new INum('val[]',$this->get_parameter('d91')); $str_91=$itext_91->input().HtmlInput::hidden('tvacode[]','d91');
317 
318 
319  ob_start();
320  require_once('form_decl.php');
321  $r=ob_get_contents();
322  ob_end_clean();
323  $r.=HtmlInput::hidden('periode_dec',$this->periode_dec);
324  return $r;
325 
326  }
327  function menu() {
328  $r='';
329  $js_record=sprintf("onclick=\"record_writing('%s',%d,%d)\"",
330  $_REQUEST['plugin_code'],
331  dossier::id(),
332  $this->da_id);
333  $js_remove=sprintf("onclick=\"if ( confirm('%s')){remove_form('%s',%d,%d,'da');}\"",
334  "Vous confirmez vouloir effacer ?",
335  $_REQUEST['plugin_code'],
336  dossier::id(),
337  $this->da_id);
338 
339  $array=array (
340  array("javascript:void(0)",_("Ecriture comptable"),_("Création de l'écriture comptable"),1,$js_record),
341  array("javascript:void(0)",_("Générer fichier"),_("Création du fichier xml"),2),
342  array("javascript:void(0)",_("Effacement déclaration"),_("Effacement déclaration"),3,$js_remove)
343  );
344  $r.=ShowItem($array,'V',"mtitle","mtitle");
345  return $r;
346 
347  }
348  function propose_form() {
349  $r='';
350  /* take all the vat code */
351  $array=$this->db->get_array("select tva_poste from tva_rate");
352 
353  if ( empty($array)) return 'aucun compte pour la tva';
354 
355  $str_tva="";$sep="";
356  for ($i=0;$i<count($array);$i++) {
357  $str_tva.=$sep.$array[$i]['tva_poste'];
358  $sep=',';
359  }
360 
361  $array=explode(',',$str_tva);
362  $array=array_unique($array);
363 
364  $max=count($array);
365  $periode=new Periode($this->db);
366  $per=$periode->limit_year($this->exercice);
367  $periode->p_id=$per['start'];
368 
369  $first_day=$periode->first_day();
370  $idx=0;
371  $amount_vat=0;
372  $r.='<table class="result">';
373  for ( $i=0;$i<$max;$i++){
374  /* for each rate explode the accounting */
375  // list($deb,$cred)=explode(',',$array[$i]['tva_poste']);
376  $deb=$array[$i];
377  /* get saldo for DEBIT*/
378  $saldo=new Acc_Account_Ledger($this->db,$deb);
379 
380  /* get label */
381  $lib=$this->db->get_value('select pcm_lib from tmp_pcmn where pcm_val=$1',array($deb));
382 
383  $cond=sprintf(" j_date >=to_date('%s','DD.MM.YYYY') and j_date <= '%s'",
384  $first_day,
385  $this->end_date);
386 
387  $result=$saldo->get_solde_detail($cond);
388  if ( $result['solde']==0) continue;
389 
390  $account=new IText('account['.$idx.']');
391  $account->value=$deb;
392  $amount=new INum('amount['.$idx.']');
393  $amount->value=abs($result['solde']);
394 
395  $ICheckBox=new ICheckBox('deb['.$idx.']');
396  if ( $result['debit'] < $result['credit'] ) {
397  $amount_vat-=$result['solde']; $ICheckBox->selected=true;}
398  else {
399  $amount_vat+=$result['solde']; $ICheckBox->selected=false;
400  }
401  $idx++;
402  /* display row */
403  $r.=tr(td($account->input()).td($lib).td($amount->input()).td($ICheckBox->input()));
404 
405  }
406  /* ATVA */
407  $atva=$this->db->get_value("select pcm_val from tva_belge.parameter_chld where pcode='ATVA'");
408  if ( $atva != '' ) {
409  /* get saldo */
410  $saldo=new Acc_Account_Ledger($this->db,$atva);
411  /* get label */
412  $lib=$this->db->get_value('select pcm_lib from tmp_pcmn where pcm_val=$1',array($atva));
413 
414  $cond=sprintf(" j_date >=to_date('%s','DD.MM.YYYY') and j_date <= '%s'",
415  $first_day,
416  $this->end_date);
417  $result=$saldo->get_solde_detail($cond);
418  $ICheckBox=new ICheckBox('atva_ic');
419  $account=new IText('atva');
420  $account->value=$atva;
421  $amount=new INum('atva_amount');
422  $amount->value=abs($result['solde']);
423 
424  if ( $result['debit'] < $result['credit'] ) {
425  $amount_vat-=$result['solde']; $ICheckBox->selected=true;}
426  else {
427  $ICheckBox->selected=false;
428  $amount_vat+=$result['solde'];
429  }
430  /* display row */
431  if ( $result['solde'] != 0) $r.=tr(td($account->input()).td('Avance TVA').td($amount->input()).td($ICheckBox->input()));
432 
433  }
434  /* creance sur tva*/
435  /* CRTVA */
436  $crtva=$this->db->get_value("select pcm_val from tva_belge.parameter_chld where pcode='CRTVA'");
437  if ( $crtva != '' ) {
438  /* get saldo */
439  $saldo=new Acc_Account_Ledger($this->db,$crtva);
440  /* get label */
441  $lib=$this->db->get_value('select pcm_lib from tmp_pcmn where pcm_val=$1',array($crtva));
442 
443  $cond=sprintf(" j_date >=to_date('%s','DD.MM.YYYY') and j_date <= '%s'",
444  $first_day,
445  $this->end_date);
446  $result=$saldo->get_solde_detail($cond);
447  $ICheckBox=new ICheckBox('crtva_ic');
448  $account=new IText('crtva');
449  $account->value=$crtva;
450  $amount=new INum('crtva_amount');
451  $amount->value=abs($result['solde']);
452 
453  if ( $result['debit'] > $result['credit']) {
454  $amount_vat+=$result['solde'];
455  $ICheckBox->selected=false;
456  } else {
457  $amount_vat-=$result['solde'];
458  $ICheckBox->selected=true;
459 
460  }
461  /* display row */
462  if ( $result['solde'] != 0) $r.=tr(td($account->input()).td('Créance compte TVA').td($amount->input()).td($ICheckBox->input()));
463 
464  }
465  /* dette tva */
466  $dttva=$this->db->get_value("select pcm_val from tva_belge.parameter_chld where pcode='DTTVA'");
467  if ( $dttva != '' ) {
468  /* get saldo */
469  $saldo=new Acc_Account_Ledger($this->db,$dttva);
470  /* get label */
471  $lib=$this->db->get_value('select pcm_lib from tmp_pcmn where pcm_val=$1',array($dttva));
472 
473  $cond=sprintf(" j_date >=to_date('%s','DD.MM.YYYY') and j_date <= '%s'",
474  $first_day,
475  $this->end_date);
476  $result=$saldo->get_solde_detail($cond);
477  $ICheckBox=new ICheckBox('dttva_ic');
478  $account=new IText('dttva');
479  $account->value=$dttva;
480  $amount=new INum('dttva_amount');
481  $amount->value=abs($result['solde']);
482 
483  if ( $result['credit'] > $result['debit'] ) {
484  $amount_vat-=$result['solde'];
485  $ICheckBox->selected=true;
486  } else {
487  $ICheckBox->selected=false;
488  $amount_vat+=$result['solde'];
489  }
490  /* display row */
491  if ( $result['solde'] != 0) $r.=tr(td($account->input()).td('Dette Compte TVA').td($amount->input()).td($ICheckBox->input()));
492 
493  }
494  /* if amount_vat > 0 then we have to pay */
495  if ( $amount_vat < 0 ) {
496  /* dette tva */
497  if ( $dttva != '' ) {
498  /* get label */
499  $lib=$this->db->get_value('select pcm_lib from tmp_pcmn where pcm_val=$1',array($dttva));
500 
501  $ICheckBox=new ICheckBox('solde_ic');
502  $ICheckBox->selected=false;
503  $account=new IText('solde');
504  $account->value=$dttva;
505  $amount=new INum('solde_amount');
506  $amount->value=abs($amount_vat);
507 
508  /* display row */
509  $r.=tr(td($account->input()).td('Dette Compte TVA').td($amount->input()).td($ICheckBox->input()));
510  }
511  }else {
512  /* creance tva */
513  if ( $crtva != '' ) {
514  /* get label */
515  $lib=$this->db->get_value('select pcm_lib from tmp_pcmn where pcm_val=$1',array($crtva));
516 
517  $ICheckBox=new ICheckBox('solde_ic');
518  $ICheckBox->selected=true;
519  $account=new IText('solde');
520  $account->value=$crtva;
521  $amount=new INum('solde_amount');
522  $amount->value=abs($amount_vat);
523 
524  /* display row */
525  $r.=tr(td($account->input()).td('Créance Compte TVA').td($amount->input()).td($ICheckBox->input()));
526  }
527 
528  }
529  $r.='</table>';
530 
531  return $r;
532  }
533  function display() {
534  $r= '<form class="print" id="readonly">';
535  $r.=HtmlInput::request_to_hidden(array('ac'));
536  $r.='<div style="position:absolute;top:150;right:0;width:200;right-margin:3%">';
537  $r.=$this->menu();
538  $r.='</div>';
539  $r.=$this->display_info();
540  $r.=$this->display_declaration_amount();
541  $r.='</form>';
542  $r.= create_script("$('readonly').disable();");
543  return $r;
544  }
545 
546 }
if(isset($_POST['ftvaadd'])) if(isset($_POST['mod'])) $atva
get data from database
$select_type id
compute()
compute the amount
from_array($p_array)
$periode
$r
display_info()
display the information about the company
set_parameter($p_string, $p_value)
seek($cond, $p_array=null)
retrieve * row thanks a condition
if(isset($_POST['remove'])) $array
$res
display_declaration_amount()
get into the table quant_purchase or quant_sold the amount of VAT
$_REQUEST['sb']
Definition: am_print.php:39
$sql
get_parameter($p_string)