noalyss Version-9
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 */
25if (!defined('ALLOWED'))
26 die('Appel direct ne sont pas permis');
27
28global $g_user;
30echo '<div class="content">';
31if (isset($_POST['record_company']))
32{
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
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);
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
86$compta->selected=$my->MY_ANALYTIC;
87
89$strict->selected=$my->MY_STRICT;
90
92$tva_use->selected=$my->MY_TVA_USE;
93
95$pj_suggest->selected=$my->MY_PJ_SUGGEST;
96
98$date_suggest->selected=$my->MY_DATE_SUGGEST;
99
101$check_periode->selected=$my->MY_CHECK_PERIODE;
104$alpha_num->selected=$my->MY_ALPHANUM;
105
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
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
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>
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
279echo $anc_filter->input();
280echo 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
355echo 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($p_string, $p_class="", $raw="")
Definition: ac_common.php:68
alert($p_msg, $buffer=false)
alert in javascript
Definition: ac_common.php:738
$ret label
static id()
return the 'gDossier' value after a check
static submit($p_name, $p_value, $p_javascript="", $p_class="smallbutton")
manage the http input (get , post, request) and extract from an array
show a button, for selecting a account and a input text for manually inserting an account the differe...
Html Input , create a tag <SELECT> ... </SELECT> if readonly == true then display the label correspon...
Html Input.
Definition: itext.class.php:30
static tips($p_comment)
Display a info in a bubble, text is given as parameter.
static infobulle($p_comment)
Display a info in a bubble, text is in message_javascript.
Class to manage the company parameter (address, name...)
if(isset($_POST['record_company'])) $my
Definition: company.inc.php:67
$tva_use
Definition: company.inc.php:91
$check_periode
$alpha_num
$strict_array
Definition: company.inc.php:74
$all
$alpha_num_array[0]
Definition: company.inc.php:79
global $g_user
Definition: company.inc.php:28
$object
$compta
Definition: company.inc.php:85
$http
Definition: company.inc.php:29
$pj_suggest
Definition: company.inc.php:94
$strict
Definition: company.inc.php:88
$anc_filter
$stock
$array
Definition: company.inc.php:69
$updlab
$updlab_array[0]
Definition: company.inc.php:82
$receipt_array
$default_error_deb
$report
$default_error_cred
$date_suggest
Definition: company.inc.php:97
$_POST['ac']
Definition: do.php:310