Plugins
LAST
Main Page
Related Pages
Data Structures
Files
File List
Globals
All
Data Structures
Files
Functions
Variables
Pages
tva
index.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 main file for tva
25
*/
26
global
$version_plugin
;
27
$version_plugin
=SVNINFO;
28
Extension::check_version(6910);
29
30
$url
=
'?'
.dossier::get().
'&plugin_code='
.
$_REQUEST
[
'plugin_code'
].
"&ac="
.
$_REQUEST
[
'ac'
];
31
$array
=array (
32
array(
$url
.
'&sa=dec'
,_(
'Déclaration TVA'
),_(
'Déclaration Trimestriel ou annuel de TVA'
),1),
33
array(
$url
.
'&sa=li'
,_(
'Listing intracommunautaire'
),_(
'Listing intracommunautaire trimestriel'
),2),
34
array(
$url
.
'&sa=lc'
,_(
'Listing Assujetti'
),_(
'Listing des clients assujettis'
),3),
35
array(
$url
.
'&sa=ltva'
,_(
'Liste des déclarations TVA'
),_(
'Historique des déclarations TVA'
),4),
36
array(
$url
.
'&sa=param'
,_(
'Paramètrage '
),_(
'Paramètre pour la TVA'
),5)
37
);
38
echo
'<script language="javascript">'
;
39
require_once(
'js_scripts.js'
);
40
echo
'</script>'
;
41
42
$sa
=(isset(
$_REQUEST
[
'sa'
]))?
$_REQUEST
[
'sa'
]:0;
43
$def
=0;
44
switch
(
$sa
) {
45
case
'dec'
:
46
$def
=1;
47
break
;
48
case
'li'
:
49
$def
=2;
50
break
;
51
case
'lc'
:
52
$def
=3;
53
break
;
54
case
'ltva'
:
55
$def
=4;
56
break
;
57
case
'param'
:
58
$def
=5;
59
break
;
60
61
}
62
$install
=0;
63
$cn
=Dossier::connect();
64
if
(
$cn
->exist_schema(
'tva_belge'
) ==
false
) {
65
require_once(
'class_install_plugin.php'
);
66
$install
=1;
67
$iplugn=
new
Install_Plugin
(
$cn
);
68
$iplugn->install();
69
echo_warning(_(
"L'extension est installée, pourriez-vous en vérifier le paramètrage ?"
));
70
$def
=5;
71
}
72
73
// check schema
74
$a
=
$cn
->exist_column(
'assujetti_chld'
,
'ac_periode'
,
'tva_belge'
);
75
if
(
$a
==
false
)
76
$cn
->exec_sql(
"alter table tva_belge.assujetti_chld add ac_periode text"
);
77
78
$a
=
$cn
->exist_column(
'assujetti_chld'
,
'exercice'
,
'tva_belge'
);
79
if
(
$a
==
false
)
80
$cn
->exec_sql(
"alter table tva_belge.assujetti_chld add exercice text"
);
81
82
$a
=
$cn
->exist_column(
'declaration_amount'
,
'exercice'
,
'tva_belge'
);
83
if
(
$a
==
false
)
84
$cn
->exec_sql(
"alter table tva_belge.declaration_amount add exercice text"
);
85
86
$a
=
$cn
->exist_column(
'intracomm'
,
'exercice'
,
'tva_belge'
);
87
if
(
$a
==
false
)
88
$cn
->exec_sql(
"alter table tva_belge.intracomm add exercice text"
);
89
90
$a
=
$cn
->exist_column(
'assujetti'
,
'exercice'
,
'tva_belge'
);
91
if
(
$a
==
false
)
92
$cn
->exec_sql(
"alter table tva_belge.assujetti add exercice text"
);
93
if
(
$cn
->exist_table(
"version"
,
"tva_belge"
)==
false
)
94
{
95
96
$file
=dirname(__FILE__).
"/sql/patch2.sql"
;
97
$cn
->execute_script(
$file
);
98
if
(
$install
== 0 ) echo_warning(_(
"Mise à jour du plugin, pourriez-vous en vérifier le paramètrage ?"
));
99
$def
=5;
100
}
101
echo
'<div style="float:right"><a class="mtitle" style="font-size:140%" href="http://wiki.noalyss.eu/doku.php?id=tva" target="_blank">Aide</a>'
.
102
'<span style="font-size:0.8em;color:red;display:inline">vers:SVNINFO</span>'
.
103
'</div>'
;
104
// show menu
105
?>
106
<h2
class
=
"notice"
>Attention, ce plugin ne permet que le calcul TVA pour 2012 et régime transitoire en 2013, employez
107
plutôt l
'extension "rapport avancé"
108
</h2>
109
<?php
110
echo ShowItem($array,'
H
',"mtitle","mtitle",$def,'
style
=
"width:80%;margin-left:10%;border-spacing:5;"
');
111
?>
112
<div class="content" style="margin-left: 30px">
113
<?php
114
// include the right file
115
if ($def==1) {
116
require_once('
decl_tva.inc.php
');
117
exit();
118
}
119
120
/* Listing of all */
121
if ($def==4) {
122
require_once('
list_tva.inc.php
');
123
exit();
124
}
125
/* listing intracomm */
126
if ($def==2) {
127
require_once('
list_intra.inc.php
');
128
exit();
129
}
130
/* listing assujetti */
131
if ($def==3) {
132
require_once('
list_assujetti.inc.php
');
133
exit();
134
}
135
136
/* setting */
137
if ( $def==5) {
138
require_once('
tva_param.inc.php
');
139
exit();
140
}
141
?>
142
</div>
$version_plugin
global $version_plugin
Definition:
index.php:22
style
$note style
Definition:
ajax_add_key.php:32
$a
if($cn->exist_schema('tva_belge')==false) $a
Definition:
index.php:74
$_REQUEST
$_REQUEST['sa']
Definition:
index.php:68
$cn
$cn
Definition:
index.php:42
$sa
$sa
Definition:
index.php:67
$install
switch($sa) $install
Definition:
index.php:62
$def
$def
Definition:
index.php:69
$array
$array
Definition:
index.php:42
Install_Plugin
Definition:
class_install_plugin.php:27
$file
$file
Definition:
import_bank.php:60
$url
$url
Definition:
index.php:40
Generated on Wed Feb 1 2017 23:19:24 for Plugins by
1.8.6