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';
46$langs->loadLangs(array(
"install",
"cashdesk",
"admin",
"banks"));
50$action =
GETPOST(
'action',
'aZ09');
60$sortfield =
GETPOST(
'sortfield',
'aZ09comma');
61$sortorder =
GETPOST(
'sortorder',
'aZ09comma');
63if (empty($page) || $page == -1) {
66$offset = $limit * $page;
75$contextpage =
GETPOST(
'contextpage',
'aZ') ?
GETPOST(
'contextpage',
'aZ') :
'thirdpartylist';
77if ($contextpage ==
'takepos') {
81$arrayofpaymentmode = array(
'cash' =>
'Cash',
'cheque' =>
'Cheque',
'card' =>
'CreditCard');
83$arrayofposavailable = array();
84if (isModEnabled(
'cashdesk')) {
85 $arrayofposavailable[
'cashdesk'] = $langs->trans(
'CashDesk').
' (cashdesk)';
87if (isModEnabled(
'takepos')) {
88 $arrayofposavailable[
'takepos'] = $langs->trans(
'TakePOS').
' (takepos)';
96$extrafields->fetch_name_optionals_label(
$object->table_element);
99$hookmanager->initHooks(array(
'cashcontrolcard',
'globalcard'));
102include DOL_DOCUMENT_ROOT.
'/core/actions_fetchobject.inc.php';
105if ($user->socid > 0) {
109if (!$user->hasRight(
"cashdesk",
"run") && !$user->hasRight(
"takepos",
"run")) {
113$permissiontoadd = ($user->hasRight(
"cashdesk",
"run") || $user->hasRight(
"takepos",
"run"));
114$permissiontodelete = ($user->hasRight(
"cashdesk",
"run") || $user->hasRight(
"takepos",
"run")) || ($permissiontoadd &&
$object->status == 0);
122if (empty($backtopage)) {
123 $backtopage = DOL_URL_ROOT.
'/compta/cashcontrol/cashcontrol_card.php?id='.(!empty($id) &&
$id > 0 ?
$id :
'__ID__');
125$backurlforlist = DOL_URL_ROOT.
'/compta/cashcontrol/cashcontrol_list.php';
126$triggermodname =
'CACHCONTROL_MODIFY';
129 setEventMessages($langs->trans(
"CashDesk").
" - ".$langs->trans(
"NotConfigured"),
null,
'errors');
133if (
GETPOST(
'cancel',
'alpha')) {
134 if ($action ==
'valid') {
141if ($action ==
"reopen" && $permissiontoadd) {
142 $result =
$object->setStatut($object::STATUS_DRAFT,
null,
'',
'CASHFENCE_REOPEN');
150if ($action ==
"start" && $permissiontoadd) {
151 if (!
GETPOST(
'posmodule',
'alpha') ||
GETPOST(
'posmodule',
'alpha') ==
'-1') {
152 setEventMessages($langs->trans(
"ErrorFieldRequired", $langs->transnoentitiesnoconv(
"Module")),
null,
'errors');
156 if (
GETPOST(
'posnumber',
'alpha') ==
'') {
157 setEventMessages($langs->trans(
"ErrorFieldRequired", $langs->transnoentitiesnoconv(
"CashDesk")),
null,
'errors');
161 if (!
GETPOST(
'closeyear',
'alpha') ||
GETPOST(
'closeyear',
'alpha') ==
'-1') {
162 setEventMessages($langs->trans(
"ErrorFieldRequired", $langs->transnoentitiesnoconv(
"Year")),
null,
'errors');
166} elseif ($action ==
"add" && $permissiontoadd) {
167 if (
GETPOST(
'opening',
'alpha') ==
'') {
168 setEventMessages($langs->trans(
"ErrorFieldRequired", $langs->transnoentitiesnoconv(
"InitialBankBalance")),
null,
'errors');
172 foreach ($arrayofpaymentmode as $key => $val) {
197 if ($contextpage ==
'takepos') {
200 parent.location.href='../../takepos/index.php?place='+parent.place;
206if ($action ==
"valid" && $permissiontoadd) {
221 $result =
$object->update($user);
223 $result =
$object->valid($user);
233 if ($contextpage ==
'takepos') {
236 parent.location.href='../../takepos/index.php?place='+parent.place;
244if ($action ==
'confirm_delete' && !empty($permissiontodelete)) {
248 dol_print_error(
null,
'Error, object must be fetched before being deleted');
252 $result =
$object->delete($user);
257 header(
"Location: ".$backurlforlist);
273$form =
new Form($db);
275$initialbalanceforterminal = array();
276$theoricalamountforterminal = array();
277$theoricalnbofinvoiceforterminal = array();
280llxHeader(
'', $langs->trans(
"CashControl"));
286if ($action ==
"create" || $action ==
"start" || $action ==
'close') {
287 if ($action ==
'close') {
288 $posmodule =
$object->posmodule;
289 $terminalid =
$object->posnumber;
290 $terminaltouse = $terminalid;
293 $smonth =
$object->month_close;
295 } elseif (
GETPOST(
'posnumber',
'alpha') !=
'' &&
GETPOST(
'posnumber',
'alpha') !=
'' &&
GETPOST(
'posnumber',
'alpha') !=
'-1') {
296 $posmodule =
GETPOST(
'posmodule',
'alpha');
297 $terminalid =
GETPOST(
'posnumber',
'alpha');
298 $terminaltouse = $terminalid;
300 if ($terminaltouse ==
'1' && $posmodule ==
'cashdesk') {
304 if ($posmodule ==
'cashdesk' && $terminaltouse !=
'' && $terminaltouse !=
'1') {
306 setEventMessages($langs->trans(
"OnlyTerminal1IsAvailableForCashDeskModule"),
null,
'errors');
311 if (isset($terminalid) && $terminalid !=
'' && isset($posmodule)) {
313 foreach ($arrayofpaymentmode as $key => $val) {
314 if ($key !=
'cash') {
315 $initialbalanceforterminal[$terminalid][$key] = 0;
320 $vartouse =
'CASHDESK_ID_BANKACCOUNT_CASH'.$terminaltouse;
324 $sql =
"SELECT SUM(amount) as total FROM ".MAIN_DB_PREFIX.
"bank";
325 $sql .=
" WHERE fk_account = ".((int) $bankid);
326 if ($syear && !$smonth) {
328 } elseif ($syear && $smonth && !$sday) {
330 } elseif ($syear && $smonth && $sday) {
331 $sql .=
" AND dateo < '".$db->idate(
dol_mktime(0, 0, 0, $smonth, $sday, $syear)).
"'";
336 $resql = $db->query($sql);
338 $obj = $db->fetch_object($resql);
340 $initialbalanceforterminal[$terminalid][$key] = $obj->total;
346 setEventMessages($langs->trans(
"SetupOfTerminalNotComplete", $terminaltouse),
null,
'errors');
352 foreach ($arrayofpaymentmode as $key => $val) {
353 $sql =
"SELECT SUM(pf.amount) as total, COUNT(*) as nb";
354 $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";
355 $sql .=
" WHERE pf.fk_facture = f.rowid AND p.rowid = pf.fk_paiement AND cp.id = p.fk_paiement";
356 $sql .=
" AND f.module_source = '".$db->escape($posmodule).
"'";
357 $sql .=
" AND f.pos_source = '".$db->escape($terminalid).
"'";
358 $sql .=
" AND f.paye = 1";
359 $sql .=
" AND p.entity IN (".getEntity(
'facture').
")";
360 if ($key ==
'cash') {
361 $sql .=
" AND cp.code = 'LIQ'";
362 } elseif ($key ==
'cheque') {
363 $sql .=
" AND cp.code = 'CHQ'";
364 } elseif ($key ==
'card') {
365 $sql .=
" AND cp.code = 'CB'";
370 if ($syear && !$smonth) {
372 } elseif ($syear && $smonth && !$sday) {
374 } elseif ($syear && $smonth && $sday) {
375 $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)).
"'";
380 $resql = $db->query($sql);
382 $theoricalamountforterminal[$terminalid][$key] = $initialbalanceforterminal[$terminalid][$key];
384 $obj = $db->fetch_object($resql);
386 $theoricalamountforterminal[$terminalid][$key] =
price2num($theoricalamountforterminal[$terminalid][$key] + $obj->total);
387 $theoricalnbofinvoiceforterminal[$terminalid][$key] = $obj->nb;
396 if ($action !=
'close') {
397 print
load_fiche_titre($langs->trans(
"CashControl").
" - ".$langs->trans(
"New"),
'',
'cash-register');
399 print
'<form method="POST" action="'.$_SERVER[
"PHP_SELF"].
'">';
400 print
'<input type="hidden" name="token" value="'.newToken().
'">';
401 if ($contextpage ==
'takepos') {
402 print
'<input type="hidden" name="contextpage" value="takepos">';
405 print
'<input type="hidden" name="action" value="add">';
406 } elseif ($action ==
'close') {
407 print
'<input type="hidden" name="action" value="valid">';
408 print
'<input type="hidden" name="id" value="'.$id.
'">';
410 print
'<input type="hidden" name="action" value="start">';
413 print
'<div class="div-table-responsive-no-min">';
414 print
'<table class="noborder centpercent">';
415 print
'<tr class="liste_titre">';
416 print
'<td>'.$langs->trans(
"Module").
'</td>';
417 print
'<td>'.$langs->trans(
"Terminal").
'</td>';
418 print
'<td>'.$langs->trans(
"Year").
'</td>';
419 print
'<td>'.$langs->trans(
"Month").
'</td>';
420 print
'<td>'.$langs->trans(
"Day").
'</td>';
427 print
'<tr class="oddeven">';
428 print
'<td>'.$form->selectarray(
'posmodule', $arrayofposavailable,
GETPOST(
'posmodule',
'alpha'), (count($arrayofposavailable) > 1 ? 1 : 0)).
'</td>';
431 $arrayofpos = array();
433 for ($i = 1; $i <= $numterminals; $i++) {
435 $arrayofpos[$i] = array(
'id' => $i,
'label' => (($nameofterminal !=
"TAKEPOS_TERMINAL_NAME_".$i) ?
'#'.$i.
' '.$nameofterminal : $i),
'data-html' => (($nameofterminal !=
"TAKEPOS_TERMINAL_NAME_".$i) ?
'#'.$i.
' - '.$nameofterminal : $i));
437 $selectedposnumber = 0;
440 $selectedposnumber = 1;
443 print $form->selectarray(
'posnumber', $arrayofpos, GETPOSTISSET(
'posnumber') ?
GETPOSTINT(
'posnumber') : $selectedposnumber, $showempty);
448 $retstring =
'<select'.($disabled ?
' disabled' :
'').
' class="flat valignmiddle maxwidth75imp" id="'.$prefix.
'year" name="'.$prefix.
'year">';
449 for ($year = $syear - 10; $year < $syear + 10; $year++) {
450 $retstring .=
'<option value="'.$year.
'"'.($year == $syear ?
' selected' :
'').
'>'.$year.
'</option>';
452 $retstring .=
"</select>\n";
457 $retstring =
'<select'.($disabled ?
' disabled' :
'').
' class="flat valignmiddle maxwidth75imp" id="'.$prefix.
'month" name="'.$prefix.
'month">';
458 $retstring .=
'<option value="0"></option>';
459 for ($month = 1; $month <= 12; $month++) {
460 $retstring .=
'<option value="'.$month.
'"'.($month == $smonth ?
' selected' :
'').
'>';
461 $retstring .=
dol_print_date(mktime(12, 0, 0, $month, 1, 2000),
"%b");
462 $retstring .=
"</option>";
464 $retstring .=
"</select>";
469 $retstring =
'<select'.($disabled ?
' disabled' :
'').
' class="flat valignmiddle maxwidth50imp" id="'.$prefix.
'day" name="'.$prefix.
'day">';
470 $retstring .=
'<option value="0" selected> </option>';
471 for ($day = 1; $day <= 31; $day++) {
472 $retstring .=
'<option value="'.$day.
'"'.($day == $sday ?
' selected' :
'').
'>'.$day.
'</option>';
474 $retstring .=
"</select>";
479 if ($action ==
'start' &&
GETPOST(
'posnumber') !=
'' &&
GETPOST(
'posnumber') !=
'' &&
GETPOST(
'posnumber') !=
'-1') {
482 print
'<input type="submit" name="add" class="button" value="'.$langs->trans(
"Start").
'">';
489 if (($action ==
'start' &&
GETPOST(
'posnumber') !=
'' &&
GETPOST(
'posnumber') !=
'' &&
GETPOST(
'posnumber') !=
'-1') || $action ==
'close') {
490 $posmodule =
GETPOST(
'posmodule',
'alpha');
491 $terminalid =
GETPOST(
'posnumber',
'alpha');
495 print
'<div class="div-table-responsive-no-min">';
496 print
'<table class="noborder centpercent">';
498 print
'<tr class="liste_titre">';
500 print
'<td class="center">'.$langs->trans(
"InitialBankBalance");
512 print
'<tr class="liste_titre">';
514 print
'<td class="center">'.$langs->trans(
"Cash");
550 print
'<td>'.$langs->trans(
"TheoricalAmount").
'</td>';
551 print
'<td class="center">';
552 print
price($initialbalanceforterminal[$terminalid][
'cash']).
'<br>';
568 print
'<td>'.$langs->trans(
"RealAmount").
'</td>';
570 print
'<td class="center">';
572 if ($action ==
'close') {
575 print
'name="opening" type="text" class="maxwidth100 center" value="';
576 if ($action ==
'close') {
580 print(GETPOSTISSET(
'opening') ?
price2num(
GETPOST(
'opening',
'alpha')) :
price($initialbalanceforterminal[$terminalid][
'cash']));
596 print
'<td class="center">';
597 print
'<input type="submit" name="cancel" class="button button-cancel" value="'.$langs->trans(
"Cancel").
'">';
598 if ($action ==
'start') {
599 print
'<input type="submit" name="add" class="button button-save" value="'.$langs->trans(
"Save").
'">';
600 } elseif ($action ==
'close') {
601 print
'<input type="submit" name="valid" class="button" value="'.$langs->trans(
"Validate").
'">';
614if (empty($action) || $action ==
"view" || $action ==
"close") {
618 print $langs->trans(
"ErrorRecordNotFound");
621 $head[0][0] = DOL_URL_ROOT.
'/compta/cashcontrol/cashcontrol_card.php?id='.
$object->id;
622 $head[0][1] = $langs->trans(
"CashControl");
623 $head[0][2] =
'cashcontrol';
625 print
dol_get_fiche_head($head,
'cashcontrol', $langs->trans(
"CashControl"), -1,
'account');
627 $linkback =
'<a href="'.DOL_URL_ROOT.
'/compta/cashcontrol/cashcontrol_list.php?restore_lastsearch_values=1">'.$langs->trans(
"BackToList").
'</a>';
629 $morehtmlref =
'<div class="refidno">';
630 $morehtmlref .=
'</div>';
633 dol_banner_tab($object,
'id', $linkback, 1,
'rowid',
'rowid', $morehtmlref);
635 print
'<div class="fichecenter">';
636 print
'<div class="fichehalfleft">';
637 print
'<div class="underbanner clearboth"></div>';
638 print
'<table class="border tableforfield" width="100%">';
640 print
'<tr><td class="titlefield nowrap">';
641 print $langs->trans(
"Ref");
646 print
'<tr><td valign="middle">'.$langs->trans(
"Module").
'</td><td>';
650 print
'<tr><td valign="middle">'.$langs->trans(
"Terminal").
'</td><td>';
654 print
'<tr><td class="nowrap">';
655 print $langs->trans(
"Period");
665 print
'<div class="fichehalfright">';
666 print
'<div class="underbanner clearboth"></div>';
668 print
'<table class="border tableforfield centpercent">';
670 print
'<tr><td class="titlefield nowrap">';
671 print $langs->trans(
"DateCreationShort");
676 print
'<tr><td valign="middle">'.$langs->trans(
"InitialBankBalance").
' - '.$langs->trans(
"Cash").
'</td><td>';
677 print
'<span class="amount">'.price(
$object->opening, 0, $langs, 1, -1, -1,
$conf->currency).
'</span>';
679 foreach ($arrayofpaymentmode as $key => $val) {
680 print
'<tr><td valign="middle">'.$langs->trans($val).
'</td><td>';
681 print
'<span class="amount">'.price(
$object->$key, 0, $langs, 1, -1, -1,
$conf->currency).
'</span>';
687 print
'</div></div>';
688 print
'<div class="clearboth"></div>';
692 if ($action !=
'close') {
693 print
'<div class="tabsAction">';
696 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>';
699 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>';
701 if (
$object->status == CashControl::STATUS_DRAFT) {
702 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>';
704 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>';
706 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>';
711 if ($contextpage !=
'takepos') {
712 print
'<center><iframe src="report.php?id='.$id.
'" width="60%" height="800"></iframe></center>';
715 print
'<form method="POST" action="'.$_SERVER[
"PHP_SELF"].
'" name="formclose">';
716 print
'<input type="hidden" name="token" value="'.newToken().
'">';
717 if ($contextpage ==
'takepos') {
718 print
'<input type="hidden" name="contextpage" value="takepos">';
721 print
'<input type="hidden" name="action" value="add">';
722 } elseif ($action ==
'close') {
723 print
'<input type="hidden" name="action" value="valid">';
724 print
'<input type="hidden" name="id" value="'.$id.
'">';
726 print
'<input type="hidden" name="action" value="start">';
781 if (($action ==
'start' &&
GETPOST(
'posnumber') !=
'' &&
GETPOST(
'posnumber') !=
'' &&
GETPOST(
'posnumber') !=
'-1') || $action ==
'close') {
782 $posmodule =
$object->posmodule;
783 $terminalid =
$object->posnumber;
787 print
'<div class="div-table-responsive-no-min">';
788 print
'<table class="noborder centpercent">';
790 print
'<tr class="liste_titre">';
792 print
'<td class="center">'.$langs->trans(
"InitialBankBalance");
796 print
'<td align="center" class="hide0" colspan="'.count($arrayofpaymentmode).
'">';
797 print $langs->trans(
"AmountAtEndOfPeriod");
802 print
'<tr class="liste_titre">';
804 print
'<td class="center">'.$langs->trans(
"Cash");
808 foreach ($arrayofpaymentmode as $key => $val) {
809 print
'<td align="center"'.($i == 0 ?
' class="hide0"' :
'').
'>'.$langs->trans($val);
819 print
'<td>'.$langs->trans(
"NbOfInvoices").
'</td>';
820 print
'<td class="center">';
824 foreach ($arrayofpaymentmode as $key => $val) {
825 print
'<td align="center"'.($i == 0 ?
' class="hide0"' :
'').
'>';
826 print $theoricalnbofinvoiceforterminal[$terminalid][$key];
831 print
'<td align="center"></td>';
836 print
'<td>'.$langs->trans(
"TheoricalAmount").
'</td>';
837 print
'<td class="center">';
838 print
price($initialbalanceforterminal[$terminalid][
'cash']).
'<br>';
842 foreach ($arrayofpaymentmode as $key => $val) {
843 print
'<td align="center"'.($i == 0 ?
' class="hide0"' :
'').
'>';
844 if ($key ==
'cash') {
845 $deltaforcash = ((float)
$object->opening - $initialbalanceforterminal[$terminalid][
'cash']);
846 print
price($theoricalamountforterminal[$terminalid][$key] + $deltaforcash).
'<br>';
848 print
price($theoricalamountforterminal[$terminalid][$key]).
'<br>';
854 print
'<td align="center"></td>';
858 print
'<td>'.$langs->trans(
"RealAmount").
'</td>';
860 print
'<td class="center">';
862 if ($action ==
'close') {
865 print
'name="opening" type="text" class="maxwidth100 center" value="';
866 if ($action ==
'close') {
870 print(GETPOSTISSET(
'opening') ?
price2num(
GETPOST(
'opening',
'alpha')) :
price($initialbalanceforterminal[$terminalid][
'cash']));
876 foreach ($arrayofpaymentmode as $key => $val) {
877 print
'<td align="center"'.($i == 0 ?
' class="hide0"' :
'').
'>';
879 if ($action ==
'start') {
882 print
'name="'.$key.
'_amount" type="text"'.($key ==
'cash' ?
' autofocus' :
'').
' class="maxwidth100 center" value="'.
GETPOST($key.
'_amount',
'alpha').
'">';
887 print
'<td class="center">';
888 print
'<input type="submit" name="cancel" class="button button-cancel" value="'.$langs->trans(
"Cancel").
'">';
889 if ($action ==
'start') {
890 print
'<input type="submit" name="add" class="button button-save" value="'.$langs->trans(
"Save").
'">';
891 } elseif ($action ==
'close') {
892 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.
global $conf
The following vars must be defined: $type2label $form $conf, $lang, The following vars may also be de...
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program.