phpcompta-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Phpcompta-dev] r456 - tag/rel652/rapport_avance


From: phpcompta-dev
Subject: [Phpcompta-dev] r456 - tag/rel652/rapport_avance
Date: Thu, 27 Dec 2012 02:26:32 +0100 (CET)

Author: danydb
Date: 2012-12-27 02:26:31 +0100 (Thu, 27 Dec 2012)
New Revision: 456

Removed:
   tag/rel652/rapport_avance/class_ext_list_assujetti.php
   tag/rel652/rapport_avance/class_ext_list_intra.php
   tag/rel652/rapport_avance/class_ext_tva.php
   tag/rel652/rapport_avance/class_ext_tvagen.php
   tag/rel652/rapport_avance/class_listing.php
   tag/rel652/rapport_avance/class_tva_amount.php
   tag/rel652/rapport_avance/class_tva_parameter.php
   tag/rel652/rapport_avance/decl_tva.inc.php
   tag/rel652/rapport_avance/form_decl.php
   tag/rel652/rapport_avance/form_decl_info.php
   tag/rel652/rapport_avance/form_parameter.php
   tag/rel652/rapport_avance/form_periode.php
   tag/rel652/rapport_avance/js_scripts.js
   tag/rel652/rapport_avance/list_assujetti.inc.php
   tag/rel652/rapport_avance/list_intra.inc.php
   tag/rel652/rapport_avance/list_tva.inc.php
   tag/rel652/rapport_avance/tva_constant.php
   tag/rel652/rapport_avance/tva_param.inc.php
Log:
remove obsolete files

Deleted: tag/rel652/rapport_avance/class_ext_list_assujetti.php
===================================================================
--- tag/rel652/rapport_avance/class_ext_list_assujetti.php      2012-12-27 
00:27:39 UTC (rev 455)
+++ tag/rel652/rapport_avance/class_ext_list_assujetti.php      2012-12-27 
01:26:31 UTC (rev 456)
@@ -1,327 +0,0 @@
-<?php
-  /*
-   *   This file is part of PhpCompta.
-   *
-   *   PhpCompta is free software; you can redistribute it and/or modify
-   *   it under the terms of the GNU General Public License as published by
-   *   the Free Software Foundation; either version 2 of the License, or
-   *   (at your option) any later version.
-   *
-   *   PhpCompta is distributed in the hope that it will be useful,
-   *   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-   *   GNU General Public License for more details.
-   *
-   *   You should have received a copy of the GNU General Public License
-   *   along with PhpCompta; if not, write to the Free Software
-   *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  
USA
-   */
-  /* $Revision$ */
-
-  // Copyright Author Dany De Bontridder address@hidden
-
-  /*!\file
-   * \brief
-   */
-
-require_once('class_listing.php');
-require_once('class_fiche.php');
-require_once('class_tva_parameter.php');
-class Ext_List_Assujetti extends Listing {
-  protected $variable = array(
-                             "id"=>"a_id",
-                             "date_decl"=>"date_decl",
-                             "start_periode"=>"start_periode",
-                             "end_periode"=>"end_periode",
-                             "xml_file"=>"xml_file",
-                             "num_tva"=>"num_tva",
-                             "name"=>"tva_name",
-                             "adress"=>"adress",
-                             "country"=>"country",
-                             "flag_periode"=>"flag_periode",
-                             "exercice"=>"exercice",
-                             "periode_dec"=>"periode_dec"
-                             );
-  private $aChild=array();
-  static function choose_periode($by_year=false) {
-
-    // year
-    $year = new IText('year');
-    $year->size=4;
-    $str_year=$year->input();
-
-
-    $str_submit=HtmlInput::submit('decl',_('Afficher'));
-    $str_hidden=HtmlInput::extension().dossier::hidden();
-    if (isset($_REQUEST['sa']))
-      $str_hidden.=HtmlInput::hidden('sa',$_REQUEST['sa']);
-    $r='<form class="print" method="get">';
-    $r.="Année :".$str_year;
-    $r.=$str_submit;
-    $r.=$str_hidden;
-       $r.=HtmlInput::request_to_hidden(array('ac'));
-    $r.='</form>';
-    return $r;
-  }
-
-  function from_array($p_array){
-    if ( isset($p_array['name_child'])) {
-      $name=$p_array['name_child'];
-      $qcode=$p_array['qcode'];
-      $code=$p_array['plugin_code'];
-      $tva_num=$p_array['tva_num_child'];
-      $amount=$p_array['amount'];
-      $amount_vat=$p_array['amount_vat'];
-
-      // retrieve missing and compute an array
-      for ($i=0;$i<count($name);$i++){
-       $child=new Ext_List_Assujetti_Child($this->db);
-       $child->set_parameter('amount',$amount[$i]);
-       $child->set_parameter('amount_vat',$amount_vat[$i]);
-       $child->set_parameter('qcode',$qcode[$i]);
-       $child->set_parameter('name_child',$name[$i]);
-       $child->set_parameter('tva_num',$tva_num[$i]);
-
-       $array[]=$child;
-      }//end for
-      $this->aChild=$array;
-    } else
-      $this->aChild=array();
-
-    $this->start_periode=$p_array['start_periode'];
-    $this->end_periode=$p_array['end_periode'];
-    $this->flag_periode=$p_array['flag_periode'];
-    $this->tva_name=$p_array['name'];
-    $this->num_tva=$p_array['num_tva'];
-    $this->adress=$p_array['adress'];
-    $this->country=$p_array['country'];
-    $this->periode_dec=$p_array['periode_dec'];
-    $this->exercice=$p_array['exercice'];
-  }
-  function display() {
-    $r= '<form class="print" id="readonly">';
-       $r.=HtmlInput::request_to_hidden(array('ac'));
-    $r.=$this->display_info();
-    $r.=$this->display_declaration_amount(true);
-    $r.='</form>';
-    $js_remove=sprintf("onclick=\"if ( 
confirm('%s')){remove_form('%s',%d,%d,'lc');}\"",
-                      "Vous confirmez vouloir effacer ?",
-                       $_REQUEST['plugin_code'],
-                       dossier::id(),
-                       $this->a_id);
-    $r.=HtmlInput::button('Effacer','Effacer',$js_remove);
-
-    $r.= create_script("$('readonly').disable();");
-    return $r;
-  }
-  function load() {
-    $sql="select * from tva_belge.assujetti where a_id=$1";
-
-    $res=$this->db->get_array(
-                             $sql,
-                             array($this->a_id)
-                             );
-    if ( $this->db->count() == 0 ) return 0;
-    foreach ($res[0] as $idx=>$value) { $this->$idx=$value; }
-    // load child
-    $sql="select * from tva_belge.assujetti_chld where a_id=$1";
-    $res=$this->db->get_array(
-                             $sql,
-                             array($this->a_id)
-                             );
-    $nb=$this->db->count();
-    $array=array();
-    // retrieve missing and compute an array
-    for ($i=0;$i<$nb;$i++){
-      $child=new Ext_List_Assujetti_Child($this->db);
-      foreach ($res[$i] as $idx=>$value){
-       $child->$idx=$value;
-      }
-      $array[]=$child;
-    }//end for
-    $this->aChild=$array;
-
-    return 1;
-  }
-  function verify() {
-    return 0;
-  }
-  function insert() {
-    $this->db->start();
-
-    /* insert into the first table */
-    $sql=<<<EOF
-      INSERT INTO tva_belge.assujetti(
-                                     start_date, end_date,  periodicity, 
tva_name,
-                                     num_tva, adress, country,  
periode_dec,exercice)
-      VALUES 
(to_date($1,'DD.MM.YYYY'),to_date($2,'DD.MM.YYYY'),$3,$4,$5,$6,$7,$8,$9) 
returning a_id;
-EOF;
-    $this->a_id=$this->db->get_value($sql,
-                                    array(
-                                          $this->start_periode, /* 1 */
-                                          $this->end_periode,
-                                          $this->flag_periode, /* 3 */
-                                          $this->tva_name,
-                                          $this->num_tva, /* 5 */
-                                          $this->adress,
-                                          $this->country, /* 7 */
-                                          $this->periode_dec,
-                                          $this->exercice /* 9 */
-                                          )
-                                    );
-    /* insert into the child table */
-    for ($e=0;$e<count($this->aChild);$e++){
-      $this->aChild[$e]->set_parameter('depend',$this->a_id);
-      $this->aChild[$e]->insert();
-    }
-    $this->db->commit();
-
-  }
-  function update() {
-  }
-
-  function compute(){
-    /* retrieve accounting customer */
-    $code_customer=new Acc_Parm_Code($this->db);
-    $code_customer->p_code='CUSTOMER';
-    $code_customer->load();
-    $a=$this->find_tva_code('ASSUJETTI');
-    if (trim($a)=='') $a=-1;
-    $sql=<<<EOF
-      select sum(j_montant) as amount,j_qcode
-      from jrnx
-      where j_grpt in (select distinct j_grpt from quant_sold join jrnx using 
(j_id) where qs_vat_code in ($a) )
-      and j_poste::text like $1||'%'
-      and (j_date >= to_date($2,'DD.MM.YYYY') and j_date <= 
to_date($3,'DD.MM.YYYY'))
-      group by j_qcode
-EOF;
-    // get all of them
-    $all=$this->db->get_array($sql,array($code_customer->p_value,
-                                        $this->start_periode,
-                                        $this->end_periode
-                                        )
-                             );
-    $array=array();
-
-    // retrieve missing and compute an array
-    for ($i=0;$i<count($all);$i++){
-      $child=new Ext_List_Assujetti_Child($this->db);
-
-
-      $child->set_parameter('qcode',$all[$i]['j_qcode']);
-      $fiche=new Fiche($this->db);
-      $fiche->get_by_qcode($all[$i]['j_qcode'],false);
-      $num_tva=$fiche->strAttribut(ATTR_DEF_NUMTVA);
-      $child->set_parameter('tva_num',$num_tva);
-      $sq="select sum(qs_vat) from quant_sold
-where qs_client = $1 and j_id in (select distinct j_id from jrnx where  j_date 
>= to_date($2,'DD.MM.YYYY')
-                                  and j_date <= to_date($3,'DD.MM.YYYY')
-                                  )
-     and qs_vat_code in ($a)
-";
-      // if in the same operation, we use 2 different tva code, the amount is 
incorrect if one of them is
-      // excluded
-      $exclude="select coalesce(sum(qs_price),0) from quant_sold
-where qs_client = $1 and j_id in (select distinct j_id from jrnx where  j_date 
>= to_date($2,'DD.MM.YYYY')
-                                  and j_date <= to_date($3,'DD.MM.YYYY')
-                                  )
-     and qs_vat_code not in ($a)
-";
-      $excl=$this->db->get_value($exclude,array($fiche->id,
-                                               $this->start_periode,
-                                               $this->end_periode));
-      $amount_vat=$this->db->get_value($sq,array($fiche->id,
-                                                $this->start_periode,
-                                                $this->end_periode));
-      $amount=$all[$i]['amount']-$amount_vat-$excl;
-      $child->set_parameter('amount',$amount);
-      $child->set_parameter('amount_vat',$amount_vat);
-
-      $child->set_parameter('name_child',$fiche->strAttribut(ATTR_DEF_NAME));
-
-      $array[]=$child;
-    }//end for
-    $this->aChild=$array;
-  }
-  /**
-   address@hidden finish it
-   */
-  function display_declaration_amount($readonly=false) {
-    $res='<fieldset><legend>Listing</legend>';
-    $res.= '<table id="tb_dsp" class="result" style="width:80%;">';
-    $clean=new IButton('rm_b');
-    $clean->label='Efface ligne';
-    $clean->javascript="deleteRow('tb_dsp',this);";
-
-    $r='';
-    $r.=th('QuickCode');
-    $r.=th('Name');
-    $r.=th('Code Pays et numéro de TVA');
-    $r.=th('montant CA');
-    $r.=th('montant TVA');
-    $r.=th('');
-    $amount=0;$amount_vat=0;
-    $res.=tr($r);
-    for ($i=0;$i<count($this->aChild);$i++) {
-      $a=new IText('qcode[]',$this->aChild[$i]->get_parameter('qcode'));
-      $b=new 
IText('name_child[]',$this->aChild[$i]->get_parameter('name_child'));
-      $c=new 
IText('tva_num_child[]',$this->aChild[$i]->get_parameter('tva_num'));
-      $e=new INum('amount[]',$this->aChild[$i]->get_parameter('amount'));
-      $d=new 
INum('amount_vat[]',$this->aChild[$i]->get_parameter('amount_vat'));
-
-      $amount+=round($this->aChild[$i]->get_parameter('amount'),2);
-      $amount_vat+=round($this->aChild[$i]->get_parameter('amount_vat'),2);
-      $r=td($a->input());
-      $r.=td($b->input());
-      $r.=td($c->input());
-      $r.=td($e->input());
-      $r.=td($d->input());
-     if (! $readonly) $r.=td($clean->input());
-      $res.=tr($r);
-
-    }
-       if ( $readonly )
-       {
-               $r=td('');
-               $r.=td('');
-               $r.=td(hb('Total'));
-               $r.=td(hb(sprintf('%.02f',$amount)));
-               $r.=td(hb(sprintf('%.02f',$amount_vat)));
-               $res.=tr($r);
-       }
-
-    $res.='</table>';
-    $res.='</fieldset>';
-    return $res;
-  }
-}
-
-class Ext_List_Assujetti_Child extends Ext_List_Assujetti {
-  protected $variable=array(
-                           "id"=>"ac_id",
-                           "tva_num"=>"ac_tvanum",
-                           "amount"=>"ac_amount",
-                           "amount_vat"=>"ac_vat",
-                           "depend"=>"a_id",
-                           "qcode"=>"ac_qcode",
-                           "name_child"=>'ac_name'
-                           );
-  function insert() {
-
-    $sql=<<<EOF
-      INSERT INTO tva_belge.assujetti_chld(
-                                          a_id, ac_tvanum, ac_amount, ac_vat,  
ac_qcode,
-                                          ac_name)
-      VALUES ($1, $2, $3, $4, $5, $6) returning ac_id;
-EOF;
-    $this->ic_id=$this->db->get_value($sql,array(
-                                                $this->a_id,
-                                                $this->ac_tvanum,
-                                                $this->ac_amount,
-                                                $this->ac_vat,
-                                                $this->ac_qcode,
-                                                $this->ac_name
-                                                ));
-  }
-
-}

