Plugins  LAST
 All Data Structures Files Functions Variables Pages
decl_tva.inc.php
Go to the documentation of this file.
1 <?php
2 /*
3  * This file is part of NOALYSS.
4  *
5  * NOALYSS is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License as published by
7  * the Free Software Foundation; either version 2 of the License, or
8  * (at your option) any later version.
9  *
10  * NOALYSS is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with NOALYSS; if not, write to the Free Software
17  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 */
19 /* $Revision$ */
20 
21 // Copyright (c) 2002 Author Dany De Bontridder dany@alchimerys.be
22 
23 /*!\file
24  * \brief this file is included to create a new VAT declaration
25  *
26  */
27 require_once('class_ext_tva.php');
28 echo '<div class="content" style="width:80%;margin-left:10%">';
29 
30 // verify the year
31 if ( isset($_REQUEST['year']) && (trim(strlen($_REQUEST['year'])) < 4 || isNumber($_REQUEST['year'] ) == 0 ||$_REQUEST['year'] < 2000||$_REQUEST['year']>2100)) {
32  alert(j(_('Année invalide'.' ['.$_REQUEST['year'].']')));
34  echo '</div>';
35  exit;
36 }
37 
38  // if the periode is not set we have to ask it
39 if ( ! isset($_REQUEST['decl']) ){
41  echo '</div>';
42  exit;
43 }
44 $cn=Dossier::connect();
45 if (isset($_POST['save'] )) {
46  $save=new Ext_Tva($cn);
47  $save->from_array($_POST);
48  $save->insert();
49  echo h2info(_('Déclaration sauvée'));
50  echo $save->display();
51  /**
52  *@todo add a div for the button generate, get_xml, create ODS, print...
53  */
54 // echo '<div style="position:absolute;z-index:14;top:25%;right:30" class="noprint">aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa</div>';
55  echo '</div>';
56  exit;
57 }
58 
60 
61 /* by month */
62 if ( $_REQUEST['periodic']==1) {
63  $str_monthly='';
64  $str_month=$_GET['bymonth'];$str_year=$_GET['year'];$str_quaterly="";$str_hidden='';$str_submit='';$str_quater='-';
65  $tva->blank($_REQUEST['year'],$_GET['bymonth'],1);
66 
67 }
68 
69 /* by quater */
70 if ($_REQUEST['periodic'] == 2) {
71  $str_quaterly='';
72  $str_month="-";
73  $str_year=$_GET['year'];
74  $str_quater=$_REQUEST['byquaterly'];
76  $tva->blank($_REQUEST['year'],$_GET['byquaterly'],2);
77 }
78 try {
79  $r=$tva->compute();
80 } catch (Exception $e) {
81 
82  echo '<div class="content" style="width:80%;margin-left:10%">';
84  echo '</div>';
85  return;
86  }
87 require_once('form_periode.php');
88 echo '<form class="print" method="post">';
89 echo dossier::hidden();
90 echo HtmlInput::extension();
91 echo HtmlInput::hidden('start_periode',$tva->start_periode);
92 echo HtmlInput::hidden('end_periode',$tva->end_periode);
93 echo HtmlInput::hidden('flag_periode',$tva->flag_periode);
94 echo HtmlInput::hidden('name',$tva->tva_name);
95 echo HtmlInput::hidden('num_tva',$tva->num_tva);
96 echo HtmlInput::hidden('adress',$tva->adress);
97 echo HtmlInput::hidden('country',$tva->country);
98 echo HtmlInput::hidden('exercice',$tva->exercice);
99 
100 
101 
102 echo $tva->display_info();
103 echo $r;
104 echo $tva->display_declaration_amount();
105 echo HtmlInput::submit('save',_('Sauvegarde'));
106 echo '</form>';
107 echo '</div>';
108  // create the XML files and the OD operation, validate it to save it into the vat history
109 
110 
111 ?>
if(isset($_REQUEST['year'])&&(trim(strlen($_REQUEST['year']))< 4||isNumber($_REQUEST['year'])==0||$_REQUEST['year']< 2000||$_REQUEST['year']>2100)) if(!isset($_REQUEST['decl'])) $cn
$r
static choose_periode($by_year=false)
if(isset($_POST['save'])) $tva
$_REQUEST['sb']
Definition: am_print.php:39