32 require
'../../main.inc.php';
33 require_once DOL_DOCUMENT_ROOT.
'/core/lib/date.lib.php';
34 require_once DOL_DOCUMENT_ROOT.
'/compta/bank/class/account.class.php';
35 require_once DOL_DOCUMENT_ROOT.
'/compta/cashcontrol/class/cashcontrol.class.php';
37 $langs->loadLangs(array(
"install",
"cashdesk",
"admin",
"banks"));
41 $action =
GETPOST(
'action',
'aZ09');
51 $sortfield =
GETPOST(
'sortfield',
'aZ09comma');
52 $sortorder =
GETPOST(
'sortorder',
'aZ09comma');
54 if (empty($page) || $page == -1) {
57 $offset = $limit * $page;
58 $pageprev = $page - 1;
59 $pagenext = $page + 1;
66 $contextpage =
GETPOST(
'contextpage',
'aZ') ?
GETPOST(
'contextpage',
'aZ') :
'thirdpartylist';
68 if ($contextpage ==
'takepos') {
72 $arrayofpaymentmode = array(
'cash' =>
'Cash',
'cheque' =>
'Cheque',
'card' =>
'CreditCard');
74 $arrayofposavailable = array();
76 $arrayofposavailable[
'cashdesk'] = $langs->trans(
'CashDesk').
' (cashdesk)';
79 $arrayofposavailable[
'takepos'] = $langs->trans(
'TakePOS').
' (takepos)';
87 $extrafields->fetch_name_optionals_label(
$object->table_element);
90 $hookmanager->initHooks(array(
'cashcontrolcard',
'globalcard'));
93 include DOL_DOCUMENT_ROOT.
'/core/actions_fetchobject.inc.php';
96 if ($user->socid > 0) {
100 if (!$user->hasRight(
"cashdesk",
"run") && !$user->hasRight(
"takepos",
"run")) {
109 $permissiontoadd = ($user->hasRight(
"cashdesk",
"run") || $user->hasRight(
"takepos",
"run"));
110 $permissiontodelete = ($user->hasRight(
"cashdesk",
"run") || $user->hasRight(
"takepos",
"run")) || ($permissiontoadd &&
$object->status == 0);
111 if (empty($backtopage)) {
112 $backtopage = DOL_URL_ROOT.
'/compta/cashcontrol/cashcontrol_card.php?id='.(!empty($id) && $id > 0 ? $id :
'__ID__');
114 $backurlforlist = DOL_URL_ROOT.
'/compta/cashcontrol/cashcontrol_list.php';
115 $triggermodname =
'CACHCONTROL_MODIFY';
118 setEventMessages($langs->trans(
"CashDesk").
" - ".$langs->trans(
"NotConfigured"),
null,
'errors');
122 if (
GETPOST(
'cancel',
'alpha')) {
123 if ($action ==
'valid') {
130 if ($action ==
"reopen") {
131 $result =
$object->setStatut($object::STATUS_DRAFT,
null,
'',
'CASHFENCE_REOPEN');
139 if ($action ==
"start") {
141 if (!
GETPOST(
'posmodule',
'alpha') ||
GETPOST(
'posmodule',
'alpha') ==
'-1') {
142 setEventMessages($langs->trans(
"ErrorFieldRequired", $langs->transnoentitiesnoconv(
"Module")),
null,
'errors');
146 if (
GETPOST(
'posnumber',
'alpha') ==
'') {
147 setEventMessages($langs->trans(
"ErrorFieldRequired", $langs->transnoentitiesnoconv(
"CashDesk")),
null,
'errors');
151 if (!
GETPOST(
'closeyear',
'alpha') ||
GETPOST(
'closeyear',
'alpha') ==
'-1') {
152 setEventMessages($langs->trans(
"ErrorFieldRequired", $langs->transnoentitiesnoconv(
"Year")),
null,
'errors');
156 } elseif ($action ==
"add") {
157 if (
GETPOST(
'opening',
'alpha') ==
'') {
158 setEventMessages($langs->trans(
"ErrorFieldRequired", $langs->transnoentitiesnoconv(
"InitialBankBalance")),
null,
'errors');
163 foreach ($arrayofpaymentmode as $key => $val) {
188 if ($contextpage ==
'takepos') {
191 parent.location.href='../../takepos/index.php?place='+parent.place;
197 if ($action ==
"valid") {
212 $result =
$object->update($user);
214 $result =
$object->valid($user);
224 if ($contextpage ==
'takepos') {
227 parent.location.href='../../takepos/index.php?place='+parent.place;
235 if ($action ==
'confirm_delete' && !empty($permissiontodelete)) {
239 dol_print_error(
null,
'Error, object must be fetched before being deleted');
243 $result =
$object->delete($user);
248 header(
"Location: ".$backurlforlist);
264 $form =
new Form($db);
266 $initialbalanceforterminal = array();
267 $theoricalamountforterminal = array();
268 $theoricalnbofinvoiceforterminal = array();
271 llxHeader(
'', $langs->trans(
"CashControl"));
274 if ($action ==
"create" || $action ==
"start" || $action ==
'close') {
275 if ($action ==
'close') {
276 $posmodule =
$object->posmodule;
277 $terminalid =
$object->posnumber;
278 $terminaltouse = $terminalid;
281 $smonth =
$object->month_close;
283 } elseif (
GETPOST(
'posnumber',
'alpha') !=
'' &&
GETPOST(
'posnumber',
'alpha') !=
'' &&
GETPOST(
'posnumber',
'alpha') !=
'-1') {
284 $posmodule =
GETPOST(
'posmodule',
'alpha');
285 $terminalid =
GETPOST(
'posnumber',
'alpha');
286 $terminaltouse = $terminalid;
288 if ($terminaltouse ==
'1' && $posmodule ==
'cashdesk') {
292 if ($posmodule ==
'cashdesk' && $terminaltouse !=
'' && $terminaltouse !=
'1') {
294 setEventMessages($langs->trans(
"OnlyTerminal1IsAvailableForCashDeskModule"),
null,
'errors');
299 if (isset($terminalid) && $terminalid !=
'') {
301 foreach ($arrayofpaymentmode as $key => $val) {
302 if ($key !=
'cash') {
303 $initialbalanceforterminal[$terminalid][$key] = 0;
308 $vartouse =
'CASHDESK_ID_BANKACCOUNT_CASH'.$terminaltouse;
312 $sql =
"SELECT SUM(amount) as total FROM ".MAIN_DB_PREFIX.
"bank";
313 $sql .=
" WHERE fk_account = ".((int) $bankid);
314 if ($syear && !$smonth) {
316 } elseif ($syear && $smonth && !$sday) {
318 } elseif ($syear && $smonth && $sday) {
319 $sql .=
" AND dateo < '".$db->idate(
dol_mktime(0, 0, 0, $smonth, $sday, $syear)).
"'";
324 $resql = $db->query(
$sql);
326 $obj = $db->fetch_object($resql);
328 $initialbalanceforterminal[$terminalid][$key] = $obj->total;
334 setEventMessages($langs->trans(
"SetupOfTerminalNotComplete", $terminaltouse),
null,
'errors');
340 foreach ($arrayofpaymentmode as $key => $val) {
341 $sql =
"SELECT SUM(pf.amount) as total, COUNT(*) as nb";
342 $sql .=
" FROM ".MAIN_DB_PREFIX.
"paiement_facture as pf, ".MAIN_DB_PREFIX.
"facture as f, ".MAIN_DB_PREFIX.
"paiement as p, ".MAIN_DB_PREFIX.
"c_paiement as cp";
343 $sql .=
" WHERE pf.fk_facture = f.rowid AND p.rowid = pf.fk_paiement AND cp.id = p.fk_paiement";
344 $sql .=
" AND f.module_source = '".$db->escape($posmodule).
"'";
345 $sql .=
" AND f.pos_source = '".$db->escape($terminalid).
"'";
346 $sql .=
" AND f.paye = 1";
347 $sql .=
" AND p.entity IN (".getEntity(
'facture').
")";
348 if ($key ==
'cash') {
349 $sql .=
" AND cp.code = 'LIQ'";
350 } elseif ($key ==
'cheque') {
351 $sql .=
" AND cp.code = 'CHQ'";
352 } elseif ($key ==
'card') {
353 $sql .=
" AND cp.code = 'CB'";
358 if ($syear && !$smonth) {
360 } elseif ($syear && $smonth && !$sday) {
362 } elseif ($syear && $smonth && $sday) {
363 $sql .=
" AND datef BETWEEN '".$db->idate(
dol_mktime(0, 0, 0, $smonth, $sday, $syear)).
"' AND '".$db->idate(
dol_mktime(23, 59, 59, $smonth, $sday, $syear)).
"'";
368 $resql = $db->query(
$sql);
370 $theoricalamountforterminal[$terminalid][$key] = $initialbalanceforterminal[$terminalid][$key];
372 $obj = $db->fetch_object($resql);
374 $theoricalamountforterminal[$terminalid][$key] =
price2num($theoricalamountforterminal[$terminalid][$key] + $obj->total);
375 $theoricalnbofinvoiceforterminal[$terminalid][$key] = $obj->nb;
384 if ($action !=
'close') {
385 print
load_fiche_titre($langs->trans(
"CashControl").
" - ".$langs->trans(
"New"),
'',
'cash-register');
387 print
'<form method="POST" action="'.$_SERVER[
"PHP_SELF"].
'">';
388 print
'<input type="hidden" name="token" value="'.newToken().
'">';
389 if ($contextpage ==
'takepos') {
390 print
'<input type="hidden" name="contextpage" value="takepos">';
393 print
'<input type="hidden" name="action" value="add">';
394 } elseif ($action ==
'close') {
395 print
'<input type="hidden" name="action" value="valid">';
396 print
'<input type="hidden" name="id" value="'.$id.
'">';
398 print
'<input type="hidden" name="action" value="start">';
401 print
'<div class="div-table-responsive-no-min">';
402 print
'<table class="noborder centpercent">';
403 print
'<tr class="liste_titre">';
404 print
'<td>'.$langs->trans(
"Module").
'</td>';
405 print
'<td>'.$langs->trans(
"Terminal").
'</td>';
406 print
'<td>'.$langs->trans(
"Year").
'</td>';
407 print
'<td>'.$langs->trans(
"Month").
'</td>';
408 print
'<td>'.$langs->trans(
"Day").
'</td>';
415 print
'<tr class="oddeven">';
416 print
'<td>'.$form->selectarray(
'posmodule', $arrayofposavailable,
GETPOST(
'posmodule',
'alpha'), (count($arrayofposavailable) > 1 ? 1 : 0)).
'</td>';
421 for ($i = 1; $i <= $numterminals; $i++) {
424 $selectedposnumber = 0;
427 $selectedposnumber = 1;
430 print $form->selectarray(
'posnumber', $array,
GETPOSTISSET(
'posnumber') ?
GETPOSTINT(
'posnumber') : $selectedposnumber, $showempty);
435 $retstring =
'<select'.($disabled ?
' disabled' :
'').
' class="flat valignmiddle maxwidth75imp" id="'.$prefix.
'year" name="'.$prefix.
'year">';
436 for ($year = $syear - 10; $year < $syear + 10; $year++) {
437 $retstring .=
'<option value="'.$year.
'"'.($year == $syear ?
' selected' :
'').
'>'.$year.
'</option>';
439 $retstring .=
"</select>\n";
444 $retstring =
'<select'.($disabled ?
' disabled' :
'').
' class="flat valignmiddle maxwidth75imp" id="'.$prefix.
'month" name="'.$prefix.
'month">';
445 $retstring .=
'<option value="0"></option>';
446 for ($month = 1; $month <= 12; $month++) {
447 $retstring .=
'<option value="'.$month.
'"'.($month == $smonth ?
' selected' :
'').
'>';
448 $retstring .=
dol_print_date(mktime(12, 0, 0, $month, 1, 2000),
"%b");
449 $retstring .=
"</option>";
451 $retstring .=
"</select>";
456 $retstring =
'<select'.($disabled ?
' disabled' :
'').
' class="flat valignmiddle maxwidth50imp" id="'.$prefix.
'day" name="'.$prefix.
'day">';
457 $retstring .=
'<option value="0" selected> </option>';
458 for ($day = 1; $day <= 31; $day++) {
459 $retstring .=
'<option value="'.$day.
'"'.($day == $sday ?
' selected' :
'').
'>'.$day.
'</option>';
461 $retstring .=
"</select>";
466 if ($action ==
'start' &&
GETPOST(
'posnumber') !=
'' &&
GETPOST(
'posnumber') !=
'' &&
GETPOST(
'posnumber') !=
'-1') {
469 print
'<input type="submit" name="add" class="button" value="'.$langs->trans(
"Start").
'">';
476 if (($action ==
'start' &&
GETPOST(
'posnumber') !=
'' &&
GETPOST(
'posnumber') !=
'' &&
GETPOST(
'posnumber') !=
'-1') || $action ==
'close') {
477 $posmodule =
GETPOST(
'posmodule',
'alpha');
478 $terminalid =
GETPOST(
'posnumber',
'alpha');
482 print
'<div class="div-table-responsive-no-min">';
483 print
'<table class="noborder centpercent">';
485 print
'<tr class="liste_titre">';
487 print
'<td class="center">'.$langs->trans(
"InitialBankBalance");
499 print
'<tr class="liste_titre">';
501 print
'<td class="center">'.$langs->trans(
"Cash");
537 print
'<td>'.$langs->trans(
"TheoricalAmount").
'</td>';
538 print
'<td class="center">';
539 print
price($initialbalanceforterminal[$terminalid][
'cash']).
'<br>';
555 print
'<td>'.$langs->trans(
"RealAmount").
'</td>';
557 print
'<td class="center">';
559 if ($action ==
'close') {
562 print
'name="opening" type="text" class="maxwidth100 center" value="';
563 if ($action ==
'close') {
583 print
'<td class="center">';
584 print
'<input type="submit" name="cancel" class="button button-cancel" value="'.$langs->trans(
"Cancel").
'">';
585 if ($action ==
'start') {
586 print
'<input type="submit" name="add" class="button button-save" value="'.$langs->trans(
"Save").
'">';
587 } elseif ($action ==
'close') {
588 print
'<input type="submit" name="valid" class="button" value="'.$langs->trans(
"Validate").
'">';
601 if (empty($action) || $action ==
"view" || $action ==
"close") {
605 print $langs->trans(
"ErrorRecordNotFound");
608 $head[0][0] = DOL_URL_ROOT.
'/compta/cashcontrol/cashcontrol_card.php?id='.
$object->id;
609 $head[0][1] = $langs->trans(
"CashControl");
610 $head[0][2] =
'cashcontrol';
612 print
dol_get_fiche_head($head,
'cashcontrol', $langs->trans(
"CashControl"), -1,
'account');
614 $linkback =
'<a href="'.DOL_URL_ROOT.
'/compta/cashcontrol/cashcontrol_list.php?restore_lastsearch_values=1">'.$langs->trans(
"BackToList").
'</a>';
616 $morehtmlref =
'<div class="refidno">';
617 $morehtmlref .=
'</div>';
620 dol_banner_tab(
$object,
'id', $linkback, 1,
'rowid',
'rowid', $morehtmlref);
622 print
'<div class="fichecenter">';
623 print
'<div class="fichehalfleft">';
624 print
'<div class="underbanner clearboth"></div>';
625 print
'<table class="border tableforfield" width="100%">';
627 print
'<tr><td class="titlefield nowrap">';
628 print $langs->trans(
"Ref");
633 print
'<tr><td valign="middle">'.$langs->trans(
"Module").
'</td><td>';
637 print
'<tr><td valign="middle">'.$langs->trans(
"Terminal").
'</td><td>';
641 print
'<tr><td class="nowrap">';
642 print $langs->trans(
"Period");
645 print(
$object->month_close ?
"-" :
"").$object->month_close;
646 print(
$object->day_close ?
"-" :
"").$object->day_close;
652 print
'<div class="fichehalfright">';
653 print
'<div class="underbanner clearboth"></div>';
655 print
'<table class="border tableforfield centpercent">';
657 print
'<tr><td class="titlefield nowrap">';
658 print $langs->trans(
"DateCreationShort");
663 print
'<tr><td valign="middle">'.$langs->trans(
"InitialBankBalance").
' - '.$langs->trans(
"Cash").
'</td><td>';
664 print
'<span class="amount">'.price(
$object->opening, 0, $langs, 1, -1, -1, $conf->currency).
'</span>';
666 foreach ($arrayofpaymentmode as $key => $val) {
667 print
'<tr><td valign="middle">'.$langs->trans($val).
'</td><td>';
668 print
'<span class="amount">'.price(
$object->$key, 0, $langs, 1, -1, -1, $conf->currency).
'</span>';
674 print
'</div></div>';
675 print
'<div class="clearboth"></div>';
679 if ($action !=
'close') {
680 print
'<div class="tabsAction">';
682 print
'<div class="inline-block divButAction"><a target="_blank" rel="noopener noreferrer" class="butAction" href="report.php?id='.((int) $id).
'">'.$langs->trans(
'PrintTicket').
'</a></div>';
684 if (
$object->status == CashControl::STATUS_DRAFT) {
685 print
'<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER[
"PHP_SELF"].
'?id='.((int) $id).
'&action=close&token='.
newToken().
'&contextpage='.$contextpage.
'">'.$langs->trans(
'Close').
'</a></div>';
687 print
'<div class="inline-block divButAction"><a class="butActionDelete" href="'.$_SERVER[
"PHP_SELF"].
'?id='.((int) $id).
'&action=confirm_delete&token='.
newToken().
'">'.$langs->trans(
'Delete').
'</a></div>';
689 print
'<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER[
"PHP_SELF"].
'?id='.((int) $id).
'&action=reopen&token='.
newToken().
'">'.$langs->trans(
'ReOpen').
'</a></div>';
694 if ($contextpage !=
'takepos') {
695 print
'<center><iframe src="report.php?id='.$id.
'" width="60%" height="800"></iframe></center>';
698 print
'<form method="POST" action="'.$_SERVER[
"PHP_SELF"].
'" name="formclose">';
699 print
'<input type="hidden" name="token" value="'.newToken().
'">';
700 if ($contextpage ==
'takepos') {
701 print
'<input type="hidden" name="contextpage" value="takepos">';
704 print
'<input type="hidden" name="action" value="add">';
705 } elseif ($action ==
'close') {
706 print
'<input type="hidden" name="action" value="valid">';
707 print
'<input type="hidden" name="id" value="'.$id.
'">';
709 print
'<input type="hidden" name="action" value="start">';
764 if (($action ==
'start' &&
GETPOST(
'posnumber') !=
'' &&
GETPOST(
'posnumber') !=
'' &&
GETPOST(
'posnumber') !=
'-1') || $action ==
'close') {
765 $posmodule =
$object->posmodule;
766 $terminalid =
$object->posnumber;
770 print
'<div class="div-table-responsive-no-min">';
771 print
'<table class="noborder centpercent">';
773 print
'<tr class="liste_titre">';
775 print
'<td class="center">'.$langs->trans(
"InitialBankBalance");
779 print
'<td align="center" class="hide0" colspan="'.count($arrayofpaymentmode).
'">';
780 print $langs->trans(
"AmountAtEndOfPeriod");
785 print
'<tr class="liste_titre">';
787 print
'<td class="center">'.$langs->trans(
"Cash");
791 foreach ($arrayofpaymentmode as $key => $val) {
792 print
'<td align="center"'.($i == 0 ?
' class="hide0"' :
'').
'>'.$langs->trans($val);
802 print
'<td>'.$langs->trans(
"NbOfInvoices").
'</td>';
803 print
'<td class="center">';
807 foreach ($arrayofpaymentmode as $key => $val) {
808 print
'<td align="center"'.($i == 0 ?
' class="hide0"' :
'').
'>';
809 print $theoricalnbofinvoiceforterminal[$terminalid][$key];
814 print
'<td align="center"></td>';
819 print
'<td>'.$langs->trans(
"TheoricalAmount").
'</td>';
820 print
'<td class="center">';
821 print
price($initialbalanceforterminal[$terminalid][
'cash']).
'<br>';
825 foreach ($arrayofpaymentmode as $key => $val) {
826 print
'<td align="center"'.($i == 0 ?
' class="hide0"' :
'').
'>';
827 if ($key ==
'cash') {
828 $deltaforcash = (
$object->opening - $initialbalanceforterminal[$terminalid][
'cash']);
829 print
price($theoricalamountforterminal[$terminalid][$key] + $deltaforcash).
'<br>';
831 print
price($theoricalamountforterminal[$terminalid][$key]).
'<br>';
837 print
'<td align="center"></td>';
841 print
'<td>'.$langs->trans(
"RealAmount").
'</td>';
843 print
'<td class="center">';
845 if ($action ==
'close') {
848 print
'name="opening" type="text" class="maxwidth100 center" value="';
849 if ($action ==
'close') {
859 foreach ($arrayofpaymentmode as $key => $val) {
860 print
'<td align="center"'.($i == 0 ?
' class="hide0"' :
'').
'>';
862 if ($action ==
'start') {
865 print
'name="'.$key.
'_amount" type="text"'.($key ==
'cash' ?
' autofocus' :
'').
' class="maxwidth100 center" value="'.
GETPOST($key.
'_amount',
'alpha').
'">';
870 print
'<td class="center">';
871 print
'<input type="submit" name="cancel" class="button button-cancel" value="'.$langs->trans(
"Cancel").
'">';
872 if ($action ==
'start') {
873 print
'<input type="submit" name="add" class="button button-save" value="'.$langs->trans(
"Save").
'">';
874 } elseif ($action ==
'close') {
875 print
'<input type="submit" name="valid" class="button" value="'.$langs->trans(
"Close").
'">';
if($user->socid > 0) if(! $user->hasRight('accounting', 'chartofaccount')) $object
if(!defined('NOREQUIRESOC')) if(!defined('NOREQUIRETRAN')) if(!defined('NOTOKENRENEWAL')) if(!defined('NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined('NOREQUIREAJAX')) llxHeader()
Empty header.
Class to manage cash fence.
if(isModEnabled('invoice') && $user->hasRight('facture', 'lire')) if((isModEnabled('fournisseur') &&!getDolGlobalString('MAIN_USE_NEW_SUPPLIERMOD') && $user->hasRight("fournisseur", "facture", "lire"))||(isModEnabled('supplier_invoice') && $user->hasRight("supplier_invoice", "lire"))) if(isModEnabled('don') && $user->hasRight('don', 'lire')) if(isModEnabled('tax') && $user->hasRight('tax', 'charges', 'lire')) if(isModEnabled('invoice') &&isModEnabled('order') && $user->hasRight("commande", "lire") &&!getDolGlobalString('WORKFLOW_DISABLE_CREATE_INVOICE_FROM_ORDER')) $sql
Social contributions to pay.
dol_get_first_day($year, $month=1, $gm=false)
Return GMT time for first day of a month or year.
dol_get_last_day($year, $month=12, $gm=false)
Return GMT time for last day of a month or year.
dol_mktime($hour, $minute, $second, $month, $day, $year, $gm='auto', $check=1)
Return a timestamp date built from detailed information (by default a local PHP server timestamp) Rep...
load_fiche_titre($title, $morehtmlright='', $picto='generic', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='')
Load a title with picto.
GETPOSTINT($paramname, $method=0)
Return the value of a $_GET or $_POST supervariable, converted into integer.
dol_get_fiche_head($links=array(), $active='', $title='', $notab=0, $picto='', $pictoisfullpath=0, $morehtmlright='', $morecss='', $limittoshow=0, $moretabssuffix='', $dragdropfile=0)
Show tabs of a record.
price2num($amount, $rounding='', $option=0)
Function that return a number with universal decimal format (decimal separator is '.
dol_get_fiche_end($notab=0)
Return tab footer of a card.
price($amount, $form=0, $outlangs='', $trunc=1, $rounding=-1, $forcerounding=-1, $currency_code='')
Function to format a value into an amount for visual output Function used into PDF and HTML pages.
dol_now($mode='auto')
Return date for now.
getDolGlobalInt($key, $default=0)
Return a Dolibarr global constant int value.
dol_print_date($time, $format='', $tzoutput='auto', $outputlangs=null, $encodetooutput=false)
Output date in a string format according to outputlangs (or langs if not defined).
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)
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.
dol_print_error($db=null, $error='', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
GETPOSTISSET($paramname)
Return true if we are in a context of submitting the parameter $paramname from a POST of a form.
getDolGlobalString($key, $default='')
Return dolibarr global constant string value.
isModEnabled($module)
Is Dolibarr module enabled.
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program.