Deleted: tag/rel652/rapport_avance/class_ext_list_intra.php
===================================================================
--- tag/rel652/rapport_avance/class_ext_list_intra.php  2012-12-27 00:27:39 UTC 
(rev 455)
+++ tag/rel652/rapport_avance/class_ext_list_intra.php  2012-12-27 01:26:31 UTC 
(rev 456)
@@ -1,309 +0,0 @@
-<?php
-/*
- *   This file is part of PhpCompta.
- *
- *   PhpCompta is free software; you can redistribute it and/or modify
- *   it under the terms of the GNU General Public License as published by
- *   the Free Software Foundation; either version 2 of the License, or
- *   (at your option) any later version.
- *
- *   PhpCompta is distributed in the hope that it will be useful,
- *   but WITHOUT ANY WARRANTY; without even the implied warranty of
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *   GNU General Public License for more details.
- *
- *   You should have received a copy of the GNU General Public License
- *   along with PhpCompta; if not, write to the Free Software
- *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
-*/
-/* $Revision$ */
-
-// Copyright Author Dany De Bontridder address@hidden
-
-/*!\file
- * \brief
- */
-
-require_once('class_listing.php');
-require_once('class_fiche.php');
-require_once('class_tva_parameter.php');
-class Ext_List_Intra extends Listing {
-  protected $variable = array(
-                             "id"=>"i_id",
-                             "date"=>"i_date",
-                             "date_decl"=>"date_decl",
-                             "start_periode"=>"start_periode",
-                             "end_periode"=>"end_periode",
-                             "xml_file"=>"xml_file",
-                             "num_tva"=>"num_tva",
-                             "name"=>"tva_name",
-                             "adress"=>"adress",
-                             "country"=>"country",
-                             "flag_periode"=>"flag_periode",
-                             "exercice"=>"exercice",
-                             "periode_dec"=>"periode_dec"
-                             );
-  private $aChild=array();
-
-  function from_array($p_array){
-    if( isset($p_array['name_child'])) {
-      $name=$p_array['name_child'];
-     $qcode=$p_array['qcode'];
-     $code=$p_array['tvacode'];
-     $tva_num=$p_array['tva_num_child'];
-     $amount=$p_array['amount'];
-     $periode=$p_array['periode'];
-     $array=array();
-    // retrieve missing and compute an array
-    for ($i=0;$i<count($name);$i++){
-      $child=new Ext_List_Intra_Child($this->db);
-      $child->set_parameter('amount',$amount[$i]);
-      $child->set_parameter('periode',$periode[$i]);
-      $child->set_parameter('qcode',$qcode[$i]);
-      $child->set_parameter('code',$code[$i]);
-      $child->set_parameter('name_child',$name[$i]);
-      $child->set_parameter('tva_num',$tva_num[$i]);
-
-      $array[]=$child;
-    }//end for
-    $this->aChild=$array;
-    } else
-      $this->aChild=array();
-
-    $this->start_periode=$p_array['start_periode'];
-    $this->end_periode=$p_array['end_periode'];
-    $this->flag_periode=$p_array['flag_periode'];
-    $this->tva_name=$p_array['name'];
-    $this->num_tva=$p_array['num_tva'];
-    $this->adress=$p_array['adress'];
-    $this->country=$p_array['country'];
-    $this->periode_dec=$p_array['periode_dec'];
-    $this->exercice=$p_array['exercice'];
-
-  }
-  function display() {
-     $r= '<form class="print" id="readonly">';
-     $r.=$this->display_info();
-        $r.=HtmlInput::request_to_hidden(array('ac'));
-     $r.=$this->display_declaration_amount();
-     $r.='</form>';
-     $js_remove=sprintf("onclick=\"if ( 
confirm('%s')){remove_form('%s',%d,%d,'li');}\"",
-                      "Vous confirmez vouloir effacer ?",
-                       $_REQUEST['plugin_code'],
-                       dossier::id(),
-                       $this->i_id);
-
-     $r.=HtmlInput::button('Effacer','Effacer',$js_remove);
-     $r.= create_script("$('readonly').disable();");
-     return $r;
-  }
-  function load() {
-    $sql="select * from tva_belge.intracomm where i_id=$1";
-
-   $res=$this->db->get_array(
-                           $sql,
-                           array($this->i_id)
-                           );
-   if ( $this->db->count() == 0 ) return 0;
-   foreach ($res[0] as $idx=>$value) { $this->$idx=$value; }
-   // load child
-   $sql="select * from tva_belge.intracomm_chld where i_id=$1";
-   $res=$this->db->get_array(
-                           $sql,
-                           array($this->i_id)
-                           );
-   $nb=$this->db->count();
-   $array=array();
-   // retrieve missing and compute an array
-   for ($i=0;$i<$nb;$i++){
-     $child=new Ext_List_Intra_Child($this->db);
-     foreach ($res[$i] as $idx=>$value){
-       $child->$idx=$value;
-     }
-     $array[]=$child;
-   }//end for
-   $this->aChild=$array;
-
-   return 1;
-  }
-  function verify() {
-    return 0;
-  }
-  function insert() {
-    $this->db->start();
-
-    /* insert into the first table */
-    $sql=<<<EOF
-INSERT INTO tva_belge.intracomm(
-            start_date, end_date,  periodicity, tva_name,
-            num_tva, adress, country,  periode_dec,exercice)
-      VALUES 
(to_date($1,'DD.MM.YYYY'),to_date($2,'DD.MM.YYYY'),$3,$4,$5,$6,$7,$8,$9) 
returning i_id;
-EOF;
-$this->i_id=$this->db->get_value($sql,
-                    array(
-                          $this->start_periode,
-                          $this->end_periode,
-                          $this->flag_periode,
-                          $this->tva_name,
-                          $this->num_tva,
-                          $this->adress,
-                          $this->country,
-                          $this->periode_dec,
-                          $this->exercice
-                          )
-                    );
-/* insert into the child table */
-for ($e=0;$e<count($this->aChild);$e++){
-  $this->aChild[$e]->set_parameter('depend',$this->i_id);
-  $this->aChild[$e]->insert();
-}
-  $this->db->commit();
-
-  }
-  function update() {
-  }
-
-  function compute(){
-    /* retrieve accounting customer */
-    $code_customer=new Acc_Parm_Code($this->db);
-    $code_customer->p_code='CUSTOMER';
-    $code_customer->load();
-    $a=$this->find_tva_code('CLINTRA');
-
-    if (trim($a)=='') $a=-1;
-    $sql=<<<EOF
-      select sum(j_montant) as amount,j_qcode
-      from jrnx
-      where j_grpt in (select distinct j_grpt from quant_sold join jrnx using 
(j_id) where qs_vat_code in ($a) )
-      and j_poste::text like $1||'%'
-      and (j_date >= to_date($2,'DD.MM.YYYY') and j_date <= 
to_date($3,'DD.MM.YYYY'))
-      group by j_qcode
-EOF;
-    // get all of them
-    $all=$this->db->get_array($sql,array($code_customer->p_value,
-                                       $this->start_periode,
-                                       $this->end_periode
-                                       )
-                            );
-    $array=array();
-
-    // retrieve missing and compute an array
-    for ($i=0;$i<count($all);$i++){
-               $child=new Ext_List_Intra_Child($this->db);
-               $child->set_parameter('amount',$all[$i]['amount']);
-               switch ($this->flag_periode) {
-               case 1:
-               // by month
-               
$child->set_parameter('periode',sprintf('%02d%s',$this->periode_dec,$this->exercice));
-               break;
-               case 2:
-               /* quaterly */
-               
$child->set_parameter('periode',sprintf('3%d%s',$this->periode_dec,$this->exercice));
-               break;
-               case 3:
-               /* yearly */
-               
$child->set_parameter('periode',sprintf('00%s',$this->periode_dec,$this->exercice));
-               break;
-      } // end switch
-
-      $child->set_parameter('qcode',$all[$i]['j_qcode']);
-      $fiche=new Fiche($this->db);
-      $fiche->get_by_qcode($all[$i]['j_qcode'],false);
-      $num_tva=$fiche->strAttribut(ATTR_DEF_NUMTVA);
-
-      if ( trim($num_tva) === "") {continue;}
-      $child->set_parameter('tva_num',$num_tva);
-
-      $child->set_parameter('name_child',$fiche->strAttribut(ATTR_DEF_NAME));
-      $child->set_parameter('code','L');
-
-      $array[]=$child;
-    }//end for
-    $this->aChild=$array;
-  }
-  /**
-   address@hidden finish it
-   */
-  function display_declaration_amount($p_readonly=false) {
-    $res='<fieldset><legend>Listing</legend>';
-
-    $res.= '<table id="tb_dsp" class="result" style="width:80%;">';
-    $clean=new IButton();
-    $clean->label='Efface ligne';
-    $clean->javascript="deleteRow('tb_dsp',this);";
-
-    $r='';
-    $r.=th('QuickCode');
-    $r.=th('Name');
-    $r.=th('Code Pays et numéro de TVA');
-    $r.=th('Code Pays et numéro de TVA');
-    $r.=th('montant');
-    $r.=th('periode');
-    $r.=th('');
-    $amount=0;
-    $res.=tr($r);
-    for ($i=0;$i<count($this->aChild);$i++) {
-      $a=new IText('qcode[]',$this->aChild[$i]->get_parameter('qcode'));
-      $b=new 
IText('name_child[]',$this->aChild[$i]->get_parameter('name_child'));
-      $c=new 
IText('tva_num_child[]',$this->aChild[$i]->get_parameter('tva_num'));
-      $d=new IText('tvacode[]',$this->aChild[$i]->get_parameter('code'));
-      $e=new INum('amount[]',$this->aChild[$i]->get_parameter('amount'));
-      $f=new IText('periode[]',$this->aChild[$i]->get_parameter('periode'));
-
-      $amount+=round($this->aChild[$i]->get_parameter('amount'),2);
-      $r=td($a->input());
-      $r.=td($b->input());
-      $r.=td($c->input());
-      $r.=td($d->input());
-      $r.=td($e->input());
-      $r.=td($f->input());
-      if (! $p_readonly) $r.=td($clean->input());
-      $res.=tr($r);
-
-    }
-       if ( $p_readonly)
-       {
-               $r=td('');
-               $r.=td('');
-               $r.=td('');
-               $r.=td(hb('Total'));
-               $r.=td(hb(sprintf('%.02f',$amount)));
-               $r.=td('');
-               $r.=td('');
-               $res.=tr($r);
-       }
-       $res.='</table>';
-    $res.='</fieldset>';
-    return $res;
-  }
-}
-
-class Ext_List_Intra_Child extends Ext_List_Intra {
-  protected $variable=array(
-                           "id"=>"ic_id",
-                           "tva_num"=>"ic_tvanum",
-                           "amount"=>"ic_amount",
-                           "code"=>"ic_code",
-                           "periode"=>"ic_periode",
-                           "depend"=>"i_id",
-                           "qcode"=>"ic_qcode",
-                           "name_child"=>'ic_name'
-                           );
-  function insert() {
-$sql=<<<EOF
-INSERT INTO tva_belge.intracomm_chld(
-            i_id, ic_tvanum, ic_amount, ic_code, ic_periode, ic_qcode,
-            ic_name)
-  VALUES ($1, $2, $3, $4, $5, $6, $7) returning ic_id;
-EOF;
-$this->ic_id=$this->db->get_value($sql,array(
-                                            $this->i_id,
-                                            $this->ic_tvanum,
-                                            $this->ic_amount,
-                                            $this->ic_code,
-                                            $this->ic_periode,
-                                            $this->ic_qcode,
-                                            $this->ic_name));
-  }
-
-}

