noalyss Version-10
NOALYSS : serveur de comptabilité et ERP (2002)
Loading...
Searching...
No Matches
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_POSTCODE=$http->post("p_cp");
39 $m->MY_CITY=$http->post("p_commune");
40 $m->MY_PHONE=$http->post("p_tel");
41 $m->MY_FAX=$http->post("p_fax");
42 $m->MY_COUNTRY=$http->post("p_pays");
43 $m->MY_COUNTRY_CODE=$http->post("p_country_code");
44 $m->MY_CHECK_PERIODE=$http->post("p_check_periode");
45 $m->MY_DATE_SUGGEST=$http->post("p_date_suggest");
46 $m->MY_ANALYTIC=$http->post("p_compta");
47 $m->MY_STRICT=$http->post("p_strict");
48 $m->MY_TVA_USE=$http->post("p_tva_use");
49 $m->MY_PJ_SUGGEST=$http->post("p_pj");
50 $m->MY_ALPHANUM=$http->post("p_alphanum");
51 $m->MY_UPDLAB=$http->post("p_updlab");
52 $m->MY_STOCK=$http->post("p_stock");
53 //$m->MY_CURRENCY=$http->post("p_currency");
54 $m->MY_DEFAULT_ROUND_ERROR_DEB=$http->post("p_round_error_deb");
55 $m->MY_DEFAULT_ROUND_ERROR_CRED=$http->post("p_round_error_cred");
56 $m->MY_ANC_FILTER=$http->post("p_anc_filter");
57 $m->MY_REPORT=$http->post("p_report");
58 $m->MY_INVOICE_FORMAT=$http->post("invoice_format");
59 try
60 {
61 $m->update();
62 }
63 catch (Exception $e)
64 {
65 alert($e->getMessage());
66 }
67}
68
70///// Compta analytic
71$array=array(
72 array("value"=>"ob", 'label'=>_("obligatoire")),
73 array("value"=>"op", 'label'=>_("optionnel")),
74 array("value"=>"nu", 'label'=>_("non utilisé"))
75);
77 array('value'=>'N', 'label'=>_('Non')),
78 array('value'=>'Y', 'label'=>_('Oui'))
79);
80
81$alpha_num_array[0]=array('value'=>'N', 'label'=>_('Non'));
82$alpha_num_array[1]=array('value'=>'Y', 'label'=>_('Oui'));
83
84$updlab_array[0]=array('value'=>'N', 'label'=>_('Non'));
85$updlab_array[1]=array('value'=>'Y', 'label'=>_('Oui'));
86
88$compta->selected=$my->MY_ANALYTIC;
89
91$strict->selected=$my->MY_STRICT;
92
94$tva_use->selected=$my->MY_TVA_USE;
95
97$pj_suggest->selected=$my->MY_PJ_SUGGEST;
98
100$date_suggest->selected=$my->MY_DATE_SUGGEST;
101
103$check_periode->selected=$my->MY_CHECK_PERIODE;
106$alpha_num->selected=$my->MY_ALPHANUM;
107
110$updlab->selected=$my->MY_UPDLAB;
111
112$stock=new ISelect('p_stock');
113$stock->value=array(
114 array('value'=>'N', 'label'=>_('Non')),
115 array('value'=>'Y', 'label'=>_('Oui'))
116);
117$stock->selected=$my->MY_STOCK;
118
119$anc_filter=new IText("p_anc_filter", $my->MY_ANC_FILTER);
120$anc_filter->placeholder='6,7';
121$anc_filter->title=_("Uniquement des chiffres séparés par des virgules");
122
123$default_error_deb=new IPoste("p_round_error_deb", $my->MY_DEFAULT_ROUND_ERROR_DEB);
124$default_error_deb->name='p_round_error_deb';
125$default_error_deb->set_attribute('gDossier', Dossier::id());
126$default_error_deb->set_attribute('jrn', 0);
127$default_error_deb->set_attribute('account', 'p_round_error_deb');
128
129$default_error_cred=new IPoste("p_round_error_cred", $my->MY_DEFAULT_ROUND_ERROR_CRED);
130$default_error_cred->name='p_round_error_cred';
131$default_error_cred->set_attribute('gDossier', Dossier::id());
132$default_error_cred->set_attribute('jrn', 0);
133$default_error_cred->set_attribute('account', 'p_round_error_cred');
134
135$report=new ISelect('p_report');
136$report->value = array(
137 array('value'=>'N', 'label'=>_('Non')),
138 array('value'=>'Y', 'label'=>_('Oui'))
139);
140$report->selected=$my->MY_REPORT;
141
142// invoice format
143$select_format_invoice=$my->input_select_format();
144
145
146
147
148
149// other parameters
151$all->table=1;
152$all->style=' class="input_text"';
153?>
154<form method="post" >
155 <?= dossier::hidden(); ?>
156 <div class="row">
157
158
159 <div class="col">
160 <h2 class="h-section">Société</h2>
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_name"><?= _("Nom Société") ?></label>
168 <?= $all->input("p_name", $my->MY_NAME) ?>
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_tel"><?= _("Téléphone") ?></label>
177 <?= $all->input("p_tel", $my->MY_PHONE) ?>
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_fax"><?= _("Fax") ?></label>
186 <?= $all->input("p_fax", $my->MY_FAX) ?>
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_street"><?= _("Rue") ?></label>
195 <?= $all->input("p_street", $my->MY_STREET) ?>
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_no"><?= _("Numéro") ?></label>
204 <?= $all->input("p_no", $my->MY_NUMBER) ?>
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_cp"><?= _("Code Postal") ?></label>
213 <?= $all->input("p_cp", $my->MY_POSTCODE) ?>
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_commune"><?= _("Localité - Ville") ?></label>
222 <?= $all->input("p_commune", $my->MY_CITY) ?>
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_pays"><?= _("Pays") ?></label>
231 <?= $all->input("p_pays", $my->MY_COUNTRY) ?>
232 </div>
233 <div class="form-group">
234 <?php
236 $x=$cn->get_array("select cc_code,format('%s %s',cc_code,cc_name) str_name from country_code_ref order by 2,1");
237 $code= array_column($x, "str_name","cc_code");
238 $country_code->transform($code);
239 $country_code->selected=$my->MY_COUNTRY_CODE;
240 $all->table=1;
241 $all->style=' class="input_text"';
242 ?>
243 <label class="w-20" for="p_country_code"><?= _("Code Pays") ?></label>
244 <?= $country_code->input("p_country_code" ) ?>
245 </div>
246 <div class="form-group">
247 <?php
248 $all=new IText();
249 $all->table=1;
250 $all->style=' class="input_text"';
251 ?>
252 <label class="w-20" for="p_tva"><?= _("Numéro de Tva") ?></label>
253 <?= $all->input("p_tva", $my->MY_TVA) ?>
254 </div>
255
256 <div class="row">
257 <div class="col">
258 <h2 class="h-section">Paramètre supplémentaire</h2>
259 <?php
261 $object->create_js_script();
262 $object->display_table();
263 ?>
264 </div>
265 </div>
266
267 <div class="row">
268 <div class="col-4"></div>
269 <div class="col-4">
270 <?php
271 echo HtmlInput::submit("record_company", _("Sauve"), "", "button");
272 ?>
273
274 </div>
275 <div class="col-4"></div>
276 </div>
277 </div>
278
279 <div class="col">
280 <h2 class="h-section">Fonctionnement</h2>
281
282 <div class="form-group">
283 <label class="w-40" for="p_report">
284 <?= _("L'exercice commence par un report des soldes") ?></label>
286 <?= $report->input() ?>
287 </div>
288
289 <div class="form-group">
290 <label class="w-20" for="p_compta">
291<?= _("Utilisation de la compta. analytique") ?></label>
292 <?= $compta->input("p_compta", $array) ?>
293 </div>
294
295 <div class="form-group">
296 <label class="" for="p_anc_filter">
297<?= _("Opération analytique uniquement pour les postes comptables commençant par") ?>
298 </label>
299
300<?php
301echo $anc_filter->input();
302echo Icon_Action::tips($anc_filter->title);
303?>
304 </div>
305
306 <div class="form-group">
307 <label class="w-20" for="p_stock"><?= _("Utilisation des stocks") ?></label>
308<?= $stock->input() ?>
309 </div>
310
311 <div class="form-group">
312 <label class="w-20" for="p_strict"><?= _("Utilisation du mode strict ") ?></label>
313<?= $strict->input("p_strict", $strict_array) ?>
314 </div>
315
316
317 <div class="form-group">
318 <label class="w-20" for="p_tva_use"><?= _("Assujetti à la tva") ?></label>
319<?= $tva_use->input("p_tva_use", $strict_array) ?>
320 </div>
321
322 <div class="form-group">
323 <label class="w-20" for="p_pj"><?= _("Le numéro de pièce justificative") ?>
324 </label>
325 <?php
326 $receipt_array=array(["label"=>"Suggérer","value"=>"Y"],["label"=>"Automatique","value"=>"A"],["label"=>"Manuel","value"=>"N"]);
327 ?>
328 <?= $pj_suggest->input("p_pj", $receipt_array) ?>
329 </div>
330
331 <div class="form-group">
332 <label class="w-20" for="p_date_suggest"><?= _("Suggérer la date") ?></label>
333<?= $date_suggest->input("p_date_suggest", $strict_array) ?>
334 </div>
335
336
337 <div class="form-group">
338 <label class="w-20" for="p_check_periode"><?= _('Afficher la période comptable pour éviter les erreurs de date') ?>
339 </label>
340<?= $check_periode->input('p_check_periode', $strict_array) ?>
341 </div>
342
343
344 <div class="form-group">
345 <label class="w-20" for="p_alphanum">
346<?= _('Utilisez des postes comptables alphanumériques') ?>
347 </label>
348 <?= $alpha_num->input('p_alphanum') ?>
349 </div>
350
351 <div class="form-group">
352 <label class="w-20" for="p_updlab">
353<?= _('Changer le libellé des détails') ?>
354 </label>
355 <?= $updlab->input('p_updlab') ?>
356 </div>
357
358 <div class="form-group">
359 <label class="" for="p_round_error_deb">
360<?= _("Poste comptable de CHARGE (D) pour les différences d'arrondi pour les opérations en devise") ?>
361 </label>
362 <?= $default_error_deb->input() ?>
363 </div>
364
365 <div class="form-group">
366 <label class="" for="p_round_error_cred">
367<?= _("Poste comptable en PRODUIT (C) pour les différences d'arrondi pour les opérations en devise") ?>
368 </label>
369 <?= $default_error_cred->input() ?>
370 </div>
371
372 <div class="form-group">
373 <label class="" for="invoice_format">
374 <?= _("Format de facture par défaut") ?>
375 </label>
376 <?= $select_format_invoice->input() ?>
377 </div>
378 <div class="col-4"></div>
379
380 <div class="col-4">
381<?php
382echo HtmlInput::submit("record_company", _("Sauve"), "", "button");
383?>
384
385 </div>
386 <div class="col-4"></div>
387 </div>
388 </div>
389 </div>
390
391</form>
h2($p_string, $p_class="", $raw="")
Definition ac_common.php:68
alert($p_msg, $buffer=false)
alert in javascript
global $g_user
if no group available , then stop
$ret label
catch(Exception $e) $object
_("actif, passif,charge,...")
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 Text member :
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
$tva_use
$check_periode
$alpha_num
$strict_array
$alpha_num_array[0]
$compta
$select_format_invoice
$pj_suggest
$strict
$anc_filter
$stock
$country_code
$updlab
$updlab_array[0]
$receipt_array
$default_error_deb
$report
$default_error_cred
$date_suggest
$_POST['ac']
Definition do.php:323