Plugins  LAST
 All Data Structures Files Functions Variables Pages
list_intra.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 listing intracom
25  */
26 require_once('class_ext_list_intra.php');
27 echo '<div class="content" style="width:80%;margin-left:10%">';
28 
29 // verify the year
30 if ( isset($_REQUEST['year']) && (trim(strlen($_REQUEST['year'])) < 4 || isNumber($_REQUEST['year'] ) == 0 ||$_REQUEST['year'] < 2000||$_REQUEST['year']>2100)) {
31  alert(j(_('Année invalide'.' ['.$_REQUEST['year'].']')));
33  echo '</div>';
34  exit;
35 }
36 
37 // if the periode is not set we have to ask it
38 if ( ! isset($_REQUEST['decl']) ){
40  echo '</div>';
41  exit;
42 }
43 
44 $cn=Dossier::connect();
45 if (isset($_POST['save'] )) {
47  $save->from_array($_POST);
48  $save->insert();
49  echo h2info(_('Déclaration sauvée'));
50  echo $save->display();
51 
52  /**
53  *@todo add a div for the button generate, get_xml, create ODS, print...
54  */
55 // echo '<div style="position:absolute;z-index:14;top:25%;right:30" class="noprint">aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa</div>';
56  echo '</div>';
57  exit;
58 }
59 
61 
62 /* by month */
63 if ( $_REQUEST['periodic']==1) {
64  $str_monthly='';
65  $str_month=$_GET['bymonth'];$str_year=$_GET['year'];$str_quaterly="";$str_hidden='';$str_submit='';$str_quater='-';
66  $tva->blank($_REQUEST['year'],$_GET['bymonth'],1);
67 
68 }
69 
70 /* by quater */
71 if ($_REQUEST['periodic'] == 2) {
72  $str_quaterly='';
73  $str_month="-";
74  $str_year=$_GET['year'];
75  $str_quater=$_REQUEST['byquaterly'];
77  $tva->blank($_REQUEST['year'],$_GET['byquaterly'],2);
78 }
79 /* by year */
80 if ($_REQUEST['periodic'] == 3) {
81  $str_quaterly='';
82  $str_month="";
83  $str_year=$_GET['year'];
84  $str_byyear='1';
85  $str_quater='';
87  $by_year=true;
88  $tva->blank($_REQUEST['year'],$_GET['byquaterly'],3);
89 }
90 
91 try {
92  $r=$tva->compute();
93 } catch (Exception $e) {
94 
96  echo '</div>';
97  return;
98  }
99 
100 require_once('form_periode.php');
101 
102 echo '<form class="print" method="post">';
103 echo dossier::hidden();
104 echo HtmlInput::extension();
105 echo HtmlInput::hidden('start_periode',$tva->start_periode);
106 echo HtmlInput::hidden('end_periode',$tva->end_periode);
107 echo HtmlInput::hidden('flag_periode',$tva->flag_periode);
108 echo HtmlInput::hidden('name',$tva->tva_name);
109 echo HtmlInput::hidden('num_tva',$tva->num_tva);
110 echo HtmlInput::hidden('adress',$tva->adress);
111 echo HtmlInput::hidden('country',$tva->country);
112 echo HtmlInput::hidden('periode_dec',$tva->periode_dec);
113 echo HtmlInput::hidden('exercice',$tva->exercice);
114 echo $tva->display_info();
115 echo $r;
116 echo $tva->display_declaration_amount();
117 echo HtmlInput::submit('save',_('Sauvegarde'));
118 echo '</form>';
119 echo '</div>';
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