Deleted: tag/rel652/rapport_avance/class_ext_tva.php
===================================================================
--- tag/rel652/rapport_avance/class_ext_tva.php 2012-12-27 00:27:39 UTC (rev 
455)
+++ tag/rel652/rapport_avance/class_ext_tva.php 2012-12-27 01:26:31 UTC (rev 
456)
@@ -1,546 +0,0 @@
-<?php
-/*
- *   This file is part of PhpCompta.
- *
- *   PhpCompta is free software; you can redistribute it and/or modify
- *   it under the terms of the GNU General Public License as published by
- *   the Free Software Foundation; either version 2 of the License, or
- *   (at your option) any later version.
- *
- *   PhpCompta is distributed in the hope that it will be useful,
- *   but WITHOUT ANY WARRANTY; without even the implied warranty of
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *   GNU General Public License for more details.
- *
- *   You should have received a copy of the GNU General Public License
- *   along with PhpCompta; if not, write to the Free Software
- *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
-*/
-/* $Revision$ */
-
-// Copyright Author Dany De Bontridder address@hidden
-
-/*!\file
- * \brief
- */
-require_once('class_ext_tvagen.php');
-require_once('class_tva_parameter.php');
-require_once('class_tva_amount.php');
-require_once('class_html_input.php');
-class Ext_Tva extends Ext_Tva_Gen
-{
-    protected   $variable=array(
-                          "d00"=>"d00",
-                          "d01"=>"d01",
-                          "d02"=>"d02",
-                          "d03"=>"d03",
-                          "d44"=>"d44",
-                          "d45"=>"d45",
-                          "d46"=>"d46",
-                          "d47"=>"d47",
-                          "d48"=>"d48",
-                          "d49"=>"d49",
-                          "d81"=>"d81",
-                          "d82"=>"d82",
-                          "d83"=>"d83",
-                          "d84"=>"d84",
-                          "d85"=>"d85",
-                          "d86"=>"d86",
-                          "d54"=>"d54",
-                          "d55"=>"d55",
-                          "d56"=>"d56",
-                          "d57"=>"d57",
-                          "d63"=>"d63",
-                          "dxx"=>"dxx",
-                          "d59"=>"d59",
-                          "d61"=>"d61",
-                          "d62"=>"d62",
-                          "d64"=>"d64",
-                          "dyy"=>"dyy",
-                          "d71"=>"d71",
-                          "d72"=>"d72",
-                          "d82"=>"d82",
-                          "d87"=>"d87",
-                          "d88"=>"d88",
-                          "d91"=>"d91",
-                          "id"=>"da_id",
-                          "date_decl"=>"date_decl",
-                          "start_periode"=>"start_periode",
-                          "end_periode"=>"end_periode",
-                          "xml_file"=>"xml_file",
-                          "num_tva"=>"num_tva",
-                          "name"=>"tva_name",
-                          "adress"=>"adress",
-                          "country"=>"country",
-                          "flag_periode"=>"flag_periode",
-                          "exercice"=>"exercice",
-                          "periode_dec"=>"periode_dec"
-                          );
-
-  /**
-   address@hidden retrieve * row thanks a condition
-   */
-   public function seek($cond,$p_array=null)
-   {
-   }
-   public function from_array($p_array) {
-     $val=$p_array['val'];
-     $code=$p_array['tvacode'];
-     for ($i=0;$i<count($val);$i++) {
-       $this->$code[$i]=$val[$i];
-     }
-     $this->start_periode=$p_array['start_periode'];
-     $this->end_periode=$p_array['end_periode'];
-     $this->flag_periode=$p_array['flag_periode'];
-     $this->tva_name=$p_array['name'];
-     $this->num_tva=$p_array['num_tva'];
-     $this->adress=$p_array['adress'];
-     $this->country=$p_array['country'];
-     $this->periode_dec=$p_array['periode_dec'];
-     $this->exercice=$p_array['exercice'];
-
-   }
-  public function insert() {
-
-    if ( $this->verify() != 0 ) return;
-    $sql="INSERT INTO tva_belge.declaration_amount(
-             d00, d01, d02, d03, d44, d45, d46, d47, d48, d49, d81,
-            d82, d83, d84, d85, d86, d87, d88, d54, d55, d56, d57, d61, d63,
-            dxx, d59, d62, d64, dyy, d71, d72, d91, start_date, end_date,
-             periodicity,tva_name,num_tva,adress,country,periode_dec,exercice)
-    VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12,
-            $13, $14, $15, $16, $17, $18, $19, $20, $21, $22, $23, $24, $25,
-            $26, $27, $28, $29, $30, $31, $32, to_date($33,'DD.MM.YYYY'), 
to_date($34,'DD.MM.YYYY'), $35,$36,
-            $37,$38,$39,$40,$41)
-             returning da_id;";
-      $this->da_id=$this->db->get_value($sql,
-                                    array($this->d00, /* 1 */
-                                          $this->d01, /* 2 */
-                                          $this->d02, /* 3 */
-                                          $this->d03, /* 4 */
-                                          $this->d44, /* 5 */
-                                          $this->d45, /* 6 */
-                                          $this->d46, /* 7 */
-                                          $this->d47, /* 8 */
-                                          $this->d48, /* 9 */
-                                          $this->d49, /* 10 */
-                                          $this->d81, /* 11 */
-                                          $this->d82, /* 12 */
-                                          $this->d83, /* 13 */
-                                          $this->d84, /* 14 */
-                                          $this->d85, /* 15 */
-                                          $this->d86, /* 16 */
-                                          $this->d87, /* 17 */
-                                          $this->d88, /* 18 */
-                                          $this->d54, /* 19 */
-                                          $this->d55, /* 20 */
-                                          $this->d56, /* 21 */
-                                          $this->d57, /* 22 */
-                                          $this->d61, /* 23 */
-                                          $this->d63, /* 24 */
-                                          $this->dxx, /* 25 */
-                                          $this->d59, /* 26 */
-                                          $this->d62, /* 27 */
-                                          $this->d64, /* 28 */
-                                          $this->dyy, /* 29 */
-                                          $this->d71, /* 30 */
-                                          $this->d72, /* 31 */
-                                          $this->d91, /* 32 */
-                                          $this->start_periode, /* 33 */
-                                          $this->end_periode, /* 34 */
-                                          $this->flag_periode, /* 35 */
-                                          $this->tva_name,     /* 36 */
-                                          $this->num_tva,      /* 37 */
-                                          $this->adress,       /* 38 */
-                                          $this->country,      /* 39 */
-                                          $this->periode_dec,  /* 40 */
-                                          $this->exercice,     /* 41 */
-
-                                          ));
-  }
-
-  public function update() {
-    if ( $this->verify() != 0 ) return;
-
-  }
-
-  public function load() {
-
-   $sql="select * from tva_belge.declaration_amount where da_id=$1";
-
-   $res=$this->db->get_array(
-                           $sql,
-                           array($this->da_id)
-                           );
-   if ( $this->db->count() == 0 ) return;
-   foreach ($res[0] as $idx=>$value) { $this->$idx=$value; }
-  }
-  public function delete() {
-/*    $sql="delete from tva_rate where tva_id=$1";
-    $res=$this->cn->exec_sql($sql,array($this->tva_id));
-*/
-  }
-
-  function verify() {
-    /**
-     address@hidden
-     * MY_NAME can not be empty
-     * MY_TVA contains BE and has 10 digits
-     * this->adress and $this->country can not be empty
-     */
-    return 0;
-  }
-
-  /**
-   address@hidden compute the amount
-   */
-  function compute() {
-    // check that this exercice exist
-    $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));
-    if ( $exist==0 ) { alert(_("Cette exercice comptable n'est pas dans ce 
dossier")); throw  new Exception('INVALYEAR',1 ) ;}
-
-    // set default value 0 for all
-    $keys=array_keys($this->variable);
-    for ($i = 0;$i < count($this->variable);$i++) {
-      $idx=$keys[$i];
-      $this->$idx=0;
-      if ( $idx=='d91') break;
-    }
-
-    $ctva=new Tva_Parameter($this->db);
-    /**
-     address@hidden on ne peut pas calculer de cette façon à cause des 
opérations qui comprennent plusieurs taux de tva diff.
-     *il faut aller chercher les montants dans les tables quant_*
-     */
-    $array=array('00','01','02','03','44','45','46','47','48','49');
-    for ($e=0;$e<count($array);$e++) {
-      // Compute frame 2
-      $oTva=new 
Tva_amount($this->db,'out',$this->start_periode,$this->end_periode);
-      $oTva->set_parameter('grid','GRIL'.$array[$e]);
-      $amount=$oTva->amount_operation();
-      $this->set_parameter('d'.$array[$e],$amount);
-    }
-
-    $array=array('81','82','83','84','85','86','87','88');
-    for ($e=0;$e<count($array);$e++) {
-      // Compute frame 3
-      $oTva=new 
Tva_amount($this->db,'in',$this->start_periode,$this->end_periode);
-      $oTva->set_parameter('grid','GRIL'.$array[$e]);
-      $amount=$oTva->amount_operation();
-      $this->set_parameter('d'.$array[$e],$amount);
-
-    }
-    //Frame IV
-    $array=array('54','55','56','57','61','63');
-    for ($e=0;$e<count($array);$e++) {
-      $oTva=new 
Tva_amount($this->db,'out',$this->start_periode,$this->end_periode);
-      $oTva->set_parameter('grid','GRIL'.$array[$e]);
-      $amount=$oTva->amount_vat();
-      $this->set_parameter('d'.$array[$e],$amount);
-
-    }
-
-
-    $array=array('59','62','64');
-    for ($e=0;$e<count($array);$e++) {
-      $oTva=new 
Tva_amount($this->db,'in',$this->start_periode,$this->end_periode);
-      $oTva->set_parameter('grid','GRIL'.$array[$e]);
-      $amount=$oTva->amount_vat();
-      $this->set_parameter('d'.$array[$e],$amount);
-
-    }
-    // for intracom, we compute a false VAT, have to paid it and deduce
-    $this->d55=round($this->d86*0.21+$this->d88*0.21,2);
-    $this->d59+=$this->d55;
-    /**
-     address@hidden
-     * GRIL56 - GRIL57 - GRIL61 - GRIL63
-     */
-
-    //GRILXX
-    $amount=$this->d54+$this->d55+$this->d56+$this->d57+$this->d61+$this->d63;
-    $this->set_parameter('dxx',$amount);
-
-
-    // GRILYY
-    $this->dyy=round($this->d59+$this->d62+$this->d64,2);
-
-
-    //Fram VI
-    if ( $this->dxx > $this->dyy ) $this->d71=$this->dxx-$this->dyy;
-    if ( $this->dxx < $this->dyy ) $this->d72=$this->dyy-$this->dxx;
-
-   }
-  /**
-   address@hidden get into the table quant_purchase or quant_sold the amount
-   * of VAT
-   address@hidden
-   address@hidden
-   address@hidden
-   address@hidden
-   */
-
-   function display_declaration_amount() {
-     $itext_00=new INum('val[]',$this->get_parameter('d00')); 
$str_00=$itext_00->input().HtmlInput::hidden('tvacode[]','d00');
-     $itext_01=new INum('val[]',$this->get_parameter('d01')); 
$str_01=$itext_01->input().HtmlInput::hidden('tvacode[]','d01');
-     $itext_02=new INum('val[]',$this->get_parameter('d02')); 
$str_02=$itext_02->input().HtmlInput::hidden('tvacode[]','d02');
-     $itext_03=new INum('val[]',$this->get_parameter('d03')); 
$str_03=$itext_03->input().HtmlInput::hidden('tvacode[]','d03');
-     $itext_44=new INum('val[]',$this->get_parameter('d44')); 
$str_44=$itext_44->input().HtmlInput::hidden('tvacode[]','d44');
-     $itext_45=new INum('val[]',$this->get_parameter('d45')); 
$str_45=$itext_45->input().HtmlInput::hidden('tvacode[]','d45');
-     $itext_46=new INum('val[]',$this->get_parameter('d46')); 
$str_46=$itext_46->input().HtmlInput::hidden('tvacode[]','d46');
-     $itext_47=new INum('val[]',$this->get_parameter('d47')); 
$str_47=$itext_47->input().HtmlInput::hidden('tvacode[]','d47');
-     $itext_48=new INum('val[]',$this->get_parameter('d48')); 
$str_48=$itext_48->input().HtmlInput::hidden('tvacode[]','d48');
-     $itext_49=new INum('val[]',$this->get_parameter('d49')); 
$str_49=$itext_49->input().HtmlInput::hidden('tvacode[]','d49');
-     $itext_81=new INum('val[]',$this->get_parameter('d81')); 
$str_81=$itext_81->input().HtmlInput::hidden('tvacode[]','d81');
-     $itext_82=new INum('val[]',$this->get_parameter('d82')); 
$str_82=$itext_82->input().HtmlInput::hidden('tvacode[]','d82');
-     $itext_83=new INum('val[]',$this->get_parameter('d83')); 
$str_83=$itext_83->input().HtmlInput::hidden('tvacode[]','d83');
-     $itext_84=new INum('val[]',$this->get_parameter('d84')); 
$str_84=$itext_84->input().HtmlInput::hidden('tvacode[]','d84');
-     $itext_85=new INum('val[]',$this->get_parameter('d85')); 
$str_85=$itext_85->input().HtmlInput::hidden('tvacode[]','d85');
-     $itext_86=new INum('val[]',$this->get_parameter('d86')); 
$str_86=$itext_86->input().HtmlInput::hidden('tvacode[]','d86');
-     $itext_87=new INum('val[]',$this->get_parameter('d87')); 
$str_87=$itext_87->input().HtmlInput::hidden('tvacode[]','d87');
-     $itext_88=new INum('val[]',$this->get_parameter('d88')); 
$str_88=$itext_88->input().HtmlInput::hidden('tvacode[]','d88');
-
-     $itext_54=new INum('val[]',$this->get_parameter('d54')); 
$str_54=$itext_54->input().HtmlInput::hidden('tvacode[]','d54');
-     $itext_55=new INum('val[]',$this->get_parameter('d55')); 
$str_55=$itext_55->input().HtmlInput::hidden('tvacode[]','d55');
-     $itext_56=new INum('val[]',$this->get_parameter('d56')); 
$str_56=$itext_56->input().HtmlInput::hidden('tvacode[]','d56');
-     $itext_57=new INum('val[]',$this->get_parameter('d57')); 
$str_57=$itext_57->input().HtmlInput::hidden('tvacode[]','d57');
-     $itext_63=new INum('val[]',$this->get_parameter('d63')); 
$str_63=$itext_63->input().HtmlInput::hidden('tvacode[]','d63');
-     $itext_61=new INum('val[]',$this->get_parameter('d61')); 
$str_61=$itext_61->input().HtmlInput::hidden('tvacode[]','d61');
-     $itext_xx=new INum('val[]',$this->get_parameter('dxx')); 
$str_xx=$itext_xx->input().HtmlInput::hidden('tvacode[]','dxx');
-     $itext_59=new INum('val[]',$this->get_parameter('d59')); 
$str_59=$itext_59->input().HtmlInput::hidden('tvacode[]','d59');
-     $itext_62=new INum('val[]',$this->get_parameter('d62')); 
$str_62=$itext_62->input().HtmlInput::hidden('tvacode[]','d62');
-     $itext_64=new INum('val[]',$this->get_parameter('d64')); 
$str_64=$itext_64->input().HtmlInput::hidden('tvacode[]','d64');
-     $itext_yy=new INum('val[]',$this->get_parameter('dyy')); 
$str_yy=$itext_yy->input().HtmlInput::hidden('tvacode[]','dyy');
-     $itext_71=new INum('val[]',$this->get_parameter('d71')); 
$str_71=$itext_71->input().HtmlInput::hidden('tvacode[]','d71');
-     $itext_72=new INum('val[]',$this->get_parameter('d72')); 
$str_72=$itext_72->input().HtmlInput::hidden('tvacode[]','d72');
-     $itext_91=new INum('val[]',$this->get_parameter('d91')); 
$str_91=$itext_91->input().HtmlInput::hidden('tvacode[]','d91');
-
-
-     ob_start();
-     require_once('form_decl.php');
-     $r=ob_get_contents();
-     ob_end_clean();
-     $r.=HtmlInput::hidden('periode_dec',$this->periode_dec);
-     return $r;
-
-   }
-   function menu() {
-     $r='';
-     $js_record=sprintf("onclick=\"record_writing('%s',%d,%d)\"",
-                       $_REQUEST['plugin_code'],
-                       dossier::id(),
-                       $this->da_id);
-    $js_remove=sprintf("onclick=\"if ( 
confirm('%s')){remove_form('%s',%d,%d,'da');}\"",
-                      "Vous confirmez vouloir effacer ?",
-                       $_REQUEST['plugin_code'],
-                       dossier::id(),
-                       $this->da_id);
-
-     $array=array (
-                  array("javascript:void(0)",_("Ecriture 
comptable"),_("Création de l'écriture comptable"),1,$js_record),
-                  array("javascript:void(0)",_("Générer fichier"),_("Création 
du fichier xml"),2),
-                  array("javascript:void(0)",_("Effacement 
déclaration"),_("Effacement déclaration"),3,$js_remove)
-                  );
-     $r.=ShowItem($array,'V',"mtitle","mtitle");
-     return $r;
-
-   }
-   function propose_form() {
-     $r='';
-     /* take all the vat code */
-     $array=$this->db->get_array("select tva_poste from tva_rate");
-
-     if ( empty($array)) return 'aucun compte pour la tva';
-
-        $str_tva="";$sep="";
-        for ($i=0;$i<count($array);$i++) {
-                $str_tva.=$sep.$array[$i]['tva_poste'];
-                $sep=',';
-        }
-
-        $array=explode(',',$str_tva);
-        $array=array_unique($array);
-
-     $max=count($array);
-     $periode=new Periode($this->db);
-     $per=$periode->limit_year($this->exercice);
-     $periode->p_id=$per['start'];
-
-     $first_day=$periode->first_day();
-     $idx=0;
-     $amount_vat=0;
-     $r.='<table class="result">';
-     for ( $i=0;$i<$max;$i++){
-       /* for each rate explode the accounting */
-      // list($deb,$cred)=explode(',',$array[$i]['tva_poste']);
-                $deb=$array[$i];
-       /* get saldo for DEBIT*/
-       $saldo=new Acc_Account_Ledger($this->db,$deb);
-
-       /* get label */
-       $lib=$this->db->get_value('select pcm_lib from tmp_pcmn where 
pcm_val=$1',array($deb));
-
-       $cond=sprintf(" j_date >=to_date('%s','DD.MM.YYYY') and j_date <= '%s'",
-                    $first_day,
-                    $this->end_date);
-
-       $result=$saldo->get_solde_detail($cond);
-       if ( $result['solde']==0) continue;
-
-       $account=new IText('account['.$idx.']');
-       $account->value=$deb;
-       $amount=new INum('amount['.$idx.']');
-       $amount->value=abs($result['solde']);
-
-       $ICheckBox=new ICheckBox('deb['.$idx.']');
-       if ( $result['debit'] < $result['credit'] ) {
-                        $amount_vat-=$result['solde'];  
$ICheckBox->selected=true;}
-       else {
-                       $amount_vat+=$result['solde'];   
$ICheckBox->selected=false;
-       }
-       $idx++;
-       /* display row */
-       
$r.=tr(td($account->input()).td($lib).td($amount->input()).td($ICheckBox->input()));
-
-     }
-     /* ATVA */
-     $atva=$this->db->get_value("select pcm_val  from tva_belge.parameter_chld 
where pcode='ATVA'");
-     if ( $atva != ''  ) {
-       /* get saldo */
-       $saldo=new Acc_Account_Ledger($this->db,$atva);
-       /* get label */
-       $lib=$this->db->get_value('select pcm_lib from tmp_pcmn where 
pcm_val=$1',array($atva));
-
-       $cond=sprintf(" j_date >=to_date('%s','DD.MM.YYYY') and j_date <= '%s'",
-                    $first_day,
-                    $this->end_date);
-       $result=$saldo->get_solde_detail($cond);
-       $ICheckBox=new ICheckBox('atva_ic');
-       $account=new IText('atva');
-       $account->value=$atva;
-       $amount=new INum('atva_amount');
-       $amount->value=abs($result['solde']);
-
-       if ( $result['debit'] < $result['credit'] ) {
-        $amount_vat-=$result['solde'];  $ICheckBox->selected=true;}
-       else {
-        $ICheckBox->selected=false;
-        $amount_vat+=$result['solde'];
-       }
-       /* display row */
-       if ( $result['solde'] != 0)       
$r.=tr(td($account->input()).td('Avance 
TVA').td($amount->input()).td($ICheckBox->input()));
-
-     }
-     /* creance sur tva*/
-     /* CRTVA */
-     $crtva=$this->db->get_value("select pcm_val  from 
tva_belge.parameter_chld where pcode='CRTVA'");
-     if ( $crtva != ''  ) {
-       /* get saldo */
-       $saldo=new Acc_Account_Ledger($this->db,$crtva);
-       /* get label */
-       $lib=$this->db->get_value('select pcm_lib from tmp_pcmn where 
pcm_val=$1',array($crtva));
-
-       $cond=sprintf(" j_date >=to_date('%s','DD.MM.YYYY') and j_date <= '%s'",
-                    $first_day,
-                    $this->end_date);
-       $result=$saldo->get_solde_detail($cond);
-       $ICheckBox=new ICheckBox('crtva_ic');
-       $account=new IText('crtva');
-       $account->value=$crtva;
-       $amount=new INum('crtva_amount');
-       $amount->value=abs($result['solde']);
-
-       if ( $result['debit'] > $result['credit']) {
-        $amount_vat+=$result['solde'];
-        $ICheckBox->selected=false;
-       } else {
-        $amount_vat-=$result['solde'];
-        $ICheckBox->selected=true;
-
-       }
-       /* display row */
-       if ( $result['solde'] != 0)  $r.=tr(td($account->input()).td('Créance 
compte TVA').td($amount->input()).td($ICheckBox->input()));
-
-     }
-     /* dette tva */
-     $dttva=$this->db->get_value("select pcm_val  from 
tva_belge.parameter_chld where pcode='DTTVA'");
-     if ( $dttva != ''  ) {
-       /* get saldo */
-       $saldo=new Acc_Account_Ledger($this->db,$dttva);
-       /* get label */
-       $lib=$this->db->get_value('select pcm_lib from tmp_pcmn where 
pcm_val=$1',array($dttva));
-
-       $cond=sprintf(" j_date >=to_date('%s','DD.MM.YYYY') and j_date <= '%s'",
-                    $first_day,
-                    $this->end_date);
-       $result=$saldo->get_solde_detail($cond);
-       $ICheckBox=new ICheckBox('dttva_ic');
-       $account=new IText('dttva');
-       $account->value=$dttva;
-       $amount=new INum('dttva_amount');
-       $amount->value=abs($result['solde']);
-
-       if ( $result['credit'] > $result['debit'] ) {
-        $amount_vat-=$result['solde'];
-        $ICheckBox->selected=true;
-       } else {
-        $ICheckBox->selected=false;
-        $amount_vat+=$result['solde'];
-       }
-       /* display row */
-       if ( $result['solde'] != 0)       
$r.=tr(td($account->input()).td('Dette Compte 
TVA').td($amount->input()).td($ICheckBox->input()));
-
-     }
-     /* if amount_vat > 0 then we have to pay */
-     if ( $amount_vat < 0 ) {
-       /* dette tva */
-       if ( $dttva != ''  ) {
-        /* get label */
-        $lib=$this->db->get_value('select pcm_lib from tmp_pcmn where 
pcm_val=$1',array($dttva));
-
-        $ICheckBox=new ICheckBox('solde_ic');
-        $ICheckBox->selected=false;
-        $account=new IText('solde');
-        $account->value=$dttva;
-        $amount=new INum('solde_amount');
-        $amount->value=abs($amount_vat);
-
-        /* display row */
-        $r.=tr(td($account->input()).td('Dette Compte 
TVA').td($amount->input()).td($ICheckBox->input()));
-       }
-     }else {
-       /* creance tva */
-       if ( $crtva != ''  ) {
-        /* get label */
-        $lib=$this->db->get_value('select pcm_lib from tmp_pcmn where 
pcm_val=$1',array($crtva));
-
-        $ICheckBox=new ICheckBox('solde_ic');
-        $ICheckBox->selected=true;
-        $account=new IText('solde');
-        $account->value=$crtva;
-        $amount=new INum('solde_amount');
-        $amount->value=abs($amount_vat);
-
-        /* display row */
-        $r.=tr(td($account->input()).td('Créance Compte 
TVA').td($amount->input()).td($ICheckBox->input()));
-       }
-
-     }
-     $r.='</table>';
-
-     return $r;
-   }
-   function display() {
-     $r= '<form class="print" id="readonly">';
-        $r.=HtmlInput::request_to_hidden(array('ac'));
-     $r.='<div 
style="position:absolute;top:150;right:0;width:200;right-margin:3%">';
-     $r.=$this->menu();
-     $r.='</div>';
-     $r.=$this->display_info();
-     $r.=$this->display_declaration_amount();
-     $r.='</form>';
-     $r.= create_script("$('readonly').disable();");
-     return $r;
-   }
-
-}

Deleted: tag/rel652/rapport_avance/class_ext_tvagen.php
===================================================================
--- tag/rel652/rapport_avance/class_ext_tvagen.php      2012-12-27 00:27:39 UTC 
(rev 455)
+++ tag/rel652/rapport_avance/class_ext_tvagen.php      2012-12-27 01:26:31 UTC 
(rev 456)
@@ -1,207 +0,0 @@
-<?php
-/*
- *   This file is part of PhpCompta.
- *
- *   PhpCompta is free software; you can redistribute it and/or modify
- *   it under the terms of the GNU General Public License as published by
- *   the Free Software Foundation; either version 2 of the License, or
- *   (at your option) any later version.
- *
- *   PhpCompta is distributed in the hope that it will be useful,
- *   but WITHOUT ANY WARRANTY; without even the implied warranty of
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *   GNU General Public License for more details.
- *
- *   You should have received a copy of the GNU General Public License
- *   along with PhpCompta; if not, write to the Free Software
- *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
-*/
-/* $Revision$ */
-
-// Copyright Author Dany De Bontridder address@hidden
-
-/*!\file
- * \brief
- */
-
-require_once('tva_constant.php');
-require_once('class_own.php');
-/**
- address@hidden transform a string into an arrau without empty element and  
duplicate
- * the array is sorted
- address@hidden $p_string string containing a comma a separator
- address@hidden array
- *
- */
-function get_array_nodup($p_string) {
-  $array=explode(',',$p_string);
-  sort($array);
-  $array=array_unique($array);
-  $result=array();
-  foreach ($array as $val) {
-    if ( $val == '') continue;
-    $result[]=$val;
-  }
-  $r=join(',',$result);
-  return $result;
-}
-
-class Ext_Tva_Gen
-{
-  function __construct($p_cn) {
-    $this->db=$p_cn;
-  }
-  public function get_parameter($p_string) {
-    if ( array_key_exists($p_string,$this->variable) ) {
-      $idx=$this->variable[$p_string];
-      return $this->$idx;
-    }
-    else
-      throw new Exception (__FILE__.":".__LINE__.'Erreur attribut inexistant');
-  }
-  public function set_parameter($p_string,$p_value) {
-    if ( array_key_exists($p_string,$this->variable) ) {
-      $idx=$this->variable[$p_string];
-      $this->$idx=$p_value;
-    }
-    else
-      throw new Exception (__FILE__.":".__LINE__.'Erreur attribut inexistant');
-
-
-  }
-  public function get_info() {    return var_export(self::$variable,true);  }
-
-  public function save() {
-  /* please adapt */
-    if (  $this->get_parameter("id") == 0 )
-      $this->insert();
-    else
-      $this->update();
-  }
-
-  static function choose_periode($by_year=false) {
-    require_once('class_iradio.php');
-    $monthly=new IRadio('periodic');
-    $monthly->value=1;
-
-    // month
-    $month=new ISelect('bymonth');
-    $array=array ();
-    for ($i=0;$i<12;$i++) {
-      $array[$i]['value']=$i+1; $array[$i]['label']=sprintf('%02d',($i+1));
-    }
-    $month->value=$array;
-    $monthly->selected=true;
-    $str_monthly=$monthly->input();
-    $str_month=$month->input();
-    // year
-    $year = new IText('year');
-    $year->size=4;
-    $str_year=$year->input();
-
-    // Tri
-    $quater=new ISelect('byquaterly');
-    $array=array();
-    for ($i=0;$i<4;$i++) {
-      $array[$i]['value']=$i+1; $array[$i]['label']=sprintf('%02d',($i+1));
-    }
-    $quater->value=$array;
-    $quaterly=new IRadio('periodic');
-    $quaterly->value=2;
-    $str_quaterly=$quaterly->input();
-    $str_quater=$quater->input();
-
-    $str_submit=HtmlInput::submit('decl',_('Afficher'));
-    $str_hidden=HtmlInput::extension().dossier::hidden();
-    if (isset($_REQUEST['sa']))
-      $str_hidden.=HtmlInput::hidden('sa',$_REQUEST['sa']);
-       $str_hidden.=HtmlInput::request_to_hidden(array('ac'));
-    $str_byyear='';
-    if ( $by_year == true ) {
-      $yearly=new IRadio('periodic');
-      $yearly->value=3;
-      $str_byyear=$yearly->input();
-    }
-    ob_start();
-    require_once('form_periode.php');
-    $r=ob_get_contents();
-    ob_end_clean();
-    return $r;
-  }
-
-  function blank($p_year,$p_periode,$p_flag_quaterly) {
-    // load parameter from myown
-    $own=new Own($this->db);
-    $this->set_parameter("name",$own->MY_NAME);
-    $this->set_parameter("num_tva",$own->MY_TVA);
-    $this->set_parameter('adress',$own->MY_STREET.",".$own->MY_NUMBER);
-    $this->set_parameter('country',$own->MY_COUNTRY." ".$own->MY_CP." 
".$own->MY_COMMUNE);
-    $this->set_parameter('flag_periode',$p_flag_quaterly);
-    $this->set_parameter('periode_dec',$p_periode);
-    $this->set_parameter('exercice',$p_year);
-
-    try {
-      $this->verify() ;
-    } catch ( Exception $e) {
-      echo $e->getMessage();
-      throw $e;
-    }
-    // by month
-    if ( $p_flag_quaterly == 1) {
-      // start periode = 01 to 31, $p_periode contains the month
-      $per_start="01.".$p_periode.".".$p_year;
-      $day=31;
-      $per_end="31".".".$p_periode.".".$p_year;
-      while ( checkdate($p_periode,$day,$p_year) == false && $day > 25) {
-       $day--;
-       $per_end=$day.".".$p_periode.".".$p_year;
-      }
-      if ($day < 28 ) { echo __FILE__.__LINE__." Erreur de date $day"; exit;}
-    }
-
-    if ( $p_flag_quaterly == 2 ) {
-      // compute start periode
-      $per_start=$GLOBALS['quaterly_limit'][$p_periode][0].".".$p_year;
-      $per_end=$GLOBALS['quaterly_limit'][$p_periode][1].".".$p_year;
-
-    }
-    if ( $p_flag_quaterly == 3 ) {
-      // compute start periode
-      $per_start='01.01.'.$p_year;
-      $per_end='31.12.'.$p_year;
-    }
-
-    $this->set_parameter('start_periode',$per_start);
-    $this->set_parameter('end_periode',$per_end);
-
-  }
-
-  /**
-   address@hidden display the information about the company
-   */
-  function display_info(){
-    $itva=new IText('num_tva',$this->num_tva);$str_tva=$itva->input();
-    $iname=new IText('name',$this->tva_name); $str_name=$iname->input();
-    $iadress=new IText('adress',$this->adress);$str_adress=$iadress->input();
-    $icountry=new 
IText('country',$this->country);$str_country=$icountry->input();
-
-    /* date */
-
-    if (isset($this->date_decl)) { $idate=new 
IText('date',format_date($this->date_decl));$str_date=$idate->input();}
-
-    /* periode */
-
-    if ( isset($this->start_date) ){
-      $str_start=format_date($this->start_date);
-      $str_end=format_date($this->end_date);
-
-    }
-    $ianne=$this->exercice;
-    ob_start();
-    require_once('form_decl_info.php');
-    $r=ob_get_contents();
-    ob_end_clean();
-    return $r;
-  }
-
-}

Deleted: tag/rel652/rapport_avance/class_listing.php
===================================================================
--- tag/rel652/rapport_avance/class_listing.php 2012-12-27 00:27:39 UTC (rev 
455)
+++ tag/rel652/rapport_avance/class_listing.php 2012-12-27 01:26:31 UTC (rev 
456)
@@ -1,40 +0,0 @@
-<?php
-  /*
-   *   This file is part of PhpCompta.
-   *
-   *   PhpCompta is free software; you can redistribute it and/or modify
-   *   it under the terms of the GNU General Public License as published by
-   *   the Free Software Foundation; either version 2 of the License, or
-   *   (at your option) any later version.
-   *
-   *   PhpCompta is distributed in the hope that it will be useful,
-   *   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-   *   GNU General Public License for more details.
-   *
-   *   You should have received a copy of the GNU General Public License
-   *   along with PhpCompta; if not, write to the Free Software
-   *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  
USA
-   */
-  /* $Revision$ */
-
-  // Copyright Author Dany De Bontridder address@hidden
-
-  /*!\file
-   * \brief
-   */
-require_once('class_ext_tvagen.php');
-require_once('class_acc_parm_code.php');
-class Listing extends Ext_Tva_Gen {
-  function find_tva_code($p_array)
-       {
-               $array=$this->db->make_list("
-                       select distinct tva_id  from tva_belge.parameter_chld
-                       where
-                       pcode=$1",
-                               array($p_array));
-
-               return $array;
-       }
-
-}
\ No newline at end of file

Deleted: tag/rel652/rapport_avance/class_tva_amount.php
===================================================================
--- tag/rel652/rapport_avance/class_tva_amount.php      2012-12-27 00:27:39 UTC 
(rev 455)
+++ tag/rel652/rapport_avance/class_tva_amount.php      2012-12-27 01:26:31 UTC 
(rev 456)
@@ -1,204 +0,0 @@
-<?php
-/*
- *   This file is part of PhpCompta.
- *
- *   PhpCompta is free software; you can redistribute it and/or modify
- *   it under the terms of the GNU General Public License as published by
- *   the Free Software Foundation; either version 2 of the License, or
- *   (at your option) any later version.
- *
- *   PhpCompta is distributed in the hope that it will be useful,
- *   but WITHOUT ANY WARRANTY; without even the implied warranty of
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *   GNU General Public License for more details.
- *
- *   You should have received a copy of the GNU General Public License
- *   along with PhpCompta; if not, write to the Free Software
- *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
-*/
-/* $Revision$ */
-
-// Copyright Author Dany De Bontridder address@hidden
-
-/*!\file
- * \brief
- */
-
-
-/*!\brief
- *
- *
- */
-class Tva_Amount
-{
-
-  private static $variable=array('amount'=>'amount',
-                                'amount_tva'=>'amount_tva',
-                                'param'=>'param',
-                                'dir'=>'dir',
-                                'start_periode'=>'start_periode',
-                                'end_periode'=>'end_periode',
-                                'grid'=>'grid'
-                                );
-  function __construct ($p_init,$p_dir,$p_start_periode,$p_end_periode) {
-    $this->db=$p_init;
-    $this->start_periode=$p_start_periode;
-    $this->end_periode=$p_end_periode;
-    $this->dir=$p_dir;
-  }
-  public function get_parameter($p_string) {
-    if ( array_key_exists($p_string,self::$variable) ) {
-      $idx=self::$variable[$p_string];
-      return $this->$idx;
-    }
-    else
-      exit (__FILE__.":".__LINE__.'Erreur attribut inexistant');
-  }
-  public function set_parameter($p_string,$p_value) {
-    if ( array_key_exists($p_string,self::$variable) ) {
-      $idx=self::$variable[$p_string];
-      $this->$idx=$p_value;
-    }
-    else
-      exit (__FILE__.":".__LINE__.'Erreur attribut inexistant');
-
-
-  }
-  public function get_info() {    return var_export(self::$variable,true);  }
-  public function verify() {
-    // Verify that the elt we want to add is correct
-  }
-  /**
-   address@hidden load parameters and set param to a array of value from 
parameter_chld
-   */
-  public function load_parameter() {
-    //  get the vat code
-     $ctva=$this->db->get_array("select tva_id,pcm_val from 
tva_belge.parameter_chld where pcode=$1",array($this->grid));
-     if ( count($ctva)== 0 ) {
-       $this->param=null;
-     }
-     $this->param=$ctva;
-  }
-  /**
-   address@hidden get the amount of vat thanks its code
-   address@hidden $p_gril is the gril code
-   address@hidden $p_dir is out or in in for the table quant_purchase and
-   * out for the table quant_sold
-   address@hidden a number
-   */
-  function amount_operation() {
-    // get the VAT code
-    $this->load_parameter();
-    $result=0;
-       bcscale(4);
-       for ($i=0;$i<count($this->param);$i++)
-       {
-               
$tmp_calc=$this->get_amount_filter($this->param[$i]['tva_id'],$this->param[$i]['pcm_val']);
-               $result=bcadd($result,$tmp_calc);
-
-       }
-    return round($result,2);
-
-
-  }
-  function amount_vat() {
-    // get the VAT code
-   $this->load_parameter();
-    $result=0;
-       bcscale(4);
-       for ($i=0;$i<count($this->param);$i++)
-       {
-               
$tmp_calc=$this->get_vat_filter($this->param[$i]['tva_id'],$this->param[$i]['pcm_val']);
-               $result=bcadd($result,$tmp_calc);
-
-       }
-    return round($result,2);
-
-
-  }
-
-  /**
-   address@hidden get the amount of operation from the table quant_sold or 
quant_purchase
-   address@hidden amount
-   */
-  private function get_amount_filter($p_code,$p_account) {
-    if ( $this->dir == 'out' && trim($p_account) !='' && trim($p_code) !='' ) {
-      $sql="select coalesce(sum(qs_price),0) as amount from quant_sold
-                 join jrnx using (j_id)
-           where qs_vat_code=$1 and  (j_date >= to_date($2,'DD.MM.YYYY') and 
j_date <= to_date($3,'DD.MM.YYYY'))
-           and j_poste::text like ($4)";
-      $res=$this->db->get_array($sql,array($p_code,
-                                          $this->start_periode,
-                                          $this->end_periode,
-                                          $p_account));
-      return $res[0]['amount'];
-    }
-
-    if ( $this->dir == 'in' && trim($p_account) !='' && trim($p_code) !='' ) {
-      $sql="select coalesce(sum(qp_price),0) as amount from quant_purchase 
join jrnx using (j_id)
-           where qp_vat_code=$1 and  (j_date >= to_date($2,'DD.MM.YYYY') and 
j_date <= to_date($3,'DD.MM.YYYY'))
-           and j_poste::text like ($4)";
-      $res=$this->db->get_array($sql,array($p_code,
-                                          $this->start_periode,
-                                          $this->end_periode,
-                                          $p_account));
-      return $res[0]['amount'];
-    }
-
-
-    return 0;
-  }
-
-  /**
-   address@hidden get the amount of VAT from the table quant_sold or 
quant_purchase
-   address@hidden amount
-   */
-  private function get_vat_filter($p_code,$p_account) {
-    if ( $this->dir == 'out' && trim($p_account) !='' && trim($p_code) !='' ) {
-      $sql="select coalesce(sum(qs_vat),0) as amount from quant_sold join jrnx 
using (j_id)
-           where qs_vat_code=$1 and  (j_date >= to_date($2,'DD.MM.YYYY') and 
j_date <= to_date($3,'DD.MM.YYYY'))
-           and j_poste::text like ($4)";
-      $res=$this->db->get_array($sql,array($p_code,
-                                          $this->start_periode,
-                                          $this->end_periode,
-                                          $p_account));
-      return $res[0]['amount'];
-    }
-
-    if ( $this->dir == 'in' && trim($p_account) !='' && trim($p_code) !='' ) {
-      $sql="select coalesce(sum(qp_vat),0) as amount from quant_purchase join 
jrnx using (j_id)
-           where qp_vat_code=$1 and  (j_date >= to_date($2,'DD.MM.YYYY') and 
j_date <= to_date($3,'DD.MM.YYYY'))
-           and j_poste::text like ($4)";
-      $res=$this->db->get_array($sql,array($p_code,
-                                          $this->start_periode,
-                                          $this->end_periode,
-                                          $p_account));
-      return $res[0]['amount'];
-    }
-
-
-    return 0;
-  }
-
-/**
- address@hidden
- * record into the ledger the operation for purging the
- * the vat accouting
- */
-function record_ledger() {
-
-}
-
-  /*!\brief
-   *\param
-   *\return
-   *\note
-   *\see
-   *\todo
-   */
-  static function test_me() {
-  }
-
-}
-
-/* test::test_me(); */

Deleted: tag/rel652/rapport_avance/class_tva_parameter.php
===================================================================
--- tag/rel652/rapport_avance/class_tva_parameter.php   2012-12-27 00:27:39 UTC 
(rev 455)
+++ tag/rel652/rapport_avance/class_tva_parameter.php   2012-12-27 01:26:31 UTC 
(rev 456)
@@ -1,146 +0,0 @@
-<?php
-/*
- *   This file is part of PhpCompta.
- *
- *   PhpCompta is free software; you can redistribute it and/or modify
- *   it under the terms of the GNU General Public License as published by
- *   the Free Software Foundation; either version 2 of the License, or
- *   (at your option) any later version.
- *
- *   PhpCompta is distributed in the hope that it will be useful,
- *   but WITHOUT ANY WARRANTY; without even the implied warranty of
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *   GNU General Public License for more details.
- *
- *   You should have received a copy of the GNU General Public License
- *   along with PhpCompta; if not, write to the Free Software
- *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
-*/
-/* $Revision$ */
-
-// Copyright Author Dany De Bontridder address@hidden
-
-/*!\file
- * \brief
- */
-
-
-/*!\brief
- *
- *
- */
-class  Tva_Parameter
-{
-  private static 
$variable=array("code"=>"pcode","value"=>"pvalue","account"=>'paccount');
-  function __construct ($p_init) {
-    $this->cn=$p_init;
-  }
-  public function get_parameter($p_string) {
-    if ( array_key_exists($p_string,self::$variable) ) {
-      $idx=self::$variable[$p_string];
-      return $this->$idx;
-    }
-    else
-      exit (__FILE__.":".__LINE__.$p_string.' Erreur attribut inexistant');
-  }
-  public function set_parameter($p_string,$p_value) {
-    if ( array_key_exists($p_string,self::$variable) ) {
-      $idx=self::$variable[$p_string];
-      $this->$idx=$p_value;
-    }
-    else
-      exit (__FILE__.":".__LINE__.$p_string.' Erreur attribut inexistant');
-
-
-  }
-  public function get_info() {    return var_export(self::$variable,true);  }
-  public function verify() {
-    // Verify that the elt we want to add is correct
-  }
-  /**
-   address@hidden retrieve * row thanks a condition
-   */
-   public function seek($cond,$p_array=null)
-   {
-   /*
-     $sql="select * from * where $cond";
-     return $this->cn->get_array($cond,$p_array)
-  */
-   }
-  public function insert() {
-    if ( $this->verify() != 0 ) return;
-
-    $sql="insert into tva_belge.parameter (pcode,pvalue,paccount) ".
-      " values ($1,$2) ";
-    $this->tva_id=$this->cn->exec_sql(
-                                      $sql,
-                                      array($this->pcode,
-                                            $this->pvalue,
-                                            $this->paccount)
-                                      );
-
-  }
-
-  public function update() {
-    if ( $this->verify() != 0 ) return;
-
-    $sql="update tva_belge.parameter  set pvalue=$1,paccount=$2 ".
-      " where pcode = $3";
-    $res=$this->cn->exec_sql(
-                $sql,
-                array($this->pvalue,
-                      $this->paccount,
-                      $this->pcode)
-                );
-
-  }
-
-  public function load() {
-
-   $sql="select pcode from tva_belge.parameter where pcode=$1";
-
-    $res=$this->cn->get_array(
-                $sql,
-                array($this->pcode)
-                );
-
-    if ( count($res) == 0 ) return -1;
-    for ($i=0;$i<count($res);$i++) { 
$this->pcode=$res[$i]['pcode'];$this->pvalue=$res[$i]['pvalue'];$this->paccount=$res[$i]['paccount'];
 }
-    return 0;
-  }
-  /**
-   address@hidden check that this accounting does exist in the accounting plan
-   address@hidden $p_code code to check
-   address@hidden the number of row found (0 if none)
-   */
-  public function exist_pcmn($p_code) {
-    $count=$this->cn->get_value('select count(*) from tmp_pcmn where 
pcm_val::text like $1',array($p_code));
-    return $count;
-  }
-  /**
-   address@hidden show the content of the table tva_belge.parameter
-   */
-  public function display() {
-        global $cn;$cn=$this->cn;
-
-       $res=$this->cn->get_array("select pcode from tva_belge.parameter");
-
-    ob_start();
-    require_once('form_parameter.php');
-    $r=ob_get_contents();
-    ob_end_clean();
-    return $r;
-  }
-  /*!\brief
-   *\param
-   *\return
-   *\note
-   *\see
-   *\todo
-   */
-  static function test_me() {
-  }
-
-}
-
-/* test::test_me(); */

Deleted: tag/rel652/rapport_avance/decl_tva.inc.php
===================================================================
--- tag/rel652/rapport_avance/decl_tva.inc.php  2012-12-27 00:27:39 UTC (rev 
455)
+++ tag/rel652/rapport_avance/decl_tva.inc.php  2012-12-27 01:26:31 UTC (rev 
456)
@@ -1,111 +0,0 @@
-<?php
-/*
- *   This file is part of PhpCompta.
- *
- *   PhpCompta is free software; you can redistribute it and/or modify
- *   it under the terms of the GNU General Public License as published by
- *   the Free Software Foundation; either version 2 of the License, or
- *   (at your option) any later version.
- *
- *   PhpCompta is distributed in the hope that it will be useful,
- *   but WITHOUT ANY WARRANTY; without even the implied warranty of
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *   GNU General Public License for more details.
- *
- *   You should have received a copy of the GNU General Public License
- *   along with PhpCompta; if not, write to the Free Software
- *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
-*/
-/* $Revision$ */
-
-// Copyright Author Dany De Bontridder address@hidden
-
-/*!\file
- * \brief this file is included to create a  new VAT declaration
- * 
- */
-require_once('class_ext_tva.php');
-echo '<div class="content" style="width:80%;margin-left:10%">';
-
-// verify the year
-if ( isset($_REQUEST['year']) && (trim(strlen($_REQUEST['year'])) < 4 || 
isNumber($_REQUEST['year'] ) == 0 ||$_REQUEST['year'] < 
2000||$_REQUEST['year']>2100)) {
-  alert(j(_('Année invalide'.' ['.$_REQUEST['year'].']')));
-  echo Ext_Tva::choose_periode();
-  echo '</div>';
-  exit;
-}
-
-  // if the periode is not set we have to ask it
-if ( ! isset($_REQUEST['decl']) ){
-  echo Ext_Tva::choose_periode();
-  echo '</div>';
-  exit;
-}
-$cn=new Database(Dossier::id());
-if (isset($_POST['save'] )) {
-  $save=new Ext_Tva($cn);
-  $save->from_array($_POST);
-  $save->insert();
-  echo h2info(_('Déclaration sauvée'));
-  echo $save->display();
-  /**
-   address@hidden add a div for the button generate, get_xml, create ODS, 
print...
-   */
-//   echo '<div style="position:absolute;z-index:14;top:25%;right:30" 
class="noprint">aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa</div>';
-  echo '</div>';
-  exit;
-}
-
-$tva=new Ext_Tva($cn);
-
-/* by month */
-if ( $_REQUEST['periodic']==1) {
-  $str_monthly='';
-  
$str_month=$_GET['bymonth'];$str_year=$_GET['year'];$str_quaterly="";$str_hidden='';$str_submit='';$str_quater='-';
-  $tva->blank($_REQUEST['year'],$_GET['bymonth'],1);
-
-}
-
-/* by quater */
-if ($_REQUEST['periodic'] == 2) {
-  $str_quaterly='';
-  $str_month="-";
-  $str_year=$_GET['year'];
-  $str_quater=$_REQUEST['byquaterly'];
-  $str_hidden='';$str_submit='';$str_monthly='';
-  $tva->blank($_REQUEST['year'],$_GET['byquaterly'],2);
-}
-try {
-  $r=$tva->compute();
-} catch (Exception $e) {
-
-  echo '<div class="content" style="width:80%;margin-left:10%">';
-  echo Ext_Tva::choose_periode();
-  echo '</div>';
-  exit();
-  }
-require_once('form_periode.php');
-echo '<form class="print" method="post">';
-echo dossier::hidden();
-echo HtmlInput::extension();
-echo HtmlInput::hidden('start_periode',$tva->start_periode);
-echo HtmlInput::hidden('end_periode',$tva->end_periode);
-echo HtmlInput::hidden('flag_periode',$tva->flag_periode);
-echo HtmlInput::hidden('name',$tva->tva_name);
-echo HtmlInput::hidden('num_tva',$tva->num_tva);
-echo HtmlInput::hidden('adress',$tva->adress);
-echo HtmlInput::hidden('country',$tva->country);
-echo HtmlInput::hidden('exercice',$tva->exercice);
-
-
-
-echo $tva->display_info();
-echo $r;
-echo $tva->display_declaration_amount();
-echo HtmlInput::submit('save',_('Sauvegarde'));
-echo '</form>';
-echo '</div>';
-  // create the XML files and the OD operation, validate it to save it into 
the vat history
-
-
-?>

Deleted: tag/rel652/rapport_avance/form_decl.php
===================================================================
--- tag/rel652/rapport_avance/form_decl.php     2012-12-27 00:27:39 UTC (rev 
455)
+++ tag/rel652/rapport_avance/form_decl.php     2012-12-27 01:26:31 UTC (rev 
456)
@@ -1,237 +0,0 @@
-<style type="text/css">
-   h1 {
- color : blue;
- font-size:120%;
- }
-   table tr {
-     font-size:12px;
-   }
-</style>
-<h1>Cadre II : Opérations à la sortie </h1>
-<table>
-<tr>
-<td>
-A. Opérations soumises à un régime particulier [00]
-</td>
-<td>
-<?=$str_00;?>
-</td>
-</tr><tr>
-<td>
- B. Opérations pour lesquelles la T.V.A. est due par le déclarant :</td></td>
- </tr><tr>
- <td>&nbsp;&nbsp;&nbsp;&nbsp;- au taux de 6% [01]</td>
-<td>
-<?=$str_01;?>
-</td>
- </tr><tr><td>&nbsp;&nbsp;&nbsp;&nbsp;- au taux de 12% [02]</td>
-<td>
-<?=$str_02;?>
-</td>
- </tr><tr><td>&nbsp;&nbsp;&nbsp;&nbsp;- au taux de 21% [03] </td>
-<td>
-<?=$str_03;?>
-</td>
-</tr><tr>
-<td>
-C. Services pour lesquels la T.V.A. étrangère est due par le cocontractant [44]
-</td>
-<td>
-<?=$str_44;?>
-</td>
-</tr><tr>
-<td>
-D. Opérations pour lesquelles la T.V.A. est due par le cocontractant [45]
-</td>
-<td>
-<?=$str_45;?>
-</td>
-</tr><tr>
-<td>
-E. Livraisons intracommunautaires exemptées effectuées en Belgique et ventes 
ABC [46]
-</td>
-<td>
-<?=$str_46;?>
-</td>
-</tr><tr>
-<td>
- F. Autres opérations exemptées et autres opérations effectuées à l'étranger 
[47]
-</td>
-<td>
-<?=$str_47;?>
-</td>
-</tr><tr>
-<td>
-G. Montant des notes de crédit délivrées et des corrections négatives : </td>
- </tr><tr>
- <td>&nbsp;&nbsp;&nbsp;&nbsp;- relatif aux opérations inscrites en grilles 44 
et 46 [48] </td>
-<td>
-<?=$str_48;?>
-</td>
-
- </tr><tr>
- <td>&nbsp;&nbsp;&nbsp;&nbsp;- relatif aux autres opérations du cadre II 
[49]</td>
-<td>
-<?=$str_49;?>
-</td>
-
- </tr><tr>
- </table>
-
-<h1>Cadre III : Opérations à l'entrée</h1>
-<table>
-<tr>
-<td>A. Montant des opérations à l'entrée compte tenu des notes de crédit 
reçues et autres corrections : </td>
-</tr>
-<tr>
-<td>&nbsp;&nbsp;&nbsp;&nbsp;- marchandises, matières premières et matières 
auxiliaires [81] </td>
-<td>
-<?=$str_81;?>
-</td>
-</tr>
-<tr>
-<td>&nbsp;&nbsp;&nbsp;&nbsp;- services et biens divers [82]  </td>
-<td>
-<?=$str_82;?>
-</td>
-</tr>
-<tr>
-<td>&nbsp;&nbsp;&nbsp;&nbsp;- biens d'investissement [83]  </td>
-<td>
-<?=$str_83;?>
-</td>
-</tr>
-<tr>
-<td>B. Montant des notes de crédit reçues et des corrections négatives : </td>
-</tr>
-<tr>
-<td>&nbsp;&nbsp;&nbsp;&nbsp;- relatif aux opérations inscrites en grilles 86 
et 88 [84]  </td>
-<td>
-<?=$str_84;?>
-</td>
-</tr>
-<tr>
-<td>&nbsp;&nbsp;&nbsp;&nbsp;- relatif aux autres opérations du cadre III [85]  
</td>
-<td>
-<?=$str_85;?>
-</td>
-</tr>
-<tr>
-<td>C. Acquisitions intracommunautaires effectuées en Belgique et ventes ABC 
[86] </td>
-<td>
-<?=$str_86;?>
-</td>
-</tr>
-<tr>
-<td>
-D. Autres opérations à l'entrée pour lesquelles la T.V.A. est due par le 
déclarant [87] </td>
-<td><?=$str_87?></td>
-</tr><tr>
-<td> E. Services intracommunautaires avec report de perception [88]</td>
-<td>
-<?=$str_88?>
-</td>
-</table>
-
-<h1>Cadre IV : Taxe due</h1>
-<table>
-<tr><TD> A. T.V.A. relative aux opérations déclarées en : </td>
-</tr>
-<tr>
-<tr><td>&nbsp;&nbsp;&nbsp;&nbsp;-grilles 01, 02 et 03 [54]</td>
-<td>
-<?=$str_54;?>
-</td>
-</tr>
-<td>&nbsp;&nbsp;&nbsp;&nbsp;- grilles 86 et 88 [55] </td>
-<td>
-<?=$str_55;?>
-</td>
-</tr>
-<tr>
-<tr>
-<td>&nbsp;&nbsp;&nbsp;&nbsp;- grille 87, à l'exception des importations avec 
report de perception [56] </td>
-<td><?=$str_56;?></td>
-</tr>
-<tr>
-<td>
-B. T.V.A. relative aux importations avec report de perception [57] </td>
-<td><?=$str_57;?></td>
-</tr>
-<tr>
-<td>
-
-C. Diverses régularisations T.V.A. en faveur de l'Etat [61]</td>
-<td><?=$str_61?></td>
-</tr>
-<tr>
-<td>
-D. T.V.A. à reverser mentionnée sur les notes de crédit reçues [63]
-</td>
-<td><?=$str_63;?></td>
-</tr>
-<tr>
-<td>
-Total des grilles 54, 55, 56, 57, 61 et 63 [XX]
-</td>
-<td>
-<?=$str_xx;?>
-</td>
-</tr>
-</table>
-<h1>Cadre V : Taxes déductibles, solde et acompte</h1>
-<table>
-<tr>
-<td>
-A.T.V.A. déductible  [59]
-</td>
-<td>
-<?=$str_59;?>
-</td>
-</tr>
-<tr>
-<td>B.Diverses régularisations T.V.A. en faveur du déclarant  [62]
-</td>
-<td>
-<?=$str_62;?>
-</td>
-</tr>
-<tr>
-<td>C.T.V.A. à récupérer mentionnée sur les notes de crédit délivrées [64]
-</td>
-<td>
-<?=$str_64;?>
-</td>
-</tr>
-<tr>
-<td>
-Total des grilles 59, 62 et 64[yy]
-</td>
-<td><?=$str_yy;?></td>
-</tr>
-</table>
-
-<h1>Cadre VI : Solde*</h1>
-<table>
-<tr>
-<td>Taxe due à l'Etat : grille xx - grille yy [71]</td>
-<td><?=$str_71;?></td>
-</tr>
-<tr>
-<td>Sommes dues par l'Etat : grille yy - grille xx [72]</td>
-<td><?=$str_72;?></td>
-</tr>
-</table>
-<span class="notice">*Une seule des grilles 71 ou 72 peut être remplie </span>
-
-<h1>Cadre VII : Acompte*</h1>
-<table>
-<tr>
-<td>
-T.V.A. réellement due pour la période du 1er au 20 décembre[91]
-</td>
-<td><?=$str_91;?></td>
-</tr>
-</table>
-<span class="notice">*Concerne uniquement la déclaration mensuelle de 
décembre</span>
-

Deleted: tag/rel652/rapport_avance/form_decl_info.php
===================================================================
--- tag/rel652/rapport_avance/form_decl_info.php        2012-12-27 00:27:39 UTC 
(rev 455)
+++ tag/rel652/rapport_avance/form_decl_info.php        2012-12-27 01:26:31 UTC 
(rev 456)
@@ -1,31 +0,0 @@
-<h1>Cadre I : renseignements généraux</h1>
-
-<table>
-<tr>
-<td>Année</td><td> <?=$ianne?></td>
-</tr>
-<?if (isset ($str_date)) :?>
-<tr>
-<td>Date </td><td><?=$str_date?></td>
-</tr>
-<tr>
-<td>Période début </td><td><?=$str_start?></td>
-</tr>
-<tr>
-<td>Période fin </td><td><?=$str_end?></td>
-</tr>
-<?
-endif;
-?>
-<td>N° de tva </td>
-<td><?=$str_tva?></td>
-</tr><tr>
-<td>Nom</td><td><?=$str_name?></td>
-</tr><tr>
-<td>Adresse</td><td><?=$str_adress?></td>
-</tr><tr>
-<td>Pays code postal et localite BE</td><td><?=$str_country?></td>
-</tr>
-</tr>
-
-</table>

Deleted: tag/rel652/rapport_avance/form_parameter.php
===================================================================
--- tag/rel652/rapport_avance/form_parameter.php        2012-12-27 00:27:39 UTC 
(rev 455)
+++ tag/rel652/rapport_avance/form_parameter.php        2012-12-27 01:26:31 UTC 
(rev 456)
@@ -1,195 +0,0 @@
-<?php
-global $tab;
-function show($p_code,$p_desc) {
-       global $cn,$tab;
-       echo "<h2>".h($p_code)." ".$p_desc."</h2>";
-       $plugin_code=$_REQUEST['plugin_code'];
-       $dossier=Dossier::id();
-       $a_code=$cn->get_array("
-                       select pi_id, pc.tva_id,tva_label,tva_comment,tva_rate, 
pcm_val
-                       from tva_belge.parameter_chld as pc
-                       left join tva_rate as tv on (pc.tva_id=tv.tva_id)
-                       where pcode=$1 order by pi_id",
-                       array($p_code));
-       if (sizeof($a_code) == 0) {
-               echo '<span class="notice" style="display:block">Aucun 
paramètre donné </span>';
-
-               echo HtmlInput::button("add_param","Ajout 
paramètre","onclick=\"show_addparam('$p_code','$plugin_code','$dossier','$tab');\"");
-               return;
-       }
-       $n_max=sizeof($a_code);
-       echo "<table class=\"result\">";
-       echo "<tr>";
-       echo th("Code TVA");
-       echo th("Label");
-       echo th("Description");
-       echo th("Taux");
-       echo th("utilisant le poste comptable");
-       echo "</tr>";
-       for ($i=0;$i<$n_max;$i++)
-       {
-               echo "<tr>";
-               echo td($a_code[$i]['tva_id']);
-               echo td($a_code[$i]['tva_label']);
-               echo td($a_code[$i]['tva_comment']);
-               echo td($a_code[$i]['tva_rate']);
-               echo td("Poste comptable :".$a_code[$i]['pcm_val']);
-               echo '<td>';
-               echo '<form id="f'.$a_code[$i]['pi_id'].'" method="POST">';
-               echo HtmlInput::hidden("pi_id",$a_code[$i]['pi_id']);
-               echo HtmlInput::hidden("tab",$tab);
-               echo HtmlInput::anchor("Effacer","","onclick=\"if ( 
confirm('Vous confirmez?')) { $('f".$a_code[$i]['pi_id']."').submit(this);} 
else {return false;}\"");
-               echo "</form>";
-               echo '</td>';
-               echo "</tr>";
-       }
-       echo "</table>";
-       echo HtmlInput::button("add_param","Ajout 
paramètre","onclick=\"show_addparam('$p_code','$plugin_code','$dossier','$tab');\"");
-}
-?>
-<?
-       $tab_default=(isset ($_REQUEST['tab']))?$_REQUEST['tab']:'opout';
-?>
-<a href="javascript:void(0)" class="line" 
onclick="tva_show_param('opout')">Opération à la sortie</a>&nbsp;
-<a href="javascript:void(0)" class="line" style="" 
onclick="tva_show_param('opin')">Opération à l'entrée </a>&nbsp;
-<a href="javascript:void(0)" class="line" 
onclick="tva_show_param('tvadue')">TVA Due</a>&nbsp;
-<a href="javascript:void(0)" class="line" 
onclick="tva_show_param('tvaded')">TVA Déductible</a>&nbsp;
-<a href="javascript:void(0)" class="line" 
onclick="tva_show_param('lintra')">Listing Client Intracomm.</a>&nbsp;
-<a href="javascript:void(0)" class="line" 
onclick="tva_show_param('assujetti')">Listing Client assujetti.</a>&nbsp;
-<a href="javascript:void(0)" class="line" 
onclick="tva_show_param('divers')">Divers</a>
-<form method="POST">
-       <?
-       echo HtmlInput::hidden('tab',$tab_default);
-       echo 
HtmlInput::request_to_hidden(array('gDossier','ac','plugin_code','sa'));
-       ?>
-<div style="display:none" id="opout">
-<h1><?=_("Opération à la sortie");?></h1>
-<? $tab="opout";?>
-<?=show("GRIL00",_("Grille 00 : opérations soumises à un régime 
particulier"))?>
-<?=show("GRIL01",_("Grille 01 : Opérations pour lesquelles la TVA est due 
(6%)"))?>
-<?=show("GRIL02",_("Grille 02 : Opérations pour lesquelles la TVA est due 
(12%)"))?>
-<?=show("GRIL03",_("Grille 03 : Opérations pour lesquelles la TVA est due 
(21%)"))?>
-<?=show("GRIL44",_("Grille 44 : Opérations pour lesquelles la TVA étrangère 
est due par le cocontractant"))?>
-<?=show("GRIL45",_("Grille 45 : Opérations pour lesquelles la TVA est due par 
le cocontractant"))?>
-<?=show("GRIL46",_("Grille 46 : Livraisons intracommunautaires exemptées 
effectuées en Belgique et ventes ABC"))?>
-<?=show("GRIL47",_("Grille 47 :Autres opérations exemptées et autres 
opérations effectuées à l’étranger"))?>
-<?=show("GRIL48",_("Grille 48 : Opérations relatives aux notes de crédit des 
grilles 44 et 48"))?>
-<?=show("GRIL49",_("Grille 49 : Opérations relatives aux notes de crédit"))?>
-</div>
-<div style="display:none" id="opin">
-       <? $tab="opin";?>
-<h1><?=_("Opération à l'entrée");?></h1>
-<?=show("GRIL81",_("Grille 81 : Opération sur les marchandises, matières 
premières..."))?>
-<?=show("GRIL82",_("Grille 82 : Opération sur les services et biens divers"))?>
-<?=show("GRIL83",_("Grille 83 : Opération sur les biens d'investissements"))?>
-<?=show("GRIL84",_("Grille 84 : Montant des notes de crédit reçues et des 
corrections négatives relatif aux opérations inscrites en grilles 86 et 88"))?>
-<?=show("GRIL85",_("Grille 85 : Montant des notes de crédit reçues et des 
corrections négatives relatif aux autres opérations du cadre III  "))?>
-<?=show("GRIL86",_("Grille 86 : Acquisitions intracommunautaires effectuées en 
Belgique et ventes ABC  "))?>
-<?=show("GRIL87",_(" Autres opérations à l'entrée pour lesquelles la T.V.A. 
est due par le déclarant "))?>
-<?=show("GRIL88",_("Services intracommunautaires avec report de perception"))?>
-</div>
-<div style="display:none" id="tvadue">
-<? $tab="tvadue";?>
-<h1><?=_("TVA Due");?></h1>
-<?=show("GRIL54",_("Grille 54 : tva due sur opération grille 01,02 et 03"))?>
-<?=show("GRIL55",_("Grille 55 : tva due sur opération grille 86 et 88"))?>
-<?=show("GRIL56",_("Grille 56 : tva due sur opération grille 87"))?>
-<?=show("GRIL57",_("Grille 57 :T.V.A. relative aux importations avec report de 
perception "))?>
-<?=show("GRIL61",_("Grille 61 :Diverses régularisations T.V.A. en faveur de 
l'Etat"))?>
-<?=show("GRIL63",_("Grille 63 :T.V.A. à reverser mentionnée sur les notes de 
crédit reçues"))?>
-</div>
-<div style="display:none" id="tvaded">
-       <? $tab="tvaded";?>
-<h1> <?=_("TVA Déductible");?></h1>
-<?=show("GRIL59",_("Grille 59 : taxe déductible"))?>
-<?=show("GRIL62",_("Grille 62 : Diverses régularisations T.V.A. en faveur du 
déclarant"))?>
-<?=show("GRIL64",_("Grille 56 : T.V.A. à récupérer mentionnée sur les notes de 
crédit délivrées "))?>
-</div>
-<div style="display:none" id="divers">
-       <? $tab="divers";?>
-<fieldset>
-<legend><?=_('Divers')?></legend>
-
-
-<TABLE class="result">
-<TR>
-       <TH><?=_('Poste comptable')?></TH>
-       <TH><?=_('Description')?></TH>
-       <th></th>
-</TR>
-<TR>
-
-       <TD>
-       <?
-       $atva=$cn->get_value("select pcm_val from tva_belge.parameter_chld 
where pcode='ATVA'");
-       $ip_tva=new IPoste('ATVA',$atva);
-       $ip_tva->set_attribute('gDossier',Dossier::id());
-       $ip_tva->set_attribute('jrn',0);
-       $ip_tva->set_attribute('account','ATVA');
-       $ip_tva->set_attribute('label','ATVA_label');
-       echo $ip_tva->input();
-       $lib=$cn->get_value("select pcm_lib from tmp_pcmn where 
pcm_val=$1",array($atva));
-       ?>
-       </TD>
-       <TD>
-               <SPAN ID="ATVA_label"><?=h($lib)?></SPAN>
-       </td>
-       <?=td(_("Poste comptable utilisé pour les avances faites à la TVA"))?>
-</tr>
-<TR>
-       <TD>
-       <?
-       $crtva=$cn->get_value("select pcm_val from tva_belge.parameter_chld 
where pcode='CRTVA'");
-       $ip_tva=new IPoste('CRTVA',$crtva);
-       $ip_tva->set_attribute('gDossier',Dossier::id());
-       $ip_tva->set_attribute('jrn',0);
-       $ip_tva->set_attribute('account','CRTVA');
-       $ip_tva->set_attribute('label','CRTVA_label');
-       echo $ip_tva->input();
-       $lib=$cn->get_value("select pcm_lib from tmp_pcmn where 
pcm_val=$1",array($crtva));
-       ?>
-       </TD>
-       <TD>
-               <SPAN ID="CRTVA_label"><?=h($lib)?></SPAN>
-       </td>
-<?=td(("Poste comptable utilisé pour les créances sur la  TVA"))?>
-</tr>
-<TR>
-<TD>
-       <?
-       $dttva=$cn->get_value("select pcm_val from tva_belge.parameter_chld 
where pcode='DTTVA'");
-       $ip_tva=new IPoste('DTTVA',$dttva);
-       $ip_tva->set_attribute('gDossier',Dossier::id());
-       $ip_tva->set_attribute('jrn',0);
-       $ip_tva->set_attribute('account','DTTVA');
-       $ip_tva->set_attribute('label','DTTVA_label');
-       echo $ip_tva->input();
-       $lib=$cn->get_value("select pcm_lib from tmp_pcmn where 
pcm_val=$1",array($dttva));
-       ?>
-       </TD>
-       <TD>
-               <SPAN ID="DTTVA_label"><?=h($lib)?></SPAN>
-       </td>
-       <?=td(_("Poste comptable utilisé pour les dettes envers la TVA"))?>
-</tr>
-
-</TABLE>
-       <?=HtmlInput::submit("save_misc","Sauver")?>
-</fieldset>
-</div>
-<div style="display:none" id="lintra">
-       <? $tab="lintra";?>
-<fieldset><legend>Listing intracommunautaires</legend>
-<?=show("CLINTRA",_("Code TVA pour clients  Intracommunataire"))?>
-</fieldset>
-</div>
-       <div style="display:none" id="assujetti">
-       <? $tab="assujetti";?>
-<fieldset><legend>Listing Client nationaux</legend>
-<?=show("ASSUJETTI",_("Code TVA pour clients  nationaux"))?>
-</fieldset>
-</div>
-       </form>
-<script charset="UTF-8" lang="javascript">
-       tva_show_param('<?=$tab_default?>');
-       </script>

Deleted: tag/rel652/rapport_avance/form_periode.php
===================================================================
--- tag/rel652/rapport_avance/form_periode.php  2012-12-27 00:27:39 UTC (rev 
455)
+++ tag/rel652/rapport_avance/form_periode.php  2012-12-27 01:26:31 UTC (rev 
456)
@@ -1,21 +0,0 @@
-<fieldset>
-<legend>
-   <?=_('Entrez la période de la déclaration')?>
-</legend>
-<form class="print" method="GET">
-<?=_('Année')?> <?=$str_year?><br/>
-<?=$str_monthly?>   <?=_('Mois')?> : <?=$str_month?><br/>
-<?=$str_quaterly?>   <?=_('Trimestre')?> : <?=$str_quater?><br/>
-<?=$str_hidden?>
-<?php
-if (isset ($by_year) && $by_year == true ) :
-?>
-<?=_('Par année')?> <?=$str_byyear?><br/>
-<?php
-echo HtmlInput::request_to_hidden(array('ac'));
-endif;
-?>
-<br>
-<?=$str_submit?>
-</form>
-</fieldset>
\ No newline at end of file

Deleted: tag/rel652/rapport_avance/js_scripts.js
===================================================================
--- tag/rel652/rapport_avance/js_scripts.js     2012-12-27 00:27:39 UTC (rev 
455)
+++ tag/rel652/rapport_avance/js_scripts.js     2012-12-27 01:26:31 UTC (rev 
456)
@@ -1,164 +0,0 @@
-function show_declaration(p_type,p_id) {
-    try {
-       $('detail').innerHTML='<image src="image/loading.gif" border="0" 
alt="Chargement...">';
-       $('detail').show();
-       $('main').hide();
-       var gDossier=$('gDossier').value;var code=$('plugin_code').value;
-       var queryString='act=dsp_decl&gDossier='+gDossier+'&plugin_code='+code;
-       queryString+='&type='+p_type+'&id='+p_id;
-       var action=new Ajax.Request ( 'ajax.php',
-                                 {
-                                method:'get',
-                                parameters:queryString,
-                                onFailure:error_show_declaration,
-                                onSuccess:success_show_declaration
-                              }
-                              );
-    } catch(e) {alert('show_declaration '+e.message);}
-}
-function success_show_declaration(answer) {
-    try {
-       var xml=answer.responseXML;
-       var html=xml.getElementsByTagName('code');
-       if ( html.length == 0 ) {var rec=answer.responseText;alert ('erreur 
:'+rec);}
-       var code_html=getNodeText(html[0]);
-       code_html=unescape_xml(code_html);
-       $('detail').innerHTML=code_html;
-       code_html.evalScripts();
-
-    } catch(e) {alert('success_show_declaration '+e.message);}
-}
-function error_show_declaration() {
-    alert('error_show_declaration : ajax not supported');
-}
-function record_writing(plugin,dossier,p_id) {
-    // call ajax to fill with form
-    query='gDossier='+dossier+'&plugin_code='+plugin+'&act=rw&p_id='+p_id;
-
-    // add a section
-    
show_box({id:'record_write',html:loading(),cssclass:'inner_box',style:'position:absolute;top:0;left:0%;margin-top:10%;height:80%;margin-left:10%;width:80%;',js_error:null,js_success:success_record_writing,qs:query,fixed:1,callback:'ajax.php'});
-}
-function remove_form(plugin,dossier,p_id,type) {
-    // call ajax to fill with form
-    
query='gDossier='+dossier+'&plugin_code='+plugin+'&act=rm_form&p_id='+p_id+"&type="+type;
-
-    // add a section
-    
show_box({id:'remove_form',html:loading(),cssclass:'inner_box',style:'position:absolute;top:0;left:20%;margin-top:10%;',js_error:null,js_success:success_box,qs:query,callback:'ajax.php'});
-}
-
-function success_record_writing(req) {
-    try{
-       var answer=req.responseXML;
-       var a=answer.getElementsByTagName('ctl');
-       var html=answer.getElementsByTagName('code');
-       if ( a.length == 0 ) {var rec=req.responseText;alert ('erreur :'+rec);}
-       var name_ctl=a[0].firstChild.nodeValue;
-       var code_html=getNodeText(html[0]);
-
-       code_html=unescape_xml(code_html);
-       g(name_ctl).innerHTML=code_html;
-    }
-    catch (e) {
-       alert("success_box"+e.message);}
-    try{
-       code_html.evalScripts();}
-    catch(e){
-       alert("answer_box Impossible executer script de la 
reponse\n"+e.message);}
-}
-function save_write(obj) {
-    var query="act=sw&"+$(obj).serialize();
-    var action=new Ajax.Request ( 'ajax.php',
-                                 {
-                                     method:'get',
-                                     parameters:query,
-                                     onFailure:null,
-                                     onSuccess:success_save_write
-                                 });
-    return false;
-}
-function success_save_write(req){
-
-    try{
-       var answer=req.responseXML;
-       var a=answer.getElementsByTagName('ctl');
-       var html=answer.getElementsByTagName('code');
-       if ( a.length == 0 ) {var rec=req.responseText;alert ('erreur :'+rec);}
-       var name_ctl=a[0].firstChild.nodeValue;
-       var code_html=getNodeText(html[0]);
-
-       code_html=unescape_xml(code_html);
-       g(name_ctl).innerHTML=code_html;
-    }
-    catch (e) {
-       alert("success_box"+e.message);}
-    try{
-       code_html.evalScripts();}
-    catch(e){
-       alert("answer_box Impossible executer script de la 
reponse\n"+e.message);}
-}
-function show_addparam(pcode,plugin_code,dossier,tab)
-{
-       try {
-               waiting_box();
-                var action=new Ajax.Request ( 'ajax.php',
-                                 {
-                                     method:'get',
-                                     
parameters:"act=add_param&pcode="+pcode+"&gDossier="+dossier+"&plugin_code="+plugin_code+'&tab='+tab,
-                                     onFailure:null,
-                                     onSuccess:success_showaddparam
-                                 });
-       }catch (e){
-               alert(e.message);
-       }
-}
-
-function success_showaddparam(req) {
-  try{
-               remove_waiting_box();
-               var sx=0;
-               if ( window.scrollY)
-               {
-                       sx=window.scrollY+120;
-               }
-               else
-               {
-                       sx=document.body.scrollTop+120;
-               }
-
-               var div_style="top:"+sx+";width:60%;heigth:80%";
-               removeDiv("paramadd_id");
-               add_div({
-                       "id":'paramadd_id',
-                       "drag":"1",
-                       "cssclass":"inner_box",
-                       "style":div_style
-               });
-               var answer=req.responseXML;
-               var html=answer.getElementsByTagName('code');
-               var code_html=getNodeText(html[0]);
-               code_html=unescape_xml(code_html);
-               g("paramadd_id").innerHTML=code_html;
-       }
-       catch (e) {
-               alert("success_box "+e.message);
-       }
-       try{
-               code_html.evalScripts();
-       }
-       catch(e){
-               alert("answer_box Impossible executer script de la 
reponse\n"+e.message);
-       }
-}
-
-function tva_show_param(p_div)
-{
-       try{
-               var 
div=['opin','opout','tvadue','tvaded','divers','lintra','assujetti'];
-               for (var r =0;r<div.length;r++ ) {$(div[r]).hide();  }
-               $(p_div).show();
-               $('tab').value=p_div;
-       } catch(e)
-       {
-               alert(e.message)
-       }
-}
\ No newline at end of file

Deleted: tag/rel652/rapport_avance/list_assujetti.inc.php
===================================================================
--- tag/rel652/rapport_avance/list_assujetti.inc.php    2012-12-27 00:27:39 UTC 
(rev 455)
+++ tag/rel652/rapport_avance/list_assujetti.inc.php    2012-12-27 01:26:31 UTC 
(rev 456)
@@ -1,99 +0,0 @@
-<?php
-/*
- *   This file is part of PhpCompta.
- *
- *   PhpCompta is free software; you can redistribute it and/or modify
- *   it under the terms of the GNU General Public License as published by
- *   the Free Software Foundation; either version 2 of the License, or
- *   (at your option) any later version.
- *
- *   PhpCompta is distributed in the hope that it will be useful,
- *   but WITHOUT ANY WARRANTY; without even the implied warranty of
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *   GNU General Public License for more details.
- *
- *   You should have received a copy of the GNU General Public License
- *   along with PhpCompta; if not, write to the Free Software
- *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
-*/
-/* $Revision$ */
-
-// Copyright Author Dany De Bontridder address@hidden
-
-/*!\file
- * \brief listing intracom
- */
-echo '<div class="content" style="width:80%;margin-left:10%">';
-require_once('class_ext_list_assujetti.php');
-// verify the year
-if ( isset($_REQUEST['year']) && (trim(strlen($_REQUEST['year'])) < 4 || 
isNumber($_REQUEST['year'] ) == 0 ||$_REQUEST['year'] < 
2000||$_REQUEST['year']>2100)) {
-  alert(j(_('Année invalide'.' ['.$_REQUEST['year'].']')));
-  echo Ext_List_Assujetti::choose_periode();
-  echo '</div>';
-  exit;
-}
-
-// if the periode is not set we have to ask it
-if ( ! isset($_REQUEST['decl']) ){
-  echo Ext_List_Assujetti::choose_periode(true);
-  echo '</div>';
-  exit;
-}
-
-$cn=new Database(Dossier::id());
-if (isset($_POST['save'] )) {
-  $save=new Ext_List_Assujetti($cn);
-  $save->from_array($_POST);
-  $save->insert();
-  echo h2info(_('Déclaration sauvée'));
-  echo $save->display();
-
-  /**
-   address@hidden add a div for the button generate, get_xml, create ODS, 
print...
-   */
-//   echo '<div style="position:absolute;z-index:14;top:25%;right:30" 
class="noprint">aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa</div>';
-  echo '</div>';
-  exit;
-}
-
-$tva=new Ext_List_Assujetti($cn);
-
-$str_quaterly='';
-$str_month="";
-$str_year=$_GET['year'];
-$str_byyear='1';
-$str_quater='';
-$str_hidden='';$str_submit='';$str_monthly='';
-$by_year=true;
-$tva->blank($_REQUEST['year'],1,3);
-
-
-// xdebug_disable();
-try {
-  $r=$tva->compute();
-} catch (Exception $e) {
-
-  echo Ext_List_Assujetti::choose_periode();
-  echo '</div>';
-  exit();
-  }
-require_once('form_periode.php');
-echo '<form class="print" method="post">';
-echo dossier::hidden();
-echo HtmlInput::extension();
-echo HtmlInput::hidden('start_periode',$tva->start_periode);
-echo HtmlInput::hidden('end_periode',$tva->end_periode);
-echo HtmlInput::hidden('flag_periode',$tva->flag_periode);
-echo HtmlInput::hidden('name',$tva->tva_name);
-echo HtmlInput::hidden('num_tva',$tva->num_tva);
-echo HtmlInput::hidden('adress',$tva->adress);
-echo HtmlInput::hidden('country',$tva->country);
-echo HtmlInput::hidden('periode_dec',$tva->periode_dec);
-echo HtmlInput::hidden('exercice',$tva->exercice);
-echo $tva->display_info();
-echo $r;
-echo $tva->display_declaration_amount();
-echo HtmlInput::submit('save',_('Sauvegarde'));
-echo '</form>';
-echo '</div>';
-

Deleted: tag/rel652/rapport_avance/list_intra.inc.php
===================================================================
--- tag/rel652/rapport_avance/list_intra.inc.php        2012-12-27 00:27:39 UTC 
(rev 455)
+++ tag/rel652/rapport_avance/list_intra.inc.php        2012-12-27 01:26:31 UTC 
(rev 456)
@@ -1,119 +0,0 @@
- <?php
-/*
- *   This file is part of PhpCompta.
- *
- *   PhpCompta is free software; you can redistribute it and/or modify
- *   it under the terms of the GNU General Public License as published by
- *   the Free Software Foundation; either version 2 of the License, or
- *   (at your option) any later version.
- *
- *   PhpCompta is distributed in the hope that it will be useful,
- *   but WITHOUT ANY WARRANTY; without even the implied warranty of
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *   GNU General Public License for more details.
- *
- *   You should have received a copy of the GNU General Public License
- *   along with PhpCompta; if not, write to the Free Software
- *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
-*/
-/* $Revision$ */
-
-// Copyright Author Dany De Bontridder address@hidden
-
-/*!\file
- * \brief listing intracom
- */
-require_once('class_ext_list_intra.php');
-echo '<div class="content" style="width:80%;margin-left:10%">';
-
-// verify the year
-if ( isset($_REQUEST['year']) && (trim(strlen($_REQUEST['year'])) < 4 || 
isNumber($_REQUEST['year'] ) == 0 ||$_REQUEST['year'] < 
2000||$_REQUEST['year']>2100)) {
-  alert(j(_('Année invalide'.' ['.$_REQUEST['year'].']')));
-  echo Ext_List_Intra::choose_periode();
-  echo '</div>';
-  exit;
-}
-
-// if the periode is not set we have to ask it
-if ( ! isset($_REQUEST['decl']) ){
-  echo Ext_List_Intra::choose_periode(true);
-  echo '</div>';
-  exit;
-}
-
-$cn=new Database(Dossier::id());
-if (isset($_POST['save'] )) {
-  $save=new Ext_List_Intra($cn);
-  $save->from_array($_POST);
-  $save->insert();
-  echo h2info(_('Déclaration sauvée'));
-  echo $save->display();
-
-  /**
-   address@hidden add a div for the button generate, get_xml, create ODS, 
print...
-   */
-//   echo '<div style="position:absolute;z-index:14;top:25%;right:30" 
class="noprint">aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa</div>';
-  echo '</div>';
-  exit;
-}
-
-$tva=new Ext_List_Intra($cn);
-
-/* by month */
-if ( $_REQUEST['periodic']==1) {
-  $str_monthly='';
-  
$str_month=$_GET['bymonth'];$str_year=$_GET['year'];$str_quaterly="";$str_hidden='';$str_submit='';$str_quater='-';
-  $tva->blank($_REQUEST['year'],$_GET['bymonth'],1);
-
-}
-
-/* by quater */
-if ($_REQUEST['periodic'] == 2) {
-  $str_quaterly='';
-  $str_month="-";
-  $str_year=$_GET['year'];
-  $str_quater=$_REQUEST['byquaterly'];
-  $str_hidden='';$str_submit='';$str_monthly='';
-  $tva->blank($_REQUEST['year'],$_GET['byquaterly'],2);
-}
-/* by year */
-if ($_REQUEST['periodic'] == 3) {
-  $str_quaterly='';
-  $str_month="";
-  $str_year=$_GET['year'];
-  $str_byyear='1';
-  $str_quater='';
-  $str_hidden='';$str_submit='';$str_monthly='';
-  $by_year=true;
-  $tva->blank($_REQUEST['year'],$_GET['byquaterly'],3);
-}
-
-try {
-  $r=$tva->compute();
-} catch (Exception $e) {
-
-  echo Ext_List_Intra::choose_periode();
-  echo '</div>';
-  exit();
-  }
-
-require_once('form_periode.php');
-
-echo '<form class="print" method="post">';
-echo dossier::hidden();
-echo HtmlInput::extension();
-echo HtmlInput::hidden('start_periode',$tva->start_periode);
-echo HtmlInput::hidden('end_periode',$tva->end_periode);
-echo HtmlInput::hidden('flag_periode',$tva->flag_periode);
-echo HtmlInput::hidden('name',$tva->tva_name);
-echo HtmlInput::hidden('num_tva',$tva->num_tva);
-echo HtmlInput::hidden('adress',$tva->adress);
-echo HtmlInput::hidden('country',$tva->country);
-echo HtmlInput::hidden('periode_dec',$tva->periode_dec);
-echo HtmlInput::hidden('exercice',$tva->exercice);
-echo $tva->display_info();
-echo $r;
-echo $tva->display_declaration_amount();
-echo HtmlInput::submit('save',_('Sauvegarde'));
-echo '</form>';
-echo '</div>';

Deleted: tag/rel652/rapport_avance/list_tva.inc.php
===================================================================
--- tag/rel652/rapport_avance/list_tva.inc.php  2012-12-27 00:27:39 UTC (rev 
455)
+++ tag/rel652/rapport_avance/list_tva.inc.php  2012-12-27 01:26:31 UTC (rev 
456)
@@ -1,143 +0,0 @@
-<?php
-/*
- *   This file is part of PhpCompta.
- *
- *   PhpCompta is free software; you can redistribute it and/or modify
- *   it under the terms of the GNU General Public License as published by
- *   the Free Software Foundation; either version 2 of the License, or
- *   (at your option) any later version.
- *
- *   PhpCompta is distributed in the hope that it will be useful,
- *   but WITHOUT ANY WARRANTY; without even the implied warranty of
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *   GNU General Public License for more details.
- *
- *   You should have received a copy of the GNU General Public License
- *   along with PhpCompta; if not, write to the Free Software
- *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
- */
-/* $Revision$ */
-
-// Copyright Author Dany De Bontridder address@hidden
-require_once('class_iselect.php');
-require_once 'class_sort_table.php';
-
-echo '<div id="detail" style="display:none; width:80%;margin-left:10%">';
-echo '<image src="image/loading.gif" border="0" alt="Chargement...">';
-echo '</div>';
-/* !\file
- * \brief show all the declaration by date
- */
-
-echo '<div id="main" class="content" style="width:80%;margin-left:10%">';
-echo '<form method="get">';
-echo HtmlInput::request_to_hidden(array('ac'));
-echo _('Filtrer par ');
-$choice = new ISelect('type');
-$choice->value = array(
-       array('label' => 'Toutes', 'value' => 0),
-       array('label' => 'Déclarations', 'value' => 1),
-       array('label' => 'Listings assujetti', 'value' => 2),
-       array('label' => 'Listings intracom', 'value' => 3)
-);
-$choice->selected = (isset($_REQUEST['type'])) ? $_REQUEST['type'] : 0;
-$choice->javascript = ' onchange="submit(this)"';
-echo HtmlInput::extension();
-echo HtmlInput::hidden('sa', 'ltva');
-echo dossier::hidden();
-echo $choice->input();
-echo HtmlInput::submit('rc', 'Recharger');
-echo '</form>';
-
-$url = HtmlInput::request_to_string(array('ac', 'plugin_code', 'gDossier', 
'sa', 'type'));
-$sort= new Sort_Table();
-$sort->add('Date déclaration   ', $url, ' order by date_decl asc', ' order by 
date_decl desc', 'da', 'dd');
-$sort->add('Période    ', $url, ' order by exercice asc,periode_dec asc', ' 
order by exercice desc,periode_dec desc', 'pa', 'pd');
-
-$option_order = (isset($_GET['ord'])) ? $_GET['ord'] : 'dd';
-
-$sql_order = $sort->get_sql_order($option_order);
-
-switch ($choice->selected)
-{
-       case 0:
-               $sql = "
-select da_id as id, 'Déclaration trim/mens' as type_title,1 as 
type_decl,to_char(date_decl,'DD.MM.YYYY') as date_fmt,date_decl,
-case when periodicity ='1' then 'Mensuel'
-when periodicity = '2' then 'Trimestriel'
-end as fmt_periodicity,
-periode_dec,exercice
-from tva_belge.declaration_amount
-union all
-select i_id as id, 'Listing Intracom' as type_title, 3 as type_decl, 
to_char(date_decl,'DD.MM.YYYY') as date_fmt,date_decl,
-case when periodicity ='1' then 'Mensuel'
-when periodicity = '2' then 'Trimestriel'
-when periodicity = '3' then 'Annuel'
-end as fmt_periodicity,
-periode_dec,exercice
-from tva_belge.intracomm
-union all
-select a_id as id, 'Listing assujetti' as type_title, 2 as type_decl, 
to_char(date_decl,'DD.MM.YYYY') as date_fmt,date_decl,
- 'Annuel' as fmt_periodicity,
-periode_dec,exercice
-from tva_belge.assujetti
-";
-
-               break;
-
-       case 1:
-
-               $sql = "
-select da_id as id, 'Déclaration trim/mens' as type_title,1 as 
type_decl,to_char(date_decl,'DD.MM.YYYY') as date_fmt,
-case when periodicity ='1' then 'Mensuel'
-when periodicity = '2' then 'Trimestriel'
-end as fmt_periodicity,
-periode_dec,exercice
-from tva_belge.declaration_amount 
-";
-               break;
-       case 2:
-               $sql = "
-select a_id as id, 'Listing assujetti' as type_title, 2 as type_decl, 
to_char(date_decl,'DD.MM.YYYY') as date_fmt,date_decl,
- 'Annuel' as fmt_periodicity,
-periode_dec,exercice
-from tva_belge.assujetti
-";
-               break;
-       case 3:
-               $sql = "
-select i_id as id, 'Listing Intracom' as type_title, 3 as type_decl, 
to_char(date_decl,'DD.MM.YYYY') as date_fmt,date_decl,
-case when periodicity ='1' then 'Mensuel'
-when periodicity = '2' then 'Trimestriel'
-when periodicity = '3' then 'Annuel'
-end as fmt_periodicity,
-periode_dec,exercice
-from tva_belge.intracomm
-";
-               break;
-}
-$sql = $sql . $sql_order;
-$res = $cn->get_array($sql);
-?>
-<table class="result" >
-       <tr>
-               <th>Type de déclaration</th>
-               <th>Periodicité</th>
-               <th> <?=$sort->get_header(1)?></th>
-               <th><?=$sort->get_header(0)?></th>
-
-               <? for ($i = 0; $i < count($res); $i++):?>
-               <tr>
-                       <?
-                       $aref = sprintf('<a href="javascript:void(0)" 
onclick="show_declaration(\'%s\',\'%s\')">', $res[$i]['type_decl'], 
$res[$i]['id']);
-                       echo td($aref . $res[$i]['type_title'] . '</a>');
-                       echo td($aref . $res[$i]['fmt_periodicity'] . '</a>');
-                       echo td($aref.$res[$i]['periode_dec'].' - 
'.$res[$i]['exercice'].'</a>');
-                       echo td($aref.$res[$i]['date_fmt'].'</a>');
-                       ?>
-               </tr>
-       <? endfor;?>
-</table>
-</div>
-
-

Deleted: tag/rel652/rapport_avance/tva_constant.php
===================================================================
--- tag/rel652/rapport_avance/tva_constant.php  2012-12-27 00:27:39 UTC (rev 
455)
+++ tag/rel652/rapport_avance/tva_constant.php  2012-12-27 01:26:31 UTC (rev 
456)
@@ -1,32 +0,0 @@
-<?php
-/*
- *   This file is part of PhpCompta.
- *
- *   PhpCompta is free software; you can redistribute it and/or modify
- *   it under the terms of the GNU General Public License as published by
- *   the Free Software Foundation; either version 2 of the License, or
- *   (at your option) any later version.
- *
- *   PhpCompta is distributed in the hope that it will be useful,
- *   but WITHOUT ANY WARRANTY; without even the implied warranty of
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *   GNU General Public License for more details.
- *
- *   You should have received a copy of the GNU General Public License
- *   along with PhpCompta; if not, write to the Free Software
- *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
-*/
-/* $Revision$ */
-
-// Copyright Author Dany De Bontridder address@hidden
-
-/*!\file
- * \brief
- */
-
-  $GLOBALS['quaterly_limit']=array(
-                                  1 => array('01.01','31.03'),
-                                  2 => array('01.04','30.06'),
-                                  3 => array('01.07','30.09'),
-                                  4 => array('01.10','31.12')
-                       );

Deleted: tag/rel652/rapport_avance/tva_param.inc.php
===================================================================
--- tag/rel652/rapport_avance/tva_param.inc.php 2012-12-27 00:27:39 UTC (rev 
455)
+++ tag/rel652/rapport_avance/tva_param.inc.php 2012-12-27 01:26:31 UTC (rev 
456)
@@ -1,77 +0,0 @@
-<?php
-/*
- *   This file is part of PhpCompta.
- *
- *   PhpCompta is free software; you can redistribute it and/or modify
- *   it under the terms of the GNU General Public License as published by
- *   the Free Software Foundation; either version 2 of the License, or
- *   (at your option) any later version.
- *
- *   PhpCompta is distributed in the hope that it will be useful,
- *   but WITHOUT ANY WARRANTY; without even the implied warranty of
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *   GNU General Public License for more details.
- *
- *   You should have received a copy of the GNU General Public License
- *   along with PhpCompta; if not, write to the Free Software
- *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
-*/
-/* $Revision$ */
-
-// Copyright Author Dany De Bontridder address@hidden
-
-/*!\file
- * \brief set up the parameters
- */
-require_once('class_tva_parameter.php');
-$cn=new Database(dossier::id());
-
-// save all the parameters
-if ( isset ($_POST['save_misc']))  {
-       extract($_POST);
-
-       foreach ( array('CRTVA','ATVA','DTTVA') as $i){
-               $value=${$i};
-               if ( trim(${$i})=='') $value=null;
-               if ( $cn->get_value("select count(*) from 
tva_belge.parameter_chld where pcode=$1",array($i))==0)
-               {
-                       $cn->exec_sql("insert into 
tva_belge.parameter_chld(pcode,pcm_val) values($1,$2) ",
-                                       array($i,$value));
-               }else {
-
-               $cn->exec_sql("update tva_belge.parameter_chld set 
pcm_val=$1::account_type where pcode=$2",
-                               array($value,$i));
-               }
-       }
-
-       unset($_POST['save_misc']);
-}
-
-if ( isset ($_POST['save_addparam'])){
-       extract ($_POST);
-       try {
-               if ( trim($tva_id)=="")                 throw new 
Exception("TVA n'existe pas");
-               if ( trim($paccount)=="")                       throw new 
Exception("Poste comptable vide");
-               if ( $cn->get_value("select count(tva_id) from tva_rate where 
tva_id=$1",array($tva_id))==0) throw new Exception("TVA $tva_id n'existe pas");
-               $cn->exec_sql("insert into 
tva_belge.parameter_chld(pcode,tva_id,pcm_val) values ($1,$2,$3::account_type)",
-               array($pcode,$tva_id,$paccount));
-       } catch(Exception $e) {
-               alert("Ne peut sauver : ".$e->getMessage());
-       }
-}
-if ( isset ($_POST['pi_id'])){
-       $cn->exec_sql("delete from tva_belge.parameter_chld where 
pi_id=$1",array($_POST['pi_id']));
-}
-/* show all the possible parameters */
-$tvap=new Tva_Parameter($cn);
-require_once('class_itva_popup.php');
-$a=new IPopup('popup_tva');
-$a->set_title('Choississez la tva qui convient');
-echo $a->input();
-require_once('class_iposte.php');
-echo IPoste::ipopup('ipop_account');
-
-echo dossier::hidden();
-echo HtmlInput::extension();
-echo $tvap->display();
-



---
PhpCompta est un logiciel de comptabilité libre en ligne (full web)
Projet opensource http://www.phpcompta.eu



reply via email to

[Prev in Thread] Current Thread [Next in Thread]