phpcompta-dev
[Top][All Lists]
Advanced

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

[Phpcompta-dev] r192 - trunk/tva


From: phpcompta-dev
Subject: [Phpcompta-dev] r192 - trunk/tva
Date: Sat, 19 Nov 2011 01:20:40 +0100 (CET)

Author: danydb
Date: 2011-11-19 01:20:38 +0100 (Sat, 19 Nov 2011)
New Revision: 192

Modified:
   trunk/tva/class_ext_list_assujetti.php
   trunk/tva/class_ext_list_intra.php
   trunk/tva/class_ext_tva.php
   trunk/tva/class_ext_tvagen.php
   trunk/tva/form_periode.php
   trunk/tva/list_tva.inc.php
Log:
adaptation TVA version 6.0

Modified: trunk/tva/class_ext_list_assujetti.php
===================================================================
--- trunk/tva/class_ext_list_assujetti.php      2011-11-17 23:16:49 UTC (rev 
191)
+++ trunk/tva/class_ext_list_assujetti.php      2011-11-19 00:20:38 UTC (rev 
192)
@@ -44,13 +44,13 @@
                              );
   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']))
@@ -59,6 +59,7 @@
     $r.="Année :".$str_year;
     $r.=$str_submit;
     $r.=$str_hidden;
+       $r.=HtmlInput::request_to_hidden(array('ac'));
     $r.='</form>';
     return $r;
   }
@@ -82,11 +83,11 @@
        $child->set_parameter('tva_num',$tva_num[$i]);
 
        $array[]=$child;
-      }//end for                           
+      }//end for
       $this->aChild=$array;
-    } else 
+    } 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'];
@@ -99,6 +100,7 @@
   }
   function display() {
     $r= '<form class="print" id="readonly">';
+       $r.=HtmlInput::request_to_hidden(array('ac'));
     $r.=$this->display_info();
     $r.=$this->display_declaration_amount();
     $r.='</form>';
@@ -131,12 +133,12 @@
     $array=array();
     // retrieve missing and compute an array
     for ($i=0;$i<$nb;$i++){
-      $child=new Ext_List_Assujetti_Child($this->db);  
+      $child=new Ext_List_Assujetti_Child($this->db);
       foreach ($res[$i] as $idx=>$value){
        $child->$idx=$value;
-      }        
+      }
       $array[]=$child;
-    }//end for                     
+    }//end for
     $this->aChild=$array;
 
     return 1;
@@ -150,7 +152,7 @@
     /* insert into the first table */
     $sql=<<<EOF
       INSERT INTO tva_belge.assujetti(
-                                     start_date, end_date,  periodicity, 
tva_name, 
+                                     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;
@@ -188,8 +190,8 @@
     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) ) 
+      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
@@ -212,7 +214,7 @@
       $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 
+      $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')
                                   )
@@ -239,7 +241,7 @@
       $child->set_parameter('name_child',$fiche->strAttribut(ATTR_DEF_NAME));
 
       $array[]=$child;
-    }//end for                     
+    }//end for
     $this->aChild=$array;
   }
   /**
@@ -251,7 +253,7 @@
     $clean=new IButton();
     $clean->label='Efface ligne';
     $clean->javascript="deleteRow('tb_dsp',this);";
-       
+
     $r='';
     $r.=th('QuickCode');
     $r.=th('Name');
@@ -307,9 +309,9 @@
 
     $sql=<<<EOF
       INSERT INTO tva_belge.assujetti_chld(
-                                          a_id, ac_tvanum, ac_amount, ac_vat,  
ac_qcode, 
+                                          a_id, ac_tvanum, ac_amount, ac_vat,  
ac_qcode,
                                           ac_name)
-      VALUES ($1, $2, $3, $4, $5, $6) returning ac_id; 
+      VALUES ($1, $2, $3, $4, $5, $6) returning ac_id;
 EOF;
     $this->ic_id=$this->db->get_value($sql,array(
                                                 $this->a_id,

Modified: trunk/tva/class_ext_list_intra.php
===================================================================
--- trunk/tva/class_ext_list_intra.php  2011-11-17 23:16:49 UTC (rev 191)
+++ trunk/tva/class_ext_list_intra.php  2011-11-19 00:20:38 UTC (rev 192)
@@ -65,11 +65,11 @@
       $child->set_parameter('tva_num',$tva_num[$i]);
 
       $array[]=$child;
-    }//end for                     
+    }//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'];
@@ -79,11 +79,12 @@
     $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');}\"",
@@ -115,12 +116,12 @@
    $array=array();
    // retrieve missing and compute an array
    for ($i=0;$i<$nb;$i++){
-     $child=new Ext_List_Intra_Child($this->db);       
+     $child=new Ext_List_Intra_Child($this->db);
      foreach ($res[$i] as $idx=>$value){
        $child->$idx=$value;
-     } 
+     }
      $array[]=$child;
-   }//end for                      
+   }//end for
    $this->aChild=$array;
 
    return 1;
@@ -134,7 +135,7 @@
     /* insert into the first table */
     $sql=<<<EOF
 INSERT INTO tva_belge.intracomm(
-            start_date, end_date,  periodicity, tva_name, 
+            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;
@@ -172,8 +173,8 @@
     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) ) 
