noalyss
Version-9
include
company.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
// Copyright Author Dany De Bontridder danydb@aevalys.eu
20
/* !
21
* \file
22
* \brief Manage the company setting : address, vat number, Check period, VAT,
23
* CA ....
24
*/
25
if
(!defined(
'ALLOWED'
))
26
die(
'Appel direct ne sont pas permis'
);
27
28
global
$g_user
;
29
$http
=
new
HttpInput
();
30
echo
'<div class="content">'
;
31
if
(isset(
$_POST
[
'record_company'
]))
32
{
33
$m
=
new
Noalyss_Parameter_Folder
(
$cn
);
34
$m
->MY_NAME=
$http
->post(
"p_name"
);
35
$m
->MY_TVA=
$http
->post(
"p_tva"
);
36
$m
->MY_STREET=
$http
->post(
"p_street"
);
37
$m
->MY_NUMBER=
$http
->post(
"p_no"
);
38
$m
->MY_CP=
$http
->post(
"p_cp"
);
39
$m
->MY_COMMUNE=
$http
->post(
"p_commune"
);
40
$m
->MY_TEL=
$http
->post(
"p_tel"
);
41
$m
->MY_FAX=
$http
->post(
"p_fax"
);
42
$m
->MY_PAYS=
$http
->post(
"p_pays"
);
43
$m
->MY_CHECK_PERIODE=
$http
->post(
"p_check_periode"
);
44
$m
->MY_DATE_SUGGEST=
$http
->post(
"p_date_suggest"
);
45
$m
->MY_ANALYTIC=
$http
->post(
"p_compta"
);
46
$m
->MY_STRICT=
$http
->post(
"p_strict"
);
47
$m
->MY_TVA_USE=
$http
->post(
"p_tva_use"
);
48
$m
->MY_PJ_SUGGEST=
$http
->post(
"p_pj"
);
49
$m
->MY_ALPHANUM=
$http
->post(
"p_alphanum"
);
50
$m
->MY_UPDLAB=
$http
->post(
"p_updlab"
);
51
$m
->MY_STOCK=
$http
->post(
"p_stock"
);
52
//$m->MY_CURRENCY=$http->post("p_currency");
53
$m
->MY_DEFAULT_ROUND_ERROR_DEB=
$http
->post(
"p_round_error_deb"
);
54
$m
->MY_DEFAULT_ROUND_ERROR_CRED=
$http
->post(
"p_round_error_cred"
);
55
$m
->MY_ANC_FILTER=
$http
->post(
"p_anc_filter"
);
56
$m
->MY_REPORT=
$http
->post(
"p_report"
);
57
try
58
{
59
$m
->update();
60
}
61
catch
(Exception
$e
)
62
{
63
alert
(
$e
->getMessage());
64
}
65
}
66
67
$my
=
new
Noalyss_Parameter_Folder
(
$cn
);
68
///// Compta analytic
69
$array
=array(
70
array(
"value"
=>
"ob"
,
'label'
=>_(
"obligatoire"
)),
71
array(
"value"
=>
"op"
,
'label'
=>_(
"optionnel"
)),
72
array(
"value"
=>
"nu"
,
'label'
=>_(
"non utilisé"
))
73
);
74
$strict_array
=array(
75
array(
'value'
=>
'N'
,
'label'
=>_(
'Non'
)),
76
array(
'value'
=>
'Y'
,
'label'
=>_(
'Oui'
))
77
);
78
79
$alpha_num_array
[0]=array(
'value'
=>
'N'
,
'label'
=>_(
'Non'
));
80
$alpha_num_array
[1]=array(
'value'
=>
'Y'
,
'label'
=>_(
'Oui'
));
81
82
$updlab_array
[0]=array(
'value'
=>
'N'
,
'label'
=>_(
'Non'
));
83
$updlab_array
[1]=array(
'value'
=>
'Y'
,
'label'
=>_(
'Oui'
));
84
85
$compta
=
new
ISelect
();
86
$compta
->selected=
$my
->MY_ANALYTIC;
87
88
$strict
=
new
ISelect
();
89
$strict
->selected=
$my
->MY_STRICT;
90
91
$tva_use
=
new
ISelect
();
92
$tva_use
->selected=
$my
->MY_TVA_USE;
93
94
$pj_suggest
=
new
ISelect
();
95
$pj_suggest
->selected=
$my
->MY_PJ_SUGGEST;
96
97
$date_suggest
=
new
ISelect
();
98
$date_suggest
->selected=
$my
->MY_DATE_SUGGEST;
99
100
$check_periode
=
new
ISelect
();
101
$check_periode
->selected=
$my
->MY_CHECK_PERIODE;
102
$alpha_num
=
new
ISelect
();
103
$alpha_num
->value=
$alpha_num_array
;
104
$alpha_num
->selected=
$my
->MY_ALPHANUM;
105
106
$updlab
=
new
ISelect
();
107
$updlab
->value=
$updlab_array
;
108
$updlab
->selected=
$my
->MY_UPDLAB;
109
110
$stock
=
new
ISelect
(
'p_stock'
);
111
$stock
->value=array(
112
array(
'value'
=>
'N'
,
'label'
=>_(
'Non'
)),
113
array(
'value'
=>
'Y'
,
'label'
=>_(
'Oui'
))
114
);
115
$stock
->selected=
$my
->MY_STOCK;
116
117
$anc_filter
=
new
IText
(
"p_anc_filter"
,
$my
->MY_ANC_FILTER);
118
$anc_filter
->placeholder=
'6,7'
;
119
$anc_filter
->title=_(
"Uniquement des chiffres séparés par des virgules"
);
120
121
$default_error_deb
=
new
IPoste
(
"p_round_error_deb"
,
$my
->MY_DEFAULT_ROUND_ERROR_DEB);
122
$default_error_deb
->name=
'p_round_error_deb'
;
123
$default_error_deb
->set_attribute(
'gDossier'
,
Dossier::id
());
124
$default_error_deb
->set_attribute(
'jrn'
, 0);
125
$default_error_deb
->set_attribute(
'account'
,
'p_round_error_deb'
);
126
127
$default_error_cred
=
new
IPoste
(
"p_round_error_cred"
,
$my
->MY_DEFAULT_ROUND_ERROR_CRED);
128
$default_error_cred
->name=
'p_round_error_cred'
;
129
$default_error_cred
->set_attribute(
'gDossier'
,
Dossier::id
());
130
$default_error_cred
->set_attribute(
'jrn'
, 0);
131
$default_error_cred
->set_attribute(
'account'
,
'p_round_error_cred'
);
132
133
$report
=
new
ISelect
(
'p_report'
);
134
$report
->value = array(
135
array(
'value'
=>
'N'
,
'label'
=>_(
'Non'
)),
136
array(
'value'
=>
'Y'
,
'label'
=>_(
'Oui'
))
137
);
138
$report
->selected=
$my
->MY_REPORT;
139
140
// other parameters
141
$all
=
new
IText
();
142
$all
->table=1;
143
$all
->style=
' class="input_text"'
;
144
?>
145
<form method=
"post"
>
146
<?= dossier::hidden(); ?>
147
<div
class
=
"row"
>
148
149
150
<div
class
=
"col"
>
151
<
h2
>Société</
h2
>
152
<div
class
=
"form-group"
>
153
<?php
154
$all
=
new
IText
();
155
$all
->table=1;
156
$all
->style=
' class="input_text"'
;
157
?>
158
<
label
class
=
"w-20"
for
=
"p_name"
><?= _(
"Nom Société"
) ?></
label
>
159
<?=
$all
->input(
"p_name"
,
$my
->MY_NAME) ?>
160
</div>
161
<div
class
=
"form-group"
>
162
<?php
163
$all
=
new
IText
();
164
$all
->table=1;
165
$all
->style=
' class="input_text"'
;
166
?>
167
<
label
class
=
"w-20"
for
=
"p_tel"
><?= _(
"Téléphone"
) ?></
label
>
168
<?=
$all
->input(
"p_tel"
,
$my
->MY_TEL) ?>
169
</div>
170
<div
class
=
"form-group"
>
171
<?php
172
$all
=
new
IText
();
173
$all
->table=1;
174
$all
->style=
' class="input_text"'
;
175
?>
176
<
label
class
=
"w-20"
for
=
"p_fax"
><?= _(
"Fax"
) ?></
label
>
177
<?=
$all
->input(
"p_fax"
,
$my
->MY_FAX) ?>
178
</div>
179
<div
class
=
"form-group"
>
180
<?php
181
$all
=
new
IText
();
182
$all
->table=1;
183
$all
->style=
' class="input_text"'
;
184
?>
185
<
label
class
=
"w-20"
for
=
"p_street"
><?= _(
"Rue"
) ?></
label
>
186
<?=
$all
->input(
"p_street"
,
$my
->MY_STREET) ?>
187
</div>
188
<div
class
=
"form-group"
>
189
<?php
190
$all
=
new
IText
();
191
$all
->table=1;
192
$all
->style=
' class="input_text"'
;
193
?>
194
<
label
class
=
"w-20"
for
=
"p_no"
><?= _(
"Numéro"
) ?></
label
>
195
<?=
$all
->input(
"p_no"
,
$my
->MY_NUMBER) ?>
196
</div>
197
<div
class
=
"form-group"
>
198
<?php
199
$all
=
new
IText
();
200
$all
->table=1;
201
$all
->style=
' class="input_text"'
;
202
?>
203
<
label
class
=
"w-20"
for
=
"p_cp"
><?= _(
"Code Postal"
) ?></
label
>
204
<?=
$all
->input(
"p_cp"
,
$my
->MY_CP) ?>
205
</div>
206
<div
class
=
"form-group"
>
207
<?php
208
$all
=
new
IText
();
209
$all
->table=1;
210
$all
->style=
' class="input_text"'
;
211
?>
212
<
label
class
=
"w-20"
for
=
"p_commune"
><?= _(
"Localité"
) ?></
label
>
213
<?=
$all
->input(
"p_commune"
,
$my
->MY_COMMUNE) ?>
214
</div>
215
<div
class
=
"form-group"
>
216
<?php
217
$all
=
new
IText
();
218
$all
->table=1;
219
$all
->style=
' class="input_text"'
;
220
?>
221
<
label
class
=
"w-20"
for
=
"p_pays"
><?= _(
"Pays"
) ?></
label
>
222
<?=
$all
->input(
"p_pays"
,
$my
->MY_PAYS) ?>
223
</div>
224
<div
class
=
"form-group"
>
225
<?php
226
$all
=
new
IText
();
227
$all
->table=1;
228
$all
->style=
' class="input_text"'
;
229
?>
230
<
label
class
=
"w-20"
for
=
"p_tva"
><?= _(
"Numéro de Tva"
) ?></
label
>
231
<?=
$all
->input(
"p_tva"
,
$my
->MY_TVA) ?>
232
</div>
233
234
<div
class
=
"row"
>
235
<div
class
=
"col"
>
236
<
h2
>Paramètre supplémentaire</
h2
>
237
<?php
238
$object
=
Parameter_Extra_MTable::build
();
239
$object
->create_js_script();
240
$object
->display_table();
241
?>
242
</div>
243
</div>
244
245
<div
class
=
"row"
>
246
<div
class
=
"col-4"
></div>
247
<div
class
=
"col-4"
>
248
<?php
249
echo
HtmlInput::submit
(
"record_company"
, _(
"Sauve"
),
""
,
"button"
);
250
?>
251
252
</div>
253
<div
class
=
"col-4"
></div>
254
</div>
255
</div>
256
257
<div
class
=
"col"
>
258
<
h2
>Fonctionnement</
h2
>
259
260
<div
class
=
"form-group"
>
261
<
label
class
=
"w-40"
for
=
"p_report"
>
262
<?= _(
"L'exercice commence par un report des soldes"
) ?></
label
>
263
<?=
Icon_Action::infobulle
(84)?>
264
<?=
$report
->input() ?>
265
</div>
266
267
<div
class
=
"form-group"
>
268
<
label
class
=
"w-20"
for
=
"p_compta"
>
269
<?= _(
"Utilisation de la compta. analytique"
) ?></
label
>
270
<?=
$compta
->input(
"p_compta"
,
$array
) ?>
271
</div>
272
273
<div
class
=
"form-group"
>
274
<
label
class
=
""
for
=
"p_anc_filter"
>
275
<?= _(
"Opération analytique uniquement pour les postes comptables commençant par"
) ?>
276
</
label
>
277
278
<?php
279
echo
$anc_filter
->input();
280
echo
Icon_Action::tips
(
$anc_filter
->title);
281
?>
282
</div>
283
284
<div
class
=
"form-group"
>
285
<
label
class
=
"w-20"
for
=
"p_stock"
><?= _(
"Utilisation des stocks"
) ?></
label
>
286
<?=
$stock
->input() ?>
287
</div>
288
289
<div
class
=
"form-group"
>
290
<
label
class
=
"w-20"
for
=
"p_strict"
><?= _(
"Utilisation du mode strict "
) ?></
label
>
291
<?=
$strict
->input(
"p_strict"
,
$strict_array
) ?>
292
</div>
293
294
295
<div
class
=
"form-group"
>
296
<
label
class
=
"w-20"
for
=
"p_tva_use"
><?= _(
"Assujetti à la tva"
) ?></
label
>
297
<?=
$tva_use
->input(
"p_tva_use"
,
$strict_array
) ?>
298
</div>
299
300
<div
class
=
"form-group"
>
301
<
label
class
=
"w-20"
for
=
"p_pj"
><?= _(
"Le numéro de pièce justificative"
) ?>
302
</
label
>
303
<?php
304
$receipt_array
=array([
"label"
=>
"Suggérer"
,
"value"
=>
"Y"
],[
"label"
=>
"Automatique"
,
"value"
=>
"A"
],[
"label"
=>
"Manuel"
,
"value"
=>
"N"
]);
305
?>
306
<?=
$pj_suggest
->input(
"p_pj"
,
$receipt_array
) ?>
307
</div>
308
309
<div
class
=
"form-group"
>
310
<
label
class
=
"w-20"
for
=
"p_date_suggest"
><?= _(
"Suggérer la date"
) ?></
label
>
311
<?=
$date_suggest
->input(
"p_date_suggest"
,
$strict_array
) ?>
312
</div>
313
314
315
<div
class
=
"form-group"
>
316
<
label
class
=
"w-20"
for
=
"p_check_periode"
><?= _(
'Afficher la période comptable pour éviter les erreurs de date'
) ?>
317
</
label
>
318
<?=
$check_periode
->input(
'p_check_periode'
,
$strict_array
) ?>
319
</div>
320
321
322
<div
class
=
"form-group"
>
323
<
label
class
=
"w-20"
for
=
"p_alphanum"
>
324
<?= _(
'Utilisez des postes comptables alphanumérique'
) ?>
325
</
label
>
326
<?=
$alpha_num
->input(
'p_alphanum'
) ?>
327
</div>
328
329
<div
class
=
"form-group"
>
330
<
label
class
=
"w-20"
for
=
"p_updlab"
>
331
<?= _(
'Changer le libellé des détails'
) ?>
332
</
label
>
333
<?=
$updlab
->input(
'p_updlab'
) ?>
334
</div>
335
336
<div
class
=
"form-group"
>
337
<
label
class
=
""
for
=
"p_round_error_deb"
>
338
<?= _(
"Poste comptable de CHARGE (D) pour les différences d'arrondi pour les opérations en devise"
) ?>
339
</
label
>
340
<?=
$default_error_deb
->input() ?>
341
</div>
342
343
<div
class
=
"form-group"
>
344
<
label
class
=
""
for
=
"p_round_error_cred"
>
345
<?= _(
"Poste comptable en PRODUIT (C) pour les différences d'arrondi pour les opérations en devise"
) ?>
346
</
label
>
347
<?=
$default_error_cred
->input() ?>
348
</div>
349
350
351
<div
class
=
"col-4"
></div>
352
353
<div
class
=
"col-4"
>
354
<?php
355
echo
HtmlInput::submit
(
"record_company"
, _(
"Sauve"
),
""
,
"button"
);
356
?>
357
358
</div>
359
<div
class
=
"col-4"
></div>
360
</div>
361
</div>
362
</div>
363
364
</form>
h2
h2($p_string, $p_class="", $raw="")
Definition:
ac_common.php:68
alert
alert($p_msg, $buffer=false)
alert in javascript
Definition:
ac_common.php:738
$cn
$cn
Definition:
ajax_anc_accounting.php:30
$m
$m
Definition:
ajax_create_menu.php:11
label
$ret label
Definition:
ajax_display_letter.php:52
Dossier\id
static id()
return the 'gDossier' value after a check
Definition:
dossier.class.php:61
HtmlInput\submit
static submit($p_name, $p_value, $p_javascript="", $p_class="smallbutton")
Definition:
html_input.class.php:211
HttpInput
manage the http input (get , post, request) and extract from an array
Definition:
http_input.class.php:38
IPoste
show a button, for selecting a account and a input text for manually inserting an account the differe...
Definition:
iposte.class.php:75
ISelect
Html Input , create a tag <SELECT> ... </SELECT> if readonly == true then display the label correspon...
Definition:
iselect.class.php:40
IText
Html Input.
Definition:
itext.class.php:30
Icon_Action\tips
static tips($p_comment)
Display a info in a bubble, text is given as parameter.
Definition:
icon_action.class.php:111
Icon_Action\infobulle
static infobulle($p_comment)
Display a info in a bubble, text is in message_javascript.
Definition:
icon_action.class.php:97
Noalyss_Parameter_Folder
Class to manage the company parameter (address, name...)
Definition:
noalyss_parameter_folder.class.php:28
Parameter_Extra_MTable\build
static build($p_id=-1)
Definition:
parameter_extra_mtable.class.php:42
$my
if(isset($_POST['record_company'])) $my
Definition:
company.inc.php:67
$tva_use
$tva_use
Definition:
company.inc.php:91
$check_periode
$check_periode
Definition:
company.inc.php:100
$alpha_num
$alpha_num
Definition:
company.inc.php:102
$strict_array
$strict_array
Definition:
company.inc.php:74
$all
$all
Definition:
company.inc.php:141
$alpha_num_array
$alpha_num_array[0]
Definition:
company.inc.php:79
$g_user
global $g_user
Definition:
company.inc.php:28
$object
$object
Definition:
company.inc.php:238
$compta
$compta
Definition:
company.inc.php:85
$http
$http
Definition:
company.inc.php:29
$pj_suggest
$pj_suggest
Definition:
company.inc.php:94
$strict
$strict
Definition:
company.inc.php:88
$anc_filter
$anc_filter
Definition:
company.inc.php:117
$stock
$stock
Definition:
company.inc.php:110
$array
$array
Definition:
company.inc.php:69
$updlab
$updlab
Definition:
company.inc.php:106
$updlab_array
$updlab_array[0]
Definition:
company.inc.php:82
$receipt_array
$receipt_array
Definition:
company.inc.php:304
$default_error_deb
$default_error_deb
Definition:
company.inc.php:121
$report
$report
Definition:
company.inc.php:133
$default_error_cred
$default_error_cred
Definition:
company.inc.php:127
$date_suggest
$date_suggest
Definition:
company.inc.php:97
$_POST
$_POST['ac']
Definition:
do.php:310
$e
$e
Definition:
result_cat_card_summary.php:26