dolibarr 19.0.3
index.php
Go to the documentation of this file.
1<?php
2/* Copyright (C) 2013-2014 Olivier Geffroy <jeff@jeffinfo.com>
3 * Copyright (C) 2013-2014 Florian Henry <florian.henry@open-concept.pro>
4 * Copyright (C) 2013-2024 Alexandre Spangaro <aspangaro@easya.solutions>
5 * Copyright (C) 2014-2015 Ari Elbaz (elarifr) <github@accedinfo.com>
6 * Copyright (C) 2014 Marcos García <marcosgdf@gmail.com>
7 * Copyright (C) 2014 Juanjo Menent <jmenent@2byte.es>
8 * Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
9 * Copyright (C) 2017 Laurent Destailleur <eldy@destailleur.fr>
10 * Copyright (C) 2021 Ferran Marcet <fmarcet@2byte.es>
11 *
12 * This program is free software; you can redistribute it and/or modify
13 * it under the terms of the GNU General Public License as published by
14 * the Free Software Foundation; either version 3 of the License, or
15 * (at your option) any later version.
16 *
17 * This program is distributed in the hope that it will be useful,
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 * GNU General Public License for more details.
21 *
22 * You should have received a copy of the GNU General Public License
23 * along with this program. If not, see <https://www.gnu.org/licenses/>.
24 */
25
32// Load Dolibarr environment
33require '../../main.inc.php';
34require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
35require_once DOL_DOCUMENT_ROOT.'/core/lib/accounting.lib.php';
36require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
37
38// Load translation files required by the page
39$langs->loadLangs(array("compta", "bills", "admin", "accountancy", "other"));
40
41// Security access
42if (!$user->hasRight('accounting', 'chartofaccount')) {
44}
45
46$action = GETPOST('action', 'aZ09');
47
48$nbletter = GETPOST('ACCOUNTING_LETTERING_NBLETTERS', 'int');
49
50// Parameters ACCOUNTING_* and others
51$list = array(
52 'ACCOUNTING_LENGTH_GACCOUNT',
53 'ACCOUNTING_LENGTH_AACCOUNT',
54// 'ACCOUNTING_LIMIT_LIST_VENTILATION' // there is already a global parameter to define the nb of records in lists, we must use it in priority. Having one parameter for nb of record for each page is deprecated.
55// 'ACCOUNTING_LENGTH_DESCRIPTION', // adjust size displayed for lines description for dol_trunc
56// 'ACCOUNTING_LENGTH_DESCRIPTION_ACCOUNT', // adjust size displayed for select account description for dol_trunc
57);
58
59$list_binding = array(
60 'ACCOUNTING_DEFAULT_PERIOD_ON_TRANSFER',
61 'ACCOUNTING_DATE_START_BINDING',
62);
63
64$error = 0;
65
66
67/*
68 * Actions
69 */
70
71if (in_array($action, array('setBANK_DISABLE_DIRECT_INPUT', 'setACCOUNTANCY_COMBO_FOR_AUX', 'setACCOUNTING_MANAGE_ZERO'))) {
72 $constname = preg_replace('/^set/', '', $action);
73 $constvalue = GETPOST('value', 'int');
74 $res = dolibarr_set_const($db, $constname, $constvalue, 'yesno', 0, '', $conf->entity);
75 if (!($res > 0)) {
76 $error++;
77 }
78
79 if (!$error) {
80 setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
81 } else {
82 setEventMessages($langs->trans("Error"), null, 'mesgs');
83 }
84}
85
86if ($action == 'update') {
87 $error = 0;
88
89 if (!$error) {
90 foreach ($list as $constname) {
91 $constvalue = GETPOST($constname, 'alpha');
92 if (!dolibarr_set_const($db, $constname, $constvalue, 'chaine', 0, '', $conf->entity)) {
93 $error++;
94 }
95 }
96 if ($error) {
97 setEventMessages($langs->trans("Error"), null, 'errors');
98 }
99
100 // option in section binding
101 foreach ($list_binding as $constname) {
102 $constvalue = GETPOST($constname, 'alpha');
103
104 if ($constname == 'ACCOUNTING_DATE_START_BINDING') {
105 $constvalue = dol_mktime(0, 0, 0, GETPOST($constname.'month', 'int'), GETPOST($constname.'day', 'int'), GETPOST($constname.'year', 'int'));
106 }
107
108 if (!dolibarr_set_const($db, $constname, $constvalue, 'chaine', 0, '', $conf->entity)) {
109 $error++;
110 }
111 }
112
113 // options in section other
114 if (GETPOSTISSET('ACCOUNTING_LETTERING_NBLETTERS')) {
115 if (!dolibarr_set_const($db, 'ACCOUNTING_LETTERING_NBLETTERS', GETPOST('ACCOUNTING_LETTERING_NBLETTERS'), 'chaine', 0, '', $conf->entity)) {
116 $error++;
117 }
118 }
119
120 if ($error) {
121 setEventMessages($langs->trans("Error"), null, 'errors');
122 }
123 }
124
125 if (!$error) {
126 setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
127 }
128}
129
130if ($action == 'setmanagezero') {
131 $setmanagezero = GETPOST('value', 'int');
132 $res = dolibarr_set_const($db, "ACCOUNTING_MANAGE_ZERO", $setmanagezero, 'yesno', 0, '', $conf->entity);
133 if (!($res > 0)) {
134 $error++;
135 }
136
137 if (!$error) {
138 setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
139 } else {
140 setEventMessages($langs->trans("Error"), null, 'mesgs');
141 }
142}
143
144if ($action == 'setdisabledirectinput') {
145 $setdisabledirectinput = GETPOST('value', 'int');
146 $res = dolibarr_set_const($db, "BANK_DISABLE_DIRECT_INPUT", $setdisabledirectinput, 'yesno', 0, '', $conf->entity);
147 if (!($res > 0)) {
148 $error++;
149 }
150
151 if (!$error) {
152 setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
153 } else {
154 setEventMessages($langs->trans("Error"), null, 'mesgs');
155 }
156}
157
158if ($action == 'setenabledraftexport') {
159 $setenabledraftexport = GETPOST('value', 'int');
160 $res = dolibarr_set_const($db, "ACCOUNTING_ENABLE_EXPORT_DRAFT_JOURNAL", $setenabledraftexport, 'yesno', 0, '', $conf->entity);
161 if (!($res > 0)) {
162 $error++;
163 }
164
165 if (!$error) {
166 setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
167 } else {
168 setEventMessages($langs->trans("Error"), null, 'mesgs');
169 }
170}
171
172if ($action == 'setenablesubsidiarylist') {
173 $setenablesubsidiarylist = GETPOST('value', 'int');
174 $res = dolibarr_set_const($db, "ACCOUNTANCY_COMBO_FOR_AUX", $setenablesubsidiarylist, 'yesno', 0, '', $conf->entity);
175 if (!($res > 0)) {
176 $error++;
177 }
178
179 if (!$error) {
180 setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
181 } else {
182 setEventMessages($langs->trans("Error"), null, 'mesgs');
183 }
184}
185
186if ($action == 'setdisablebindingonsales') {
187 $setdisablebindingonsales = GETPOST('value', 'int');
188 $res = dolibarr_set_const($db, "ACCOUNTING_DISABLE_BINDING_ON_SALES", $setdisablebindingonsales, 'yesno', 0, '', $conf->entity);
189 if (!($res > 0)) {
190 $error++;
191 }
192
193 if (!$error) {
194 setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
195 } else {
196 setEventMessages($langs->trans("Error"), null, 'mesgs');
197 }
198}
199
200if ($action == 'setdisablebindingonpurchases') {
201 $setdisablebindingonpurchases = GETPOST('value', 'int');
202 $res = dolibarr_set_const($db, "ACCOUNTING_DISABLE_BINDING_ON_PURCHASES", $setdisablebindingonpurchases, 'yesno', 0, '', $conf->entity);
203 if (!($res > 0)) {
204 $error++;
205 }
206
207 if (!$error) {
208 setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
209 } else {
210 setEventMessages($langs->trans("Error"), null, 'mesgs');
211 }
212}
213
214if ($action == 'setdisablebindingonexpensereports') {
215 $setdisablebindingonexpensereports = GETPOST('value', 'int');
216 $res = dolibarr_set_const($db, "ACCOUNTING_DISABLE_BINDING_ON_EXPENSEREPORTS", $setdisablebindingonexpensereports, 'yesno', 0, '', $conf->entity);
217 if (!($res > 0)) {
218 $error++;
219 }
220
221 if (!$error) {
222 setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
223 } else {
224 setEventMessages($langs->trans("Error"), null, 'mesgs');
225 }
226}
227
228if ($action == 'setenablelettering') {
229 $setenablelettering = GETPOST('value', 'int');
230 $res = dolibarr_set_const($db, "ACCOUNTING_ENABLE_LETTERING", $setenablelettering, 'yesno', 0, '', $conf->entity);
231 if (!($res > 0)) {
232 $error++;
233 }
234
235 if (!$error) {
236 setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
237 } else {
238 setEventMessages($langs->trans("Error"), null, 'mesgs');
239 }
240}
241
242if ($action == 'setenableautolettering') {
243 $setenableautolettering = GETPOST('value', 'int');
244 $res = dolibarr_set_const($db, "ACCOUNTING_ENABLE_AUTOLETTERING", $setenableautolettering, 'yesno', 0, '', $conf->entity);
245 if (!($res > 0)) {
246 $error++;
247 }
248
249 if (!$error) {
250 setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
251 } else {
252 setEventMessages($langs->trans("Error"), null, 'mesgs');
253 }
254}
255
256if ($action == 'setenablevatreversecharge') {
257 $setenablevatreversecharge = GETPOST('value', 'int');
258 $res = dolibarr_set_const($db, "ACCOUNTING_FORCE_ENABLE_VAT_REVERSE_CHARGE", $setenablevatreversecharge, 'yesno', 0, '', $conf->entity);
259 if (!($res > 0)) {
260 $error++;
261 }
262
263 if (!$error) {
264 setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
265 } else {
266 setEventMessages($langs->trans("Error"), null, 'mesgs');
267 }
268}
269
270
271/*
272 * View
273 */
274
275$form = new Form($db);
276
277$title = $langs->trans('ConfigAccountingExpert');
278$help_url = 'EN:Module_Double_Entry_Accounting#Setup|FR:Module_Comptabilit&eacute;_en_Partie_Double#Configuration';
279llxHeader('', $title, $help_url);
280
281
282$linkback = '';
283//$linkback = '<a href="' . DOL_URL_ROOT . '/admin/modules.php?restore_lastsearch_values=1">' . $langs->trans("BackToModuleList") . '</a>';
284print load_fiche_titre($title, $linkback, 'accountancy');
285
286print '<br>';
287
288// Show message if accountancy hidden options are activated to help to resolve some problems
289if (!$user->admin) {
290 if (getDolGlobalString('FACTURE_DEPOSITS_ARE_JUST_PAYMENTS')) {
291 print '<div class="info">' . $langs->trans("ConstantIsOn", "FACTURE_DEPOSITS_ARE_JUST_PAYMENTS") . '</div>';
292 }
293 if (getDolGlobalString('FACTURE_SUPPLIER_DEPOSITS_ARE_JUST_PAYMENTS')) {
294 print '<div class="info">' . $langs->trans("ConstantIsOn", "FACTURE_SUPPLIER_DEPOSITS_ARE_JUST_PAYMENTS") . '</div>';
295 }
296 if (getDolGlobalString('ACCOUNTANCY_USE_PRODUCT_ACCOUNT_ON_THIRDPARTY')) {
297 print '<div class="info">' . $langs->trans("ConstantIsOn", "ACCOUNTANCY_USE_PRODUCT_ACCOUNT_ON_THIRDPARTY") . '</div>';
298 }
299 if (getDolGlobalString('MAIN_COMPANY_PERENTITY_SHARED')) {
300 print '<div class="info">' . $langs->trans("ConstantIsOn", "MAIN_COMPANY_PERENTITY_SHARED") . '</div>';
301 }
302 if (getDolGlobalString('MAIN_PRODUCT_PERENTITY_SHARED')) {
303 print '<div class="info">' . $langs->trans("ConstantIsOn", "MAIN_PRODUCT_PERENTITY_SHARED") . '</div>';
304 }
305}
306
307print '<form action="'.$_SERVER["PHP_SELF"].'" method="post">';
308print '<input type="hidden" name="token" value="'.newToken().'">';
309print '<input type="hidden" name="action" value="update">';
310
311// Params
312print '<div class="div-table-responsive-no-min">';
313print '<table class="noborder centpercent">';
314print '<tr class="liste_titre">';
315print '<td colspan="2">'.$langs->trans('Options').'</td>';
316print "</tr>\n";
317
318// TO DO Mutualize code for yes/no constants
319
320/* Set this option as a hidden option but keep it for some needs.
321print '<tr>';
322print '<td>'.$langs->trans("ACCOUNTING_ENABLE_EXPORT_DRAFT_JOURNAL").'</td>';
323if (getDolGlobalString('ACCOUNTING_ENABLE_EXPORT_DRAFT_JOURNAL')) {
324 print '<td class="right"><a class="reposition" href="'.$_SERVER['PHP_SELF'].'?token='.newToken().'&enabledraftexport&value=0">';
325 print img_picto($langs->trans("Activated"), 'switch_on');
326 print '</a></td>';
327} else {
328 print '<td class="right"><a class="reposition" href="'.$_SERVER['PHP_SELF'].'?token='.newToken().'&enabledraftexport&value=1">';
329 print img_picto($langs->trans("Disabled"), 'switch_off');
330 print '</a></td>';
331}
332print '</tr>';
333*/
334
335print '<tr class="oddeven">';
336print '<td>'.$langs->trans("BANK_DISABLE_DIRECT_INPUT").'</td>';
337if (getDolGlobalString('BANK_DISABLE_DIRECT_INPUT')) {
338 print '<td class="right"><a class="reposition" href="'.$_SERVER['PHP_SELF'].'?token='.newToken().'&action=setBANK_DISABLE_DIRECT_INPUT&value=0">';
339 print img_picto($langs->trans("Activated"), 'switch_on');
340 print '</a></td>';
341} else {
342 print '<td class="right"><a class="reposition" href="'.$_SERVER['PHP_SELF'].'?token='.newToken().'&action=setBANK_DISABLE_DIRECT_INPUT&value=1">';
343 print img_picto($langs->trans("Disabled"), 'switch_off');
344 print '</a></td>';
345}
346print '</tr>';
347
348print '<tr class="oddeven">';
349print '<td>'.$langs->trans("ACCOUNTANCY_COMBO_FOR_AUX");
350print ' - <span class="opacitymedium">'.$langs->trans("NotRecommended").'</span>';
351print '</td>';
352
353if (getDolGlobalString('ACCOUNTANCY_COMBO_FOR_AUX')) {
354 print '<td class="right"><a class="reposition" href="'.$_SERVER['PHP_SELF'].'?token='.newToken().'&action=setACCOUNTANCY_COMBO_FOR_AUX&value=0">';
355 print img_picto($langs->trans("Activated"), 'switch_on');
356 print '</a></td>';
357} else {
358 print '<td class="right"><a class="reposition" href="'.$_SERVER['PHP_SELF'].'?token='.newToken().'&action=setACCOUNTANCY_COMBO_FOR_AUX&value=1">';
359 print img_picto($langs->trans("Disabled"), 'switch_off');
360 print '</a></td>';
361}
362print '</tr>';
363
364print '<tr class="oddeven">';
365print '<td>'.$langs->trans("ACCOUNTING_MANAGE_ZERO").'</td>';
366if (getDolGlobalInt('ACCOUNTING_MANAGE_ZERO')) {
367 print '<td class="right"><a class="reposition" href="'.$_SERVER['PHP_SELF'].'?token='.newToken().'&action=setACCOUNTING_MANAGE_ZERO&value=0">';
368 print img_picto($langs->trans("Activated"), 'switch_on');
369 print '</a></td>';
370} else {
371 print '<td class="right"><a class="reposition" href="'.$_SERVER['PHP_SELF'].'?token='.newToken().'&action=setACCOUNTING_MANAGE_ZERO&value=1">';
372 print img_picto($langs->trans("Disabled"), 'switch_off');
373 print '</a></td>';
374}
375print '</tr>';
376
377// Param a user $user->rights->accounting->chartofaccount can access
378foreach ($list as $key) {
379 print '<tr class="oddeven value">';
380
381 if (getDolGlobalInt('ACCOUNTING_MANAGE_ZERO') && ($key == 'ACCOUNTING_LENGTH_GACCOUNT' || $key == 'ACCOUNTING_LENGTH_AACCOUNT')) {
382 continue;
383 }
384
385 // Param
386 $label = $langs->trans($key);
387 print '<td>'.$label.'</td>';
388 // Value
389 print '<td class="right">';
390 print '<input type="text" class="maxwidth50 right" id="'.$key.'" name="'.$key.'" value="'.getDolGlobalString($key).'">';
391
392 print '</td>';
393 print '</tr>';
394}
395print '</table>';
396print '</div>';
397
398print '<br>';
399
400// Binding params
401print '<div class="div-table-responsive-no-min">';
402print '<table class="noborder centpercent">';
403print '<tr class="liste_titre">';
404print '<td colspan="2">'.$langs->trans('BindingOptions').'</td>';
405print "</tr>\n";
406
407// Param a user $user->rights->accounting->chartofaccount can access
408foreach ($list_binding as $key) {
409 print '<tr class="oddeven value">';
410
411 // Param
412 $label = $langs->trans($key);
413 print '<td>'.$label.'</td>';
414 // Value
415 print '<td class="right minwidth75imp parentonrightofpage">';
416 if ($key == 'ACCOUNTING_DATE_START_BINDING') {
417 print $form->selectDate((getDolGlobalInt($key) ? (int) getDolGlobalInt($key) : -1), $key, 0, 0, 1);
418 } elseif ($key == 'ACCOUNTING_DEFAULT_PERIOD_ON_TRANSFER') {
419 $array = array(0=>$langs->trans("PreviousMonth"), 1=>$langs->trans("CurrentMonth"), 2=>$langs->trans("Fiscalyear"));
420 print $form->selectarray($key, $array, getDolGlobalInt('ACCOUNTING_DEFAULT_PERIOD_ON_TRANSFER', 0), 0, 0, 0, '', 0, 0, 0, '', 'onrightofpage width200');
421 } else {
422 print '<input type="text" class="maxwidth100" id="'.$key.'" name="'.$key.'" value="'.getDolGlobalString($key).'">';
423 }
424
425 print '</td>';
426 print '</tr>';
427}
428
429print '<tr class="oddeven">';
430print '<td>'.$langs->trans("ACCOUNTING_DISABLE_BINDING_ON_SALES").'</td>';
431if (getDolGlobalString('ACCOUNTING_DISABLE_BINDING_ON_SALES')) {
432 print '<td class="right"><a class="reposition" href="'.$_SERVER['PHP_SELF'].'?token='.newToken().'&action=setdisablebindingonsales&value=0">';
433 print img_picto($langs->trans("Activated"), 'switch_on', '', false, 0, 0, '', 'warning');
434 print '</a></td>';
435} else {
436 print '<td class="right"><a class="reposition" href="'.$_SERVER['PHP_SELF'].'?token='.newToken().'&action=setdisablebindingonsales&value=1">';
437 print img_picto($langs->trans("Disabled"), 'switch_off');
438 print '</a></td>';
439}
440print '</tr>';
441
442print '<tr class="oddeven">';
443print '<td>'.$langs->trans("ACCOUNTING_DISABLE_BINDING_ON_PURCHASES").'</td>';
444if (getDolGlobalString('ACCOUNTING_DISABLE_BINDING_ON_PURCHASES')) {
445 print '<td class="right"><a class="reposition" href="'.$_SERVER['PHP_SELF'].'?token='.newToken().'&action=setdisablebindingonpurchases&value=0">';
446 print img_picto($langs->trans("Activated"), 'switch_on', '', false, 0, 0, '', 'warning');
447 print '</a></td>';
448} else {
449 print '<td class="right"><a class="reposition" href="'.$_SERVER['PHP_SELF'].'?token='.newToken().'&action=setdisablebindingonpurchases&value=1">';
450 print img_picto($langs->trans("Disabled"), 'switch_off');
451 print '</a></td>';
452}
453print '</tr>';
454
455print '<tr class="oddeven">';
456print '<td>'.$langs->trans("ACCOUNTING_DISABLE_BINDING_ON_EXPENSEREPORTS").'</td>';
457if (getDolGlobalString('ACCOUNTING_DISABLE_BINDING_ON_EXPENSEREPORTS')) {
458 print '<td class="right"><a class="reposition" href="'.$_SERVER['PHP_SELF'].'?token='.newToken().'&action=setdisablebindingonexpensereports&value=0">';
459 print img_picto($langs->trans("Activated"), 'switch_on', '', false, 0, 0, '', 'warning');
460 print '</a></td>';
461} else {
462 print '<td class="right"><a class="reposition" href="'.$_SERVER['PHP_SELF'].'?token='.newToken().'&action=setdisablebindingonexpensereports&value=1">';
463 print img_picto($langs->trans("Disabled"), 'switch_off');
464 print '</a></td>';
465}
466print '</tr>';
467
468print '</table>';
469print '</div>';
470
471
472
473// Show advanced options
474print '<br>';
475
476
477// Advanced params
478print '<div class="div-table-responsive-no-min">';
479print '<table class="noborder centpercent">';
480print '<tr class="liste_titre">';
481print '<td colspan="2">' . $langs->trans('OptionsAdvanced') . '</td>';
482print "</tr>\n";
483
484print '<tr class="oddeven">';
485print '<td>';
486print $form->textwithpicto($langs->trans("ACCOUNTING_ENABLE_LETTERING"), $langs->trans("ACCOUNTING_ENABLE_LETTERING_DESC", $langs->transnoentitiesnoconv("NumMvts")).'<br>'.$langs->trans("EnablingThisFeatureIsNotNecessary")).'</td>';
487if (getDolGlobalInt('ACCOUNTING_ENABLE_LETTERING')) {
488 print '<td class="right"><a class="reposition" href="'.$_SERVER['PHP_SELF'].'?token='.newToken().'&action=setenablelettering&value=0">';
489 print img_picto($langs->trans("Activated"), 'switch_on');
490 print '</a></td>';
491} else {
492 print '<td class="right"><a class="reposition" href="'.$_SERVER['PHP_SELF'].'?token='.newToken().'&action=setenablelettering&value=1">';
493 print img_picto($langs->trans("Disabled"), 'switch_off');
494 print '</a></td>';
495}
496print '</tr>';
497
498if (getDolGlobalInt('ACCOUNTING_ENABLE_LETTERING')) {
499 // Number of letters for lettering (3 by default (AAA), min 2 (AA))
500 print '<tr class="oddeven">';
501 print '<td>';
502 print $form->textwithpicto($langs->trans("ACCOUNTING_LETTERING_NBLETTERS"), $langs->trans("ACCOUNTING_LETTERING_NBLETTERS_DESC")) . '</td>';
503 print '<td class="right">';
504
505 if (empty($letter)) {
506 if (getDolGlobalInt('ACCOUNTING_LETTERING_NBLETTERS')) {
507 $nbletter = getDolGlobalInt('ACCOUNTING_LETTERING_NBLETTERS');
508 } else {
509 $nbletter = 3;
510 }
511 }
512
513 print '<input class="flat right" name="ACCOUNTING_LETTERING_NBLETTERS" id="ACCOUNTING_LETTERING_NBLETTERS" value="' . $nbletter . '" type="number" step="1" min="2" max="3" >' . "\n";
514 print '</tr>';
515
516 // Auto Lettering when transfer in accountancy is realized
517 print '<tr class="oddeven">';
518 print '<td>';
519 print $form->textwithpicto($langs->trans("ACCOUNTING_ENABLE_AUTOLETTERING"), $langs->trans("ACCOUNTING_ENABLE_AUTOLETTERING_DESC")) . '</td>';
520 if (getDolGlobalInt('ACCOUNTING_ENABLE_AUTOLETTERING')) {
521 print '<td class="right"><a class="reposition" href="' . $_SERVER['PHP_SELF'] . '?token=' . newToken() . '&action=setenableautolettering&value=0">';
522 print img_picto($langs->trans("Activated"), 'switch_on');
523 print '</a></td>';
524 } else {
525 print '<td class="right"><a class="reposition" href="' . $_SERVER['PHP_SELF'] . '?token=' . newToken() . '&action=setenableautolettering&value=1">';
526 print img_picto($langs->trans("Disabled"), 'switch_off');
527 print '</a></td>';
528 }
529 print '</tr>';
530}
531
532print '<tr class="oddeven">';
533print '<td>';
534print $form->textwithpicto($langs->trans("ACCOUNTING_FORCE_ENABLE_VAT_REVERSE_CHARGE"), $langs->trans("ACCOUNTING_FORCE_ENABLE_VAT_REVERSE_CHARGE_DESC", $langs->transnoentities("MenuDefaultAccounts"))).'</td>';
535if (getDolGlobalString('ACCOUNTING_FORCE_ENABLE_VAT_REVERSE_CHARGE')) {
536 print '<td class="right"><a class="reposition" href="' . $_SERVER['PHP_SELF'] . '?token=' . newToken() . '&action=setenablevatreversecharge&value=0">';
537 print img_picto($langs->trans("Activated"), 'switch_on');
538 print '</a></td>';
539} else {
540 print '<td class="right"><a class="reposition" href="' . $_SERVER['PHP_SELF'] . '?token=' . newToken() . '&action=setenablevatreversecharge&value=1">';
541 print img_picto($langs->trans("Disabled"), 'switch_off');
542 print '</a></td>';
543}
544print '</tr>';
545
546print '</table>';
547print '</div>';
548
549
550print '<div class="center"><input type="submit" class="button button-edit" name="button" value="'.$langs->trans('Modify').'"></div>';
551
552print '</form>';
553
554// End of page
555llxFooter();
556$db->close();
dolibarr_set_const($db, $name, $value, $type='chaine', $visible=0, $note='', $entity=1)
Insert a parameter (key,value) into database (delete old key then insert it again).
if(!defined('NOREQUIRESOC')) if(!defined( 'NOREQUIRETRAN')) if(!defined('NOTOKENRENEWAL')) if(!defined( 'NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined( 'NOREQUIREAJAX')) llxHeader()
Empty header.
Definition wrapper.php:55
llxFooter()
Empty footer.
Definition wrapper.php:69
Class to manage generation of HTML components Only common components must be here.
dol_mktime($hour, $minute, $second, $month, $day, $year, $gm='auto', $check=1)
Return a timestamp date built from detailed informations (by default a local PHP server timestamp) Re...
load_fiche_titre($titre, $morehtmlright='', $picto='generic', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='')
Load a title with picto.
getDolGlobalInt($key, $default=0)
Return a Dolibarr global constant int value.
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=false, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2)
Show picto whatever it's its name (generic function)
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='', $noduplicate=0)
Set event messages in dol_events session object.
getDolGlobalString($key, $default='')
Return dolibarr global constant string value.
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program.