33require
'../../main.inc.php';
34require_once DOL_DOCUMENT_ROOT.
'/core/lib/date.lib.php';
35require_once DOL_DOCUMENT_ROOT.
'/compta/bank/class/account.class.php';
36require_once DOL_DOCUMENT_ROOT.
'/compta/cashcontrol/class/cashcontrol.class.php';
38$langs->loadLangs(array(
"install",
"cashdesk",
"admin",
"banks"));
42$action =
GETPOST(
'action',
'aZ09');
52$sortfield =
GETPOST(
'sortfield',
'aZ09comma');
53$sortorder =
GETPOST(
'sortorder',
'aZ09comma');
55if (empty($page) || $page == -1) {
58$offset = $limit * $page;
67$contextpage =
GETPOST(
'contextpage',
'aZ') ?
GETPOST(
'contextpage',
'aZ') :
'thirdpartylist';
69if ($contextpage ==
'takepos') {
73$arrayofpaymentmode = array(
'cash' =>
'Cash',
'cheque' =>
'Cheque',
'card' =>
'CreditCard');
75$arrayofposavailable = array();
76if (isModEnabled(
'cashdesk')) {
77 $arrayofposavailable[
'cashdesk'] = $langs->trans(
'CashDesk').
' (cashdesk)';
79if (isModEnabled(
'takepos')) {
80 $arrayofposavailable[
'takepos'] = $langs->trans(
'TakePOS').
' (takepos)';
88$extrafields->fetch_name_optionals_label(
$object->table_element);
91$hookmanager->initHooks(array(
'cashcontrolcard',
'globalcard'));
94include DOL_DOCUMENT_ROOT.
'/core/actions_fetchobject.inc.php';
97if ($user->socid > 0) {
101if (!$user->hasRight(
"cashdesk",
"run") && !$user->hasRight(
"takepos",
"run")) {
105$permissiontoadd = ($user->hasRight(
"cashdesk",
"run") || $user->hasRight(
"takepos",
"run"));
106$permissiontodelete = ($user->hasRight(
"cashdesk",
"run") || $user->hasRight(
"takepos",
"run")) || ($permissiontoadd &&
$object->status == 0);
113if (empty($backtopage)) {
114 $backtopage = DOL_URL_ROOT.
'/compta/cashcontrol/cashcontrol_card.php?id='.(!empty($id) &&
$id > 0 ?
$id :
'__ID__');
116$backurlforlist = DOL_URL_ROOT.
'/compta/cashcontrol/cashcontrol_list.php';
117$triggermodname =
'CACHCONTROL_MODIFY';
120 setEventMessages($langs->trans(
"CashDesk").
" - ".$langs->trans(
"NotConfigured"),
null,
'errors');
124if (
GETPOST(
'cancel',
'alpha')) {
125 if ($action ==
'valid') {
132if ($action ==
"reopen" && $permissiontoadd) {
133 $result =
$object->setStatut($object::STATUS_DRAFT,
null,
'',
'CASHFENCE_REOPEN');
141if ($action ==
"start" && $permissiontoadd) {
143 if (!
GETPOST(
'posmodule',
'alpha') ||
GETPOST(
'posmodule',
'alpha') ==
'-1') {
144 setEventMessages($langs->trans(
"ErrorFieldRequired", $langs->transnoentitiesnoconv(
"Module")),
null,
'errors');
148 if (
GETPOST(
'posnumber',
'alpha') ==
'') {
149 setEventMessages($langs->trans(
"ErrorFieldRequired", $langs->transnoentitiesnoconv(
"CashDesk")),
null,
'errors');
153 if (!
GETPOST(
'closeyear',
'alpha') ||
GETPOST(
'closeyear',
'alpha') ==
'-1') {
154 setEventMessages($langs->trans(
"ErrorFieldRequired", $langs->transnoentitiesnoconv(
"Year")),
null,
'errors');
158} elseif ($action ==
"add" && $permissiontoadd) {
159 if (
GETPOST(
'opening',
'alpha') ==
'') {
160 setEventMessages($langs->trans(
"ErrorFieldRequired", $langs->transnoentitiesnoconv(
"InitialBankBalance")),
null,
'errors');
165 foreach ($arrayofpaymentmode as $key => $val) {
190 if ($contextpage ==
'takepos') {
193 parent.location.href='../../takepos/index.php?place='+parent.place;
199if ($action ==
"valid" && $permissiontoadd) {
214 $result =
$object->update($user);
216 $result =
$object->valid($user);
226 if ($contextpage ==
'takepos') {
229 parent.location.href='../../takepos/index.php?place='+parent.place;
237if ($action ==
'confirm_delete' && !empty($permissiontodelete)) {
241 dol_print_error(
null,
'Error, object must be fetched before being deleted');
245 $result =
$object->delete($user);
250 header(
"Location: ".$backurlforlist);
266$form =
new Form($db);
268$initialbalanceforterminal = array();
269$theoricalamountforterminal = array();
270$theoricalnbofinvoiceforterminal = array();
273llxHeader(
'', $langs->trans(
"CashControl"));
276if ($action ==
"create" || $action ==
"start" || $action ==
'close') {
277 if ($action ==
'close') {
278 $posmodule =
$object->posmodule;
279 $terminalid =
$object->posnumber;
280 $terminaltouse = $terminalid;
283 $smonth =
$object->month_close;
285 } elseif (
GETPOST(
'posnumber',
'alpha') !=
'' &&
GETPOST(
'posnumber',
'alpha') !=
'' &&
GETPOST(
'posnumber',
'alpha') !=
'-1') {
286 $posmodule =
GETPOST(
'posmodule',
'alpha');
287 $terminalid =
GETPOST(
'posnumber',
'alpha');
288 $terminaltouse = $terminalid;
290 if ($terminaltouse ==
'1' && $posmodule ==
'cashdesk') {
294 if ($posmodule ==
'cashdesk' && $terminaltouse !=
'' && $terminaltouse !=
'1') {
296 setEventMessages($langs->trans(
"OnlyTerminal1IsAvailableForCashDeskModule"),
null,
'errors');
301 if (isset($terminalid) && $terminalid !=
'') {
303 foreach ($arrayofpaymentmode as $key => $val) {
304 if ($key !=
'cash') {
305 $initialbalanceforterminal[$terminalid][$key] = 0;
310 $vartouse =
'CASHDESK_ID_BANKACCOUNT_CASH'.$terminaltouse;
314 $sql =
"SELECT SUM(amount) as total FROM ".MAIN_DB_PREFIX.
"bank";
315 $sql .=
" WHERE fk_account = ".((int) $bankid);
316 if ($syear && !$smonth) {
318 } elseif ($syear && $smonth && !$sday) {
320 } elseif ($syear && $smonth && $sday) {
321 $sql .=
" AND dateo < '".$db->idate(
dol_mktime(0, 0, 0, $smonth, $sday, $syear)).
"'";
326 $resql = $db->query($sql);
328 $obj = $db->fetch_object($resql);
330 $initialbalanceforterminal[$terminalid][$key] = $obj->total;
336 setEventMessages($langs->trans(
"SetupOfTerminalNotComplete", $terminaltouse),
null,
'errors');
342 foreach ($arrayofpaymentmode as $key => $val) {
343 $sql =
"SELECT SUM(pf.amount) as total, COUNT(*) as nb";
344 $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";
345 $sql .=
" WHERE pf.fk_facture = f.rowid AND p.rowid = pf.fk_paiement AND cp.id = p.fk_paiement";
346 $sql .=
" AND f.module_source = '".$db->escape($posmodule).
"'";
347 $sql .=
" AND f.pos_source = '".$db->escape($terminalid).
"'";
348 $sql .=
" AND f.paye = 1";
349 $sql .=
" AND p.entity IN (".getEntity(
'facture').
")";
350 if ($key ==
'cash') {
351 $sql .=
" AND cp.code = 'LIQ'";
352 } elseif ($key ==
'cheque') {
353 $sql .=
" AND cp.code = 'CHQ'";
354 } elseif ($key ==
'card') {
355 $sql .=
" AND cp.code = 'CB'";
360 if ($syear && !$smonth) {
362 } elseif ($syear && $smonth && !$sday) {
364 } elseif ($syear && $smonth && $sday) {
365 $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)).
"'";
370 $resql = $db->query($sql);
372 $theoricalamountforterminal[$terminalid][$key] = $initialbalanceforterminal[$terminalid][$key];
374 $obj = $db->fetch_object($resql);
376 $theoricalamountforterminal[$terminalid][$key] =
price2num($theoricalamountforterminal[$terminalid][$key] + $obj->total);
377 $theoricalnbofinvoiceforterminal[$terminalid][$key] = $obj->nb;
386 if ($action !=
'close') {
387 print
load_fiche_titre($langs->trans(
"CashControl").
" - ".$langs->trans(
"New"),
'',
'cash-register');
389 print
'<form method="POST" action="'.$_SERVER[
"PHP_SELF"].
'">';
390 print
'<input type="hidden" name="token" value="'.newToken().
'">';
391 if ($contextpage ==
'takepos') {
392 print
'<input type="hidden" name="contextpage" value="takepos">';
395 print
'<input type="hidden" name="action" value="add">';
396 } elseif ($action ==
'close') {
397 print
'<input type="hidden" name="action" value="valid">';
398 print
'<input type="hidden" name="id" value="'.$id.
'">';
400 print
'<input type="hidden" name="action" value="start">';
403 print
'<div class="div-table-responsive-no-min">';
404 print
'<table class="noborder centpercent">';
405 print
'<tr class="liste_titre">';
406 print
'<td>'.$langs->trans(
"Module").
'</td>';
407 print
'<td>'.$langs->trans(
"Terminal").
'</td>';
408 print
'<td>'.$langs->trans(
"Year").
'</td>';
409 print
'<td>'.$langs->trans(
"Month").
'</td>';
410 print
'<td>'.$langs->trans(
"Day").
'</td>';
417 print
'<tr class="oddeven">';
418 print
'<td>'.$form->selectarray(
'posmodule', $arrayofposavailable,
GETPOST(
'posmodule',
'alpha'), (count($arrayofposavailable) > 1 ? 1 : 0)).
'</td>';
421 $arrayofpos = array();
423 for ($i = 1; $i <= $numterminals; $i++) {
425 $arrayofpos[$i] = array(
'id' => $i,
'label' => (($nameofterminal !=
"TAKEPOS_TERMINAL_NAME_".$i) ?
'#'.$i.
' '.$nameofterminal : $i),
'data-html' => (($nameofterminal !=
"TAKEPOS_TERMINAL_NAME_".$i) ?
'#'.$i.
' - '.$nameofterminal : $i));
427 $selectedposnumber = 0;
430 $selectedposnumber = 1;
433 print $form->selectarray(
'posnumber', $arrayofpos, GETPOSTISSET(
'posnumber') ?
GETPOSTINT(
'posnumber') : $selectedposnumber, $showempty);
438 $retstring =
'<select'.($disabled ?
' disabled' :
'').
' class="flat valignmiddle maxwidth75imp" id="'.$prefix.
'year" name="'.$prefix.
'year">';
439 for ($year = $syear - 10; $year < $syear + 10; $year++) {
440 $retstring .=
'<option value="'.$year.
'"'.($year == $syear ?
' selected' :
'').
'>'.$year.
'</option>';
442 $retstring .=
"</select>\n";
447 $retstring =
'<select'.($disabled ?
' disabled' :
'').
' class="flat valignmiddle maxwidth75imp" id="'.$prefix.
'month" name="'.$prefix.
'month">';
448 $retstring .=
'<option value="0"></option>';
449 for ($month = 1; $month <= 12; $month++) {
450 $retstring .=
'<option value="'.$month.
'"'.($month == $smonth ?
' selected' :
'').
'>';
451 $retstring .=
dol_print_date(mktime(12, 0, 0, $month, 1, 2000),
"%b");
452 $retstring .=
"</option>";
454 $retstring .=
"</select>";
459 $retstring =
'<select'.($disabled ?
' disabled' :
'').
' class="flat valignmiddle maxwidth50imp" id="'.$prefix.
'day" name="'.$prefix.
'day">';
460 $retstring .=
'<option value="0" selected> </option>';
461 for ($day = 1; $day <= 31; $day++) {
462 $retstring .=
'<option value="'.$day.
'"'.($day == $sday ?
' selected' :
'').
'>'.$day.
'</option>';
464 $retstring .=
"</select>";
469 if ($action ==
'start' &&
GETPOST(
'posnumber') !=
'' &&
GETPOST(
'posnumber') !=
'' &&
GETPOST(
'posnumber') !=
'-1') {
472 print
'<input type="submit" name="add" class="button" value="'.$langs->trans(
"Start").
'">';
479 if (($action ==
'start' &&
GETPOST(
'posnumber') !=
'' &&
GETPOST(
'posnumber') !=
'' &&
GETPOST(
'posnumber') !=
'-1') || $action ==
'close') {
480 $posmodule =
GETPOST(
'posmodule',
'alpha');
481 $terminalid =
GETPOST(
'posnumber',
'alpha');
485 print
'<div class="div-table-responsive-no-min">';
486 print
'<table class="noborder centpercent">';
488 print
'<tr class="liste_titre">';
490 print
'<td class="center">'.$langs->trans(
"InitialBankBalance");
502 print
'<tr class="liste_titre">';
504 print
'<td class="center">'.$langs->trans(
"Cash");
540 print
'<td>'.$langs->trans(
"TheoricalAmount").
'</td>';
541 print
'<td class="center">';
542 print
price($initialbalanceforterminal[$terminalid][
'cash']).
'<br>';
558 print
'<td>'.$langs->trans(
"RealAmount").
'</td>';
560 print
'<td class="center">';
562 if ($action ==
'close') {
565 print
'name="opening" type="text" class="maxwidth100 center" value="';
566 if ($action ==
'close') {
570 print(GETPOSTISSET(
'opening') ?
price2num(
GETPOST(
'opening',
'alpha')) :
price($initialbalanceforterminal[$terminalid][
'cash']));
586 print
'<td class="center">';
587 print
'<input type="submit" name="cancel" class="button button-cancel" value="'.$langs->trans(
"Cancel").
'">';
588 if ($action ==
'start') {
589 print
'<input type="submit" name="add" class="button button-save" value="'.$langs->trans(
"Save").
'">';
590 } elseif ($action ==
'close') {
591 print
'<input type="submit" name="valid" class="button" value="'.$langs->trans(
"Validate").
'">';
604if (empty($action) || $action ==
"view" || $action ==
"close") {
608 print $langs->trans(
"ErrorRecordNotFound");
611 $head[0][0] = DOL_URL_ROOT.
'/compta/cashcontrol/cashcontrol_card.php?id='.
$object->id;
612 $head[0][1] = $langs->trans(
"CashControl");
613 $head[0][2] =
'cashcontrol';
615 print
dol_get_fiche_head($head,
'cashcontrol', $langs->trans(
"CashControl"), -1,
'account');
617 $linkback =
'<a href="'.DOL_URL_ROOT.
'/compta/cashcontrol/cashcontrol_list.php?restore_lastsearch_values=1">'.$langs->trans(
"BackToList").
'</a>';
619 $morehtmlref =
'<div class="refidno">';
620 $morehtmlref .=
'</div>';
623 dol_banner_tab($object,
'id', $linkback, 1,
'rowid',
'rowid', $morehtmlref);
625 print
'<div class="fichecenter">';
626 print
'<div class="fichehalfleft">';
627 print
'<div class="underbanner clearboth"></div>';
628 print
'<table class="border tableforfield" width="100%">';
630 print
'<tr><td class="titlefield nowrap">';
631 print $langs->trans(
"Ref");
636 print
'<tr><td valign="middle">'.$langs->trans(
"Module").
'</td><td>';
640 print
'<tr><td valign="middle">'.$langs->trans(
"Terminal").
'</td><td>';
644 print
'<tr><td class="nowrap">';
645 print $langs->trans(
"Period");
655 print
'<div class="fichehalfright">';
656 print
'<div class="underbanner clearboth"></div>';
658 print
'<table class="border tableforfield centpercent">';
660 print
'<tr><td class="titlefield nowrap">';
661 print $langs->trans(
"DateCreationShort");
666 print
'<tr><td valign="middle">'.$langs->trans(
"InitialBankBalance").
' - '.$langs->trans(
"Cash").
'</td><td>';
667 print
'<span class="amount">'.price(
$object->opening, 0, $langs, 1, -1, -1, $conf->currency).
'</span>';
669 foreach ($arrayofpaymentmode as $key => $val) {
670 print
'<tr><td valign="middle">'.$langs->trans($val).
'</td><td>';
671 print
'<span class="amount">'.price(
$object->$key, 0, $langs, 1, -1, -1, $conf->currency).
'</span>';
677 print
'</div></div>';
678 print
'<div class="clearboth"></div>';
682 if ($action !=
'close') {
683 print
'<div class="tabsAction">';
686 print
'<div class="inline-block divButAction"><a target="_blank" rel="noopener noreferrer" class="butAction" href="report.php?id='.((int) $id).
'">'.$langs->trans(
'PrintReport').
'</a></div>';
689 print
'<div class="inline-block divButAction"><a target="_blank" rel="noopener noreferrer" class="butAction" href="report.php?id='.((int) $id).
'&summaryonly=1">'.$langs->trans(
'PrintReportNoDetail').
'</a></div>';
691 if (
$object->status == CashControl::STATUS_DRAFT) {
692 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>';
694 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>';
696 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>';
701 if ($contextpage !=
'takepos') {
702 print
'<center><iframe src="report.php?id='.$id.
'" width="60%" height="800"></iframe></center>';
705 print
'<form method="POST" action="'.$_SERVER[
"PHP_SELF"].
'" name="formclose">';
706 print
'<input type="hidden" name="token" value="'.newToken().
'">';
707 if ($contextpage ==
'takepos') {
708 print
'<input type="hidden" name="contextpage" value="takepos">';
711 print
'<input type="hidden" name="action" value="add">';
712 } elseif ($action ==
'close') {
713 print
'<input type="hidden" name="action" value="valid">';
714 print
'<input type="hidden" name="id" value="'.$id.
'">';
716 print
'<input type="hidden" name="action" value="start">';
771 if (($action ==
'start' &&
GETPOST(
'posnumber') !=
'' &&
GETPOST(
'posnumber') !=
'' &&
GETPOST(
'posnumber') !=
'-1') || $action ==
'close') {
772 $posmodule =
$object->posmodule;
773 $terminalid =
$object->posnumber;
777 print
'<div class="div-table-responsive-no-min">';
778 print
'<table class="noborder centpercent">';
780 print
'<tr class="liste_titre">';
782 print
'<td class="center">'.$langs->trans(
"InitialBankBalance");
786 print
'<td align="center" class="hide0" colspan="'.count($arrayofpaymentmode).
'">';
787 print $langs->trans(
"AmountAtEndOfPeriod");
792 print
'<tr class="liste_titre">';
794 print
'<td class="center">'.$langs->trans(
"Cash");
798 foreach ($arrayofpaymentmode as $key => $val) {
799 print
'<td align="center"'.($i == 0 ?
' class="hide0"' :
'').
'>'.$langs->trans($val);
809 print
'<td>'.$langs->trans(
"NbOfInvoices").
'</td>';
810 print
'<td class="center">';
814 foreach ($arrayofpaymentmode as $key => $val) {
815 print
'<td align="center"'.($i == 0 ?
' class="hide0"' :
'').
'>';
816 print $theoricalnbofinvoiceforterminal[$terminalid][$key];
821 print
'<td align="center"></td>';
826 print
'<td>'.$langs->trans(
"TheoricalAmount").
'</td>';
827 print
'<td class="center">';
828 print
price($initialbalanceforterminal[$terminalid][
'cash']).
'<br>';
832 foreach ($arrayofpaymentmode as $key => $val) {
833 print
'<td align="center"'.($i == 0 ?
' class="hide0"' :
'').
'>';
834 if ($key ==
'cash') {
835 $deltaforcash = ((float)
$object->opening - $initialbalanceforterminal[$terminalid][
'cash']);
836 print
price($theoricalamountforterminal[$terminalid][$key] + $deltaforcash).
'<br>';
838 print
price($theoricalamountforterminal[$terminalid][$key]).
'<br>';
844 print
'<td align="center"></td>';
848 print
'<td>'.$langs->trans(
"RealAmount").
'</td>';
850 print
'<td class="center">';
852 if ($action ==
'close') {
855 print
'name="opening" type="text" class="maxwidth100 center" value="';
856 if ($action ==
'close') {
860 print(GETPOSTISSET(
'opening') ?
price2num(
GETPOST(
'opening',
'alpha')) :
price($initialbalanceforterminal[$terminalid][
'cash']));
866 foreach ($arrayofpaymentmode as $key => $val) {
867 print
'<td align="center"'.($i == 0 ?
' class="hide0"' :
'').
'>';
869 if ($action ==
'start') {
872 print
'name="'.$key.
'_amount" type="text"'.($key ==
'cash' ?
' autofocus' :
'').
' class="maxwidth100 center" value="'.
GETPOST($key.
'_amount',
'alpha').
'">';
877 print
'<td class="center">';
878 print
'<input type="submit" name="cancel" class="button button-cancel" value="'.$langs->trans(
"Cancel").
'">';
879 if ($action ==
'start') {
880 print
'<input type="submit" name="add" class="button button-save" value="'.$langs->trans(
"Save").
'">';
881 } elseif ($action ==
'close') {
882 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($head='', $title='', $help_url='', $target='', $disablejs=0, $disablehead=0, $arrayofjs='', $arrayofcss='', $morequerystring='', $morecssonbody='', $replacemainareaby='', $disablenofollow=0, $disablenoindex=0)
Empty header.
Class to manage cash fence.
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.
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='', $noduplicate=0, $attop=0)
Set event messages in dol_events session object.
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.
dol_print_error($db=null, $error='', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
getDolGlobalString($key, $default='')
Return a 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.