dolibarr 25.0.0-alpha
defaultaccounts.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-2026 Alexandre Spangaro <alexandre@inovea-conseil.com>
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) 2024 Frédéric France <frederic.france@free.fr>
10 * Copyright (C) 2025 Vincent de Grandporé <vincent@de-grandpre.quebec>
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 */
26
33// Load Dolibarr environment
34require '../../main.inc.php';
43require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
44require_once DOL_DOCUMENT_ROOT.'/core/lib/accounting.lib.php';
45require_once DOL_DOCUMENT_ROOT.'/core/class/html.formaccounting.class.php';
46
47// Load translation files required by the page
48$langs->loadLangs(array("compta", "bills", "admin", "accountancy", "salaries", "trips", "loan"));
49
50// Security check
51if (!$user->hasRight('accounting', 'chartofaccount')) {
53}
54
55$action = GETPOST('action', 'aZ09');
56
57
58$list_account_main = array(
59 'ACCOUNTING_ACCOUNT_CUSTOMER',
60 'ACCOUNTING_ACCOUNT_SUPPLIER',
61 'SALARIES_ACCOUNTING_ACCOUNT_PAYMENT',
62);
63
64
65if (isModEnabled('expensereport')) {
66 $list_account_main[] = 'ACCOUNTING_ACCOUNT_EXPENSEREPORT';
67}
68
69// Default subledger account (free text)
70$list_default_subledger = array(
71 'ACCOUNTING_ACCOUNT_CUSTOMER' => 'ACCOUNTING_ACCOUNT_CUSTOMER_DEFAULT_SUBLEDGER',
72 'ACCOUNTING_ACCOUNT_SUPPLIER' => 'ACCOUNTING_ACCOUNT_SUPPLIER_DEFAULT_SUBLEDGER',
73);
74
75$list_account = array();
76
77$list_account[] = '---Product---';
78$list_account[] = 'ACCOUNTING_PRODUCT_SOLD_ACCOUNT';
79if ($mysoc->isInEEC()) {
80 $list_account[] = 'ACCOUNTING_PRODUCT_SOLD_INTRA_ACCOUNT';
81}
82$list_account[] = 'ACCOUNTING_PRODUCT_SOLD_EXPORT_ACCOUNT';
83$list_account[] = 'ACCOUNTING_PRODUCT_BUY_ACCOUNT';
84if ($mysoc->isInEEC()) {
85 $list_account[] = 'ACCOUNTING_PRODUCT_BUY_INTRA_ACCOUNT';
86}
87$list_account[] = 'ACCOUNTING_PRODUCT_BUY_EXPORT_ACCOUNT';
88
89$list_account[] = '---Service---';
90$list_account[] = 'ACCOUNTING_SERVICE_SOLD_ACCOUNT';
91if ($mysoc->isInEEC()) {
92 $list_account[] = 'ACCOUNTING_SERVICE_SOLD_INTRA_ACCOUNT';
93}
94$list_account[] = 'ACCOUNTING_SERVICE_SOLD_EXPORT_ACCOUNT';
95$list_account[] = 'ACCOUNTING_SERVICE_BUY_ACCOUNT';
96if ($mysoc->isInEEC()) {
97 $list_account[] = 'ACCOUNTING_SERVICE_BUY_INTRA_ACCOUNT';
98}
99$list_account[] = 'ACCOUNTING_SERVICE_BUY_EXPORT_ACCOUNT';
100
101$list_account[] = '---Others---';
102$list_account[] = 'ACCOUNTING_VAT_SOLD_ACCOUNT';
103$list_account[] = 'ACCOUNTING_VAT_BUY_ACCOUNT';
104$list_account[] = 'ACCOUNTING_VAT_BUY_ASSET_ACCOUNT';
105
106/*if ($mysoc->useRevenueStamp()) {
107 $list_account[] = 'ACCOUNTING_REVENUESTAMP_SOLD_ACCOUNT';
108 $list_account[] = 'ACCOUNTING_REVENUESTAMP_BUY_ACCOUNT';
109}*/
110
111$list_account[] = 'ACCOUNTING_VAT_PAY_ACCOUNT';
112
113$list_account[] = 'ACCOUNTING_LT1_SOLD_ACCOUNT';
114$list_account[] = 'ACCOUNTING_LT1_BUY_ACCOUNT';
115$list_account[] = 'ACCOUNTING_LT1_PAY_ACCOUNT';
116$list_account[] = 'ACCOUNTING_LT2_SOLD_ACCOUNT';
117$list_account[] = 'ACCOUNTING_LT2_BUY_ACCOUNT';
118$list_account[] = 'ACCOUNTING_LT2_PAY_ACCOUNT';
119
120if (getDolGlobalString('ACCOUNTING_FORCE_ENABLE_VAT_REVERSE_CHARGE')) {
121 $list_account[] = 'ACCOUNTING_VAT_BUY_REVERSE_CHARGES_CREDIT';
122 $list_account[] = 'ACCOUNTING_VAT_BUY_REVERSE_CHARGES_DEBIT';
123 $list_account[] = 'ACCOUNTING_LT1_BUY_REVERSE_CHARGES_CREDIT';
124 $list_account[] = 'ACCOUNTING_LT1_BUY_REVERSE_CHARGES_DEBIT';
125 $list_account[] = 'ACCOUNTING_LT2_BUY_REVERSE_CHARGES_CREDIT';
126 $list_account[] = 'ACCOUNTING_LT2_BUY_REVERSE_CHARGES_DEBIT';
127}
128if (isModEnabled('bank')) {
129 $list_account[] = 'ACCOUNTING_ACCOUNT_TRANSFER_CASH';
130}
131if (getDolGlobalString('INVOICE_USE_RETAINED_WARRANTY')) {
132 $list_account[] = 'ACCOUNTING_ACCOUNT_CUSTOMER_RETAINED_WARRANTY';
133}
134if (isModEnabled('don')) {
135 $list_account[] = 'DONATION_ACCOUNTINGACCOUNT';
136}
137if (isModEnabled('member')) {
138 $list_account[] = 'ADHERENT_SUBSCRIPTION_ACCOUNTINGACCOUNT';
139}
140if (isModEnabled('loan')) {
141 $list_account[] = 'LOAN_ACCOUNTING_ACCOUNT_CAPITAL';
142 $list_account[] = 'LOAN_ACCOUNTING_ACCOUNT_INTEREST';
143 $list_account[] = 'LOAN_ACCOUNTING_ACCOUNT_INSURANCE';
144}
145$list_account[] = 'ACCOUNTING_ACCOUNT_SUSPENSE';
146if (isModEnabled('invoice') || isModEnabled('supplier_invoice')) {
147 $list_account[] = '---Discounts---';
148 $list_account[] = 'ACCOUNTING_ACCOUNT_DISCOUNT_GRANTED';
149 $list_account[] = 'ACCOUNTING_ACCOUNT_DISCOUNT_RECEIVED';
150}
151if (isModEnabled('societe')) {
152 $list_account[] = '---Deposits---';
153}
154
155/*
156 * Actions
157 */
158
159$error = 0;
160
161if ($action == 'update') {
162 // Process $list_account_main
163 foreach ($list_account_main as $constname) {
164 $constvalue = GETPOST($constname, 'alpha');
165
166 if (!dolibarr_set_const($db, $constname, $constvalue, 'chaine', 0, '', $conf->entity)) {
167 $error++;
168 }
169 }
170 // Process $list_account
171 foreach ($list_account as $constname) {
172 $reg = array();
173 if (preg_match('/---(.*)---/', $constname, $reg)) { // This is a separator
174 continue;
175 }
176
177 $constvalue = GETPOST($constname, 'alpha');
178
179 if (!dolibarr_set_const($db, $constname, $constvalue, 'chaine', 0, '', $conf->entity)) {
180 $error++;
181 }
182 }
183 foreach (array('ACCOUNTING_ACCOUNT_CUSTOMER_DEFAULT_SUBLEDGER', 'ACCOUNTING_ACCOUNT_SUPPLIER_DEFAULT_SUBLEDGER') as $constname) {
184 $constvalue = trim(GETPOST($constname, 'alphanohtml'));
185 if (!dolibarr_set_const($db, $constname, $constvalue, 'chaine', 0, '', $conf->entity)) {
186 $error++;
187 }
188 }
189
190 $constname = 'ACCOUNTING_ACCOUNT_CUSTOMER_DEPOSIT';
191 $constvalue = GETPOSTINT($constname);
192 if (!dolibarr_set_const($db, $constname, $constvalue, 'chaine', 0, '', $conf->entity)) {
193 $error++;
194 }
195
196 $constname = 'ACCOUNTING_ACCOUNT_CUSTOMER_DEPOSIT_FOR_VAT';
197 $constvalue = GETPOSTINT($constname);
198 if (!dolibarr_set_const($db, $constname, $constvalue, 'chaine', 0, '', $conf->entity)) {
199 $error++;
200 }
201
202 $constname = 'ACCOUNTING_ACCOUNT_SUPPLIER_DEPOSIT';
203 $constvalue = GETPOSTINT($constname);
204 if (!dolibarr_set_const($db, $constname, $constvalue, 'chaine', 0, '', $conf->entity)) {
205 $error++;
206 }
207
208
209 if (!$error) {
210 setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
211 } else {
212 setEventMessages($langs->trans("Error"), null, 'errors');
213 }
214}
215
216if ($action == 'setACCOUNTING_ACCOUNT_CUSTOMER_USE_AUXILIARY_ON_DEPOSIT') {
217 $setDisableAuxiliaryAccountOnCustomerDeposit = GETPOSTINT('value');
218 $res = dolibarr_set_const($db, "ACCOUNTING_ACCOUNT_CUSTOMER_USE_AUXILIARY_ON_DEPOSIT", $setDisableAuxiliaryAccountOnCustomerDeposit, 'yesno', 0, '', $conf->entity);
219 if (!($res > 0)) {
220 $error++;
221 }
222
223 if (!$error) {
224 setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
225 } else {
226 setEventMessages($langs->trans("Error"), null, 'mesgs');
227 }
228}
229
230if ($action == 'setACCOUNTING_ACCOUNT_SUPPLIER_USE_AUXILIARY_ON_DEPOSIT') {
231 $setDisableAuxiliaryAccountOnSupplierDeposit = GETPOSTINT('value');
232 $res = dolibarr_set_const($db, "ACCOUNTING_ACCOUNT_SUPPLIER_USE_AUXILIARY_ON_DEPOSIT", $setDisableAuxiliaryAccountOnSupplierDeposit, 'yesno', 0, '', $conf->entity);
233 if (!($res > 0)) {
234 $error++;
235 }
236
237 if (!$error) {
238 setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
239 } else {
240 setEventMessages($langs->trans("Error"), null, 'mesgs');
241 }
242}
243
244
245/*
246 * View
247 */
248
249$form = new Form($db);
250$formaccounting = new FormAccounting($db);
251
252$help_url = 'EN:Module_Double_Entry_Accounting#Setup|FR:Module_Comptabilit&eacute;_en_Partie_Double#Configuration';
253
254llxHeader('', $langs->trans('MenuDefaultAccounts'), $help_url, '', 0, 0, '', '', '', 'mod-accountancy page-admin_defaultaccounts');
255
256$linkback = '';
257print load_fiche_titre($langs->trans('MenuDefaultAccounts'), $linkback, 'title_accountancy');
258
259print '<div class="info">'.$langs->trans("DefaultBindingDesc").'</div>';
260print '<br>';
261
262print '<form action="'.$_SERVER["PHP_SELF"].'" method="post">';
263print '<input type="hidden" name="token" value="'.newToken().'">';
264print '<input type="hidden" name="action" value="update">';
265
266// Define main accounts for thirdparty
267print '<div class="div-table-responsive-no-min">';
268print '<table class="noborder centpercent">';
269print '<tr class="liste_titre"><td>'.$langs->trans("ThirdParties").' | '.$langs->trans("Users").'</td><td></td></tr>';
270
271foreach ($list_account_main as $key) {
272 print '<tr class="oddeven value">';
273 // Param
274 $label = $langs->trans($key);
275 $keydesc = $key.'_Desc';
276
277 $htmltext = $langs->trans($keydesc);
278 print '<td class="fieldrequired">';
279 if ($key == 'ACCOUNTING_ACCOUNT_CUSTOMER') {
280 print img_picto('', 'company', 'class="pictofixedwidth"');
281 } elseif ($key == 'ACCOUNTING_ACCOUNT_SUPPLIER') {
282 print img_picto('', 'company', 'class="pictofixedwidth"');
283 } else {
284 print img_picto('', 'user', 'class="pictofixedwidth"');
285 }
286 print $form->textwithpicto($label, $htmltext);
287 print '</td>';
288 // Value
289 print '<td class="right">'; // Do not force class=right, or it align also the content of the select box
290 $key_value = getDolGlobalString($key);
291 print $formaccounting->select_account($key_value, $key, 1, [], 1, 1, 'minwidth100 maxwidth300 maxwidthonsmartphone', 'accountsmain', '1', 2);
292 print '</td>';
293 print '</tr>';
294
295 // Default subledger account: dedicated row, not required
296 if (isset($list_default_subledger[$key])) {
297 $subkey = $list_default_subledger[$key];
298 print '<tr class="oddeven value">';
299 print '<td>';
300 print img_picto('', 'company', 'class="pictofixedwidth"');
301 print $form->textwithpicto($langs->trans($subkey), $langs->trans($subkey.'_Desc'));
302 print '</td>';
303 print '<td class="right">';
304 print '<input type="text" class="minwidth100 maxwidth300 maxwidthonsmartphone" name="'.$subkey.'" value="'.dol_escape_htmltag(getDolGlobalString($subkey)).'">';
305 print '</td>';
306 print '</tr>';
307 }
308}
309print "</table>\n";
310print "</div>\n";
311
312print '<br>';
313
314print '<div class="div-table-responsive-no-min">';
315print '<table class="noborder centpercent">';
316
317foreach ($list_account as $key) {
318 $reg = array();
319 if (preg_match('/---(.*)---/', $key, $reg)) {
320 print '<tr class="liste_titre"><td>'.$langs->trans($reg[1]).'</td><td></td></tr>';
321 } else {
322 print '<tr class="oddeven value">';
323 // Param
324 $label = $langs->trans($key);
325 print '<td>';
326 if (preg_match('/^ACCOUNTING_PRODUCT/', $key)) {
327 print img_picto('', 'product', 'class="pictofixedwidth"');
328 } elseif (preg_match('/^ACCOUNTING_SERVICE/', $key)) {
329 print img_picto('', 'service', 'class="pictofixedwidth"');
330 } elseif (preg_match('/^ACCOUNTING_VAT_PAY_ACCOUNT/', $key)) {
331 print img_picto('', 'payment_vat', 'class="pictofixedwidth"');
332 } elseif (preg_match('/^ACCOUNTING_LT1_PAY_ACCOUNT/', $key)) {
333 print img_picto('', 'payment_vat', 'class="pictofixedwidth"');
334 } elseif (preg_match('/^ACCOUNTING_LT2_PAY_ACCOUNT/', $key)) {
335 print img_picto('', 'payment_vat', 'class="pictofixedwidth"');
336 } elseif (preg_match('/^ACCOUNTING_VAT/', $key)) {
337 print img_picto('', 'vat', 'class="pictofixedwidth"');
338 } elseif (preg_match('/^ACCOUNTING_LT/', $key)) {
339 print img_picto('', 'vat', 'class="pictofixedwidth"');
340 } elseif (preg_match('/^ACCOUNTING_ACCOUNT_CUSTOMER/', $key)) {
341 print img_picto('', 'bill', 'class="pictofixedwidth"');
342 } elseif (preg_match('/^LOAN_ACCOUNTING_ACCOUNT/', $key)) {
343 print img_picto('', 'loan', 'class="pictofixedwidth"');
344 } elseif (preg_match('/^DONATION_ACCOUNTING/', $key)) {
345 print img_picto('', 'donation', 'class="pictofixedwidth"');
346 } elseif (preg_match('/^ADHERENT_SUBSCRIPTION/', $key)) {
347 print img_picto('', 'member', 'class="pictofixedwidth"');
348 } elseif (preg_match('/^ACCOUNTING_ACCOUNT_TRANSFER/', $key)) {
349 print img_picto('', 'bank_account', 'class="pictofixedwidth"');
350 } elseif (preg_match('/^ACCOUNTING_ACCOUNT_SUSPENSE/', $key)) {
351 print img_picto('', 'question', 'class="pictofixedwidth"');
352 }
353 // Note: account for revenue stamp are store into dictionary of revenue stamp. There is no default value.
354 print $label;
355 print '</td>';
356 // Value
357 print '<td class="right">'; // Do not force class=right, or it align also the content of the select box
358 print $formaccounting->select_account(getDolGlobalString($key), $key, 1, [], 1, 1, 'minwidth100 maxwidth300 maxwidthonsmartphone', 'accounts');
359 print '</td>';
360 print '</tr>';
361 }
362}
363
364
365// Customer deposit account
366print '<tr class="oddeven value">';
367// Param
368print '<td>';
369print img_picto('', 'bill', 'class="pictofixedwidth"') . $langs->trans('ACCOUNTING_ACCOUNT_CUSTOMER_DEPOSIT');
370print '</td>';
371// Value
372print '<td class="right">'; // Do not force class=right, or it align also the content of the select box
373print $formaccounting->select_account(getDolGlobalString('ACCOUNTING_ACCOUNT_CUSTOMER_DEPOSIT'), 'ACCOUNTING_ACCOUNT_CUSTOMER_DEPOSIT', 1, [], 1, 1, 'minwidth100 maxwidth300 maxwidthonsmartphone', 'accounts');
374print '</td>';
375print '</tr>';
376
377// customer deposit account for VAT
378print '<tr class="oddeven value">';
379// Param
380print '<td>';
381print img_picto('', 'bill', 'class="pictofixedwidth"') . $langs->trans('ACCOUNTING_ACCOUNT_CUSTOMER_DEPOSIT_FOR_VAT');
382print '</td>';
383// Value
384print '<td class="right">'; // Do not force class=right, or it align also the content of the select box
385print $formaccounting->select_account(getDolGlobalString('ACCOUNTING_ACCOUNT_CUSTOMER_DEPOSIT_FOR_VAT'), 'ACCOUNTING_ACCOUNT_CUSTOMER_DEPOSIT_FOR_VAT', 1, [], 1, 1, 'minwidth100 maxwidth300 maxwidthonsmartphone', 'accounts');
386print '</td>';
387print '</tr>';
388
389if (isModEnabled('societe') && getDolGlobalString('ACCOUNTING_ACCOUNT_CUSTOMER_DEPOSIT') && getDolGlobalString('ACCOUNTING_ACCOUNT_CUSTOMER_DEPOSIT') != '-1') {
390 print '<tr class="oddeven">';
391 print '<td>' . img_picto('', 'bill', 'class="pictofixedwidth"') . $langs->trans("UseAuxiliaryAccountOnCustomerDeposit") . '</td>';
392 if (getDolGlobalInt('ACCOUNTING_ACCOUNT_CUSTOMER_USE_AUXILIARY_ON_DEPOSIT')) {
393 print '<td class="right"><a class="reposition" href="' . $_SERVER['PHP_SELF'] . '?token=' . newToken() . '&action=setACCOUNTING_ACCOUNT_CUSTOMER_USE_AUXILIARY_ON_DEPOSIT&value=0">';
394 print img_picto($langs->trans("Activated"), 'switch_on', '', 0, 0, 0, '', 'warning');
395 print '</a></td>';
396 } else {
397 print '<td class="right"><a class="reposition" href="' . $_SERVER['PHP_SELF'] . '?token=' . newToken() . '&action=setACCOUNTING_ACCOUNT_CUSTOMER_USE_AUXILIARY_ON_DEPOSIT&value=1">';
398 print img_picto($langs->trans("Disabled"), 'switch_off');
399 print '</a></td>';
400 }
401 print '</tr>';
402}
403
404// Supplier deposit account
405print '<tr class="oddeven value">';
406// Param
407print '<td>';
408print img_picto('', 'supplier_invoice', 'class="pictofixedwidth"') . $langs->trans('ACCOUNTING_ACCOUNT_SUPPLIER_DEPOSIT');
409print '</td>';
410// Value
411print '<td class="right">'; // Do not force class=right, or it align also the content of the select box
412print $formaccounting->select_account(getDolGlobalString('ACCOUNTING_ACCOUNT_SUPPLIER_DEPOSIT'), 'ACCOUNTING_ACCOUNT_SUPPLIER_DEPOSIT', 1, [], 1, 1, 'minwidth100 maxwidth300 maxwidthonsmartphone', 'accounts');
413print '</td>';
414print '</tr>';
415
416if (isModEnabled('societe') && getDolGlobalString('ACCOUNTING_ACCOUNT_SUPPLIER_DEPOSIT') && getDolGlobalString('ACCOUNTING_ACCOUNT_SUPPLIER_DEPOSIT') != '-1') {
417 print '<tr class="oddeven">';
418 print '<td>' . img_picto('', 'supplier_invoice', 'class="pictofixedwidth"') . $langs->trans("UseAuxiliaryAccountOnSupplierDeposit") . '</td>';
419 if (getDolGlobalInt('ACCOUNTING_ACCOUNT_SUPPLIER_USE_AUXILIARY_ON_DEPOSIT')) {
420 print '<td class="right"><a class="reposition" href="' . $_SERVER['PHP_SELF'] . '?token=' . newToken() . '&action=setACCOUNTING_ACCOUNT_SUPPLIER_USE_AUXILIARY_ON_DEPOSIT&value=0">';
421 print img_picto($langs->trans("Activated"), 'switch_on', '', 0, 0, 0, '', 'warning');
422 print '</a></td>';
423 } else {
424 print '<td class="right"><a class="reposition" href="' . $_SERVER['PHP_SELF'] . '?token=' . newToken() . '&action=setACCOUNTING_ACCOUNT_SUPPLIER_USE_AUXILIARY_ON_DEPOSIT&value=1">';
425 print img_picto($langs->trans("Disabled"), 'switch_off');
426 print '</a></td>';
427 }
428 print '</tr>';
429}
430
431print "</table>\n";
432print "</div>\n";
433
434print '<div class="center"><input type="submit" class="button button-edit" name="button" value="'.$langs->trans('Save').'"></div>';
435
436print '</form>';
437
438// End of page
439llxFooter();
440$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).
llxFooter($comment='', $zone='private', $disabledoutputofmessages=0)
Empty footer.
Definition wrapper.php:91
if(!defined('NOREQUIRESOC')) if(!defined( 'NOREQUIRETRAN')) if(!defined('NOTOKENRENEWAL')) if(!defined( 'NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined( 'NOREQUIREAJAX')) llxHeader($head='', $title='', $help_url='', $target='', $disablejs=0, $disablehead=0, $arrayofjs='', $arrayofcss='', $morequerystring='', $morecssonbody='', $replacemainareaby='', $disablenofollow=0, $disablenoindex=0)
Empty header.
Definition wrapper.php:73
if(!isModEnabled('ai')||!getDolGlobalString('AI_ASSISTANT_ENABLED')) global $conf
The main.inc.php has been included so the following variable are now defined:
Class to manage generation of HTML components for accounting management.
Class to manage generation of HTML components Only common components must be here.
global $mysoc
getDolGlobalInt($key, $default=0)
Return a Dolibarr global constant int value.
newToken()
Return the value of token currently saved into session with name 'newtoken'.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0, $nodefault=0)
Return value of a param into GET or POST supervariable.
GETPOSTINT($paramname, $method=0, $nodefault=0)
Return the value of a $_GET or $_POST supervariable, converted into integer.
getDolGlobalString($key, $default='')
Return a Dolibarr global constant string value.
isModEnabled($module)
Is Dolibarr module enabled.
load_fiche_titre($title, $morehtmlright='', $picto='generic', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='', $morecssonpicto='widthpictotitle')
Load a title with picto.
dol_escape_htmltag($stringtoescape, $keepb=0, $keepn=0, $noescapetags='', $escapeonlyhtmltags=0, $cleanalsojavascript=0)
Definition html.lib.php:183
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program.