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