+      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
@@ -212,12 +213,12 @@
 
       if ( strpos($num_tva,'BE') === 0) { echo "pas bon";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                     
+    }//end for
     $this->aChild=$array;
   }
   /**
@@ -230,7 +231,7 @@
     $clean=new IButton();
     $clean->label='Efface ligne';
     $clean->javascript="deleteRow('tb_dsp',this);";
-       
+
     $r='';
     $r.=th('QuickCode');
     $r.=th('Name');
@@ -288,9 +289,9 @@
   function insert() {
 $sql=<<<EOF
 INSERT INTO tva_belge.intracomm_chld(
-            i_id, ic_tvanum, ic_amount, ic_code, ic_periode, ic_qcode, 
+            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; 
+  VALUES ($1, $2, $3, $4, $5, $6, $7) returning ic_id;
 EOF;
 $this->ic_id=$this->db->get_value($sql,array(
                                             $this->i_id,

Modified: trunk/tva/class_ext_tva.php
===================================================================
--- trunk/tva/class_ext_tva.php 2011-11-17 23:16:49 UTC (rev 191)
+++ trunk/tva/class_ext_tva.php 2011-11-19 00:20:38 UTC (rev 192)
@@ -80,7 +80,7 @@
   /**
    address@hidden retrieve * row thanks a condition
    */
-   public function seek($cond,$p_array=null) 
+   public function seek($cond,$p_array=null)
    {
    }
    public function from_array($p_array) {
@@ -104,14 +104,14 @@
 
     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, 
+             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, 
+    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) 
+            $37,$38,$39,$40,$41)
              returning da_id;";
       $this->da_id=$this->db->get_value($sql,
                                     array($this->d00, /* 1 */
@@ -166,7 +166,7 @@
 
   public function load() {
 
-   $sql="select * from tva_belge.declaration_amount where da_id=$1"; 
+   $sql="select * from tva_belge.declaration_amount where da_id=$1";
 
    $res=$this->db->get_array(
                            $sql,
@@ -176,7 +176,7 @@
    foreach ($res[0] as $idx=>$value) { $this->$idx=$value; }
   }
   public function delete() {
-/*    $sql="delete from tva_rate where tva_id=$1"; 
+/*    $sql="delete from tva_rate where tva_id=$1";
     $res=$this->cn->exec_sql($sql,array($this->tva_id));
 */
   }
@@ -201,7 +201,7 @@
 
     // set default value 0 for all
     $keys=array_keys($this->variable);
-    for ($i = 0;$i < count($this->variable);$i++) { 
+    for ($i = 0;$i < count($this->variable);$i++) {
       $idx=$keys[$i];
       $this->$idx=0;
       if ( $idx=='d91') break;
@@ -228,7 +228,7 @@
       $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');
@@ -240,7 +240,7 @@
 
     }
 
-   
+
     $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);
@@ -265,7 +265,7 @@
     // 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;
@@ -367,7 +367,7 @@
        $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);
@@ -381,19 +381,19 @@
 
        $ICheckBox=new ICheckBox('deb['.$idx.']');
        if ( $result['debit'] < $result['credit'] ) {
-        $amount_vat-=$result['solde'];  $ICheckBox->selected=true;} 
+        $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()));
-       
+
        /* get saldo for CREDIT*/
        $saldo=new Acc_Account_Ledger($this->db,$cred);
        /* get label */
        $lib=$this->db->get_value('select pcm_lib from tmp_pcmn where 
pcm_val=$1',array($cred));
-                               
+
        $cond=sprintf(" j_date >=to_date('%s','DD.MM.YYYY') and j_date <= '%s'",
                     $first_day,
                     $this->end_date);
@@ -409,11 +409,11 @@
        if ( $result['debit'] < $result['credit'] ) 
{$amount_vat-=$result['solde'];      $ICheckBox->selected=true;}
        else {   $ICheckBox->selected=false;
         $amount_vat+=$result['solde'];}
-       
+
        /* display row */
        
$r.=tr(td($account->input()).td($lib).td($amount->input()).td($ICheckBox->input()));
        $idx++;
-       
+
      }
      /* ATVA */
      $atva=$this->db->get_value("select paccount from tva_belge.parameter 
where pcode='ATVA'");
@@ -422,7 +422,7 @@
        $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);
@@ -435,7 +435,7 @@
 
        if ( $result['debit'] < $result['credit'] ) {
         $amount_vat-=$result['solde'];  $ICheckBox->selected=true;}
-       else {       
+       else {
         $ICheckBox->selected=false;
         $amount_vat+=$result['solde'];
        }
@@ -451,7 +451,7 @@
        $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);
@@ -481,7 +481,7 @@
        $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);
@@ -509,7 +509,7 @@
        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');
@@ -525,7 +525,7 @@
        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');
@@ -544,6 +544,7 @@
    }
    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>';

Modified: trunk/tva/class_ext_tvagen.php
===================================================================
--- trunk/tva/class_ext_tvagen.php      2011-11-17 23:16:49 UTC (rev 191)
+++ trunk/tva/class_ext_tvagen.php      2011-11-19 00:20:38 UTC (rev 192)
@@ -28,7 +28,7 @@
 require_once('class_own.php');
 /**
  address@hidden transform a string into an arrau without empty element and  
duplicate
- * the array is sorted 
+ * the array is sorted
  address@hidden $p_string string containing a comma a separator
  address@hidden array
  *
@@ -50,13 +50,13 @@
 {
   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 
+    else
       throw new Exception (__FILE__.":".__LINE__.'Erreur attribut inexistant');
   }
   public function set_parameter($p_string,$p_value) {
@@ -64,16 +64,16 @@
       $idx=$this->variable[$p_string];
       $this->$idx=$p_value;
     }
-    else 
+    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 ) 
+    if (  $this->get_parameter("id") == 0 )
       $this->insert();
     else
       $this->update();
@@ -83,7 +83,7 @@
     require_once('class_iradio.php');
     $monthly=new IRadio('periodic');
     $monthly->value=1;
-    
+
     // month
     $month=new ISelect('bymonth');
     $array=array ();
@@ -98,8 +98,8 @@
     $year = new IText('year');
     $year->size=4;
     $str_year=$year->input();
-    
-    // Tri 
+
+    // Tri
     $quater=new ISelect('byquaterly');
     $array=array();
     for ($i=0;$i<4;$i++) {
@@ -115,6 +115,7 @@
     $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');

Modified: trunk/tva/form_periode.php
===================================================================
--- trunk/tva/form_periode.php  2011-11-17 23:16:49 UTC (rev 191)
+++ trunk/tva/form_periode.php  2011-11-19 00:20:38 UTC (rev 192)
@@ -12,6 +12,7 @@
 ?>
 <?=_('Par année')?> <?=$str_byyear?><br/>
 <?php
+echo HtmlInput::request_to_hidden(array('ac'));
 endif;
 ?>
 <br>

Modified: trunk/tva/list_tva.inc.php
===================================================================
--- trunk/tva/list_tva.inc.php  2011-11-17 23:16:49 UTC (rev 191)
+++ trunk/tva/list_tva.inc.php  2011-11-19 00:20:38 UTC (rev 192)
@@ -30,6 +30,7 @@
 
 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(
@@ -50,14 +51,14 @@
 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'  
+case when periodicity ='1' then 'Mensuel'
 when periodicity = '2' then 'Trimestriel'
 end as fmt_periodicity,
-periode_dec,exercice 
-from tva_belge.declaration_amount 
+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'  
+case when periodicity ='1' then 'Mensuel'
 when periodicity = '2' then 'Trimestriel'
 when periodicity = '3' then 'Annuel'
 end as fmt_periodicity,
@@ -66,7 +67,7 @@
 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 
+periode_dec,exercice
 from tva_belge.assujetti
 
 order by date_decl desc
@@ -75,10 +76,10 @@
   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'  
+case when periodicity ='1' then 'Mensuel'
 when periodicity = '2' then 'Trimestriel'
 end as fmt_periodicity,
 periode_dec,exercice
@@ -97,7 +98,7 @@
 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'  
+case when periodicity ='1' then 'Mensuel'
 when periodicity = '2' then 'Trimestriel'
 when periodicity = '3' then 'Annuel'
 end as fmt_periodicity,




reply via email to

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