39require
'../main.inc.php';
40require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formother.class.php';
41require_once DOL_DOCUMENT_ROOT.
'/core/lib/multicurrency.lib.php';
52$langs->loadLangs(array(
'admin',
'multicurrency'));
55$action =
GETPOST(
'action',
'alpha');
56$massaction =
GETPOST(
'massaction',
'alpha');
58$confirm =
GETPOST(
'confirm',
'alpha');
59$toselect =
GETPOST(
'toselect',
'array:int');
60$contextpage =
GETPOST(
'contextpage',
'aZ') ?
GETPOST(
'contextpage',
'aZ') : str_replace(
'_',
'', basename(dirname(__FILE__)).basename(__FILE__,
'.php'));
61$optioncss =
GETPOST(
'optioncss',
'alpha');
66$sortfield =
GETPOST(
'sortfield',
'aZ09comma');
67$sortorder =
GETPOST(
'sortorder',
'aZ09comma');
69if (empty($page) || $page < 0 ||
GETPOST(
'button_search',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')) {
73$offset = $limit * $page;
78 $sortfield =
"cr.date_sync";
85$search_all = trim(
GETPOST(
'search_all',
'alphanohtml'));
88$search_rate =
GETPOST(
'search_rate',
'alpha');
89$search_rate_indirect =
GETPOST(
'search_rate_indirect',
'alpha');
90$search_code =
GETPOST(
'search_code',
'alpha');
91$multicurrency_code =
GETPOST(
'multicurrency_code',
'alpha');
94$rateindirectinput = (float)
price2num(
GETPOST(
'rateinidirectinput',
'alpha'));
101$form =
new Form($db);
103$hookmanager->initHooks(array(
'EditorRatelist',
'globallist'));
110$fieldstosearchall = array(
111 'cr.date_sync' =>
"date_sync",
113 'cr.rate_indirect' =>
"rate_indirect",
119 'cr.date_sync' => array(
'label' =>
'Date',
'checked' =>
'1'),
120 'cr.rate' => array(
'label' =>
'Rate',
'checked' =>
'1'),
121 'cr.rate_indirect' => array(
'label' =>
'RateIndirect',
'checked' =>
'0',
'enabled' => (!
getDolGlobalString(
'MULTICURRENCY_USE_RATE_INDIRECT') ?
'0' :
'1')),
122 'm.code' => array(
'label' =>
'Code',
'checked' =>
'1'),
143if ($action ==
"create" && $user->hasRight(
'multicurrency',
'currency',
'read')) {
144 if (empty($multicurrency_code) || $multicurrency_code ==
'-1') {
145 setEventMessages($langs->trans(
'ErrorFieldRequired', $langs->transnoentitiesnoconv(
"Currency")),
null,
"errors");
148 if ($rateinput == 0) {
151 } elseif (empty($rateinput)) {
152 setEventMessages($langs->trans(
'ErrorFieldRequired', $langs->transnoentitiesnoconv(
"Rate")),
null,
"errors");
159 $fk_currency = $currency_static->getIdFromCode($db, $multicurrency_code);
161 $currencyRate_static->fk_multicurrency = $fk_currency;
162 $currencyRate_static->entity = $conf->entity;
163 $currencyRate_static->date_sync = $dateinput;
164 $currencyRate_static->rate = $rateinput;
165 $currencyRate_static->rate_indirect = $rateindirectinput;
167 $result = $currencyRate_static->create($user, intval($fk_currency));
169 setEventMessages($langs->trans(
'successRateCreate', $multicurrency_code),
null);
171 dol_syslog(
"currencyRate:createRate", LOG_WARNING);
172 setEventMessages($currencyRate_static->error, $currencyRate_static->errors,
'errors');
177if ($action ==
'update' && $user->hasRight(
'multicurrency',
'currency',
'read')) {
179 $result = $currencyRate->fetch($id_rate_selected);
182 $fk_currency = $currency_static->getIdFromCode($db, $multicurrency_code);
183 $currencyRate->date_sync = $dateinput;
184 $currencyRate->fk_multicurrency = $fk_currency;
185 $currencyRate->rate = $rateinput;
186 $res = $currencyRate->update($user);
197if ($action ==
"deleteRate" && $user->hasRight(
'multicurrency',
'currency',
'read')) {
199 $current_rate->fetch((
int) $id_rate_selected);
203 $current_currency->fetch($current_rate->fk_multicurrency);
204 if ($current_currency) {
205 $delayedhtmlcontent = $form->formconfirm(
206 $_SERVER[
"PHP_SELF"].
'?id_rate='.$id_rate_selected,
207 $langs->trans(
'DeleteLineRate'),
208 $langs->trans(
'ConfirmDeleteLineRate', $current_rate->rate, $current_currency->name, $current_rate->date_sync),
215 dol_syslog(
"Multicurrency::fetch", LOG_WARNING);
222if ($action ==
"confirm_delete" && $user->hasRight(
'multicurrency',
'currency',
'read')) {
224 $current_rate->fetch((
int) $id_rate_selected);
226 $result = $current_rate->delete($user);
233 setEventMessages($langs->trans(
'NoCurrencyRateSelected'),
null,
"warnings");
234 dol_syslog($langs->trans(
'NoCurrencyRateSelected'), LOG_WARNING);
239if (
GETPOST(
'cancel',
'alpha')) {
243if (!
GETPOST(
'confirmmassaction',
'alpha') && $massaction !=
'presend' && $massaction !=
'confirm_presend') {
247$parameters = array();
248$reshook = $hookmanager->executeHooks(
'doActions', $parameters, $object, $action);
252if (empty($reshook)) {
254 include DOL_DOCUMENT_ROOT.
'/core/actions_changeselectedfields.inc.php';
257 if (
GETPOST(
'button_removefilter_x',
'alpha') ||
GETPOST(
'button_removefilter.x',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')) {
259 $search_date_sync =
"";
260 $search_date_sync_end =
"";
263 $search_array_options = array();
267 $objectclass =
"CurrencyRate";
268 $uploaddir = $conf->multicurrency->multidir_output;
269 $permissiontoread = $user->admin;
270 $permissiontodelete = $user->admin;
271 include DOL_DOCUMENT_ROOT.
'/core/actions_massactions.inc.php';
279$form =
new Form($db);
281$title = $langs->trans(
"CurrencyRate");
282$page_name =
"MultiCurrencySetup";
287$linkback =
'<a href="'.dolBuildUrl(DOL_URL_ROOT.
'/admin/modules.php', [
'restore_lastsearch_values' => 1]).
'">'.
img_picto($langs->trans(
"BackToModuleList"),
'back',
'class="pictofixedwidth"').
'<span class="hideonsmartphone">'.$langs->trans(
"BackToModuleList").
'</span></a>';
292print
dol_get_fiche_head($head,
'ratelist', $langs->trans(
"ModuleSetup"), -1,
"multicurrency");
296if (!in_array($action, array(
"updateRate",
"deleteRate"))) {
297 print
'<form action="'.$_SERVER[
"PHP_SELF"].
'" method="post" name="formulaire">';
298 print
'<input type="hidden" name="token" value="'.newToken().
'">';
300 print
'<div class="div-table-responsive-no-min">';
301 print
'<table class="noborder centpercent"><tr>';
303 print
' <td>'.$langs->trans(
'Date').
'</td>';
305 print $form->selectDate($dateinput,
'dateinput', 0, 0, 1,
'', 1, 1);
308 print
'<td> '.$langs->trans(
'Currency').
'</td>';
309 print
'<td>'.$form->selectMultiCurrency((GETPOSTISSET(
'multicurrency_code') ?
GETPOST(
'multicurrency_code',
'alpha') : $multicurrency_code),
'multicurrency_code', 1,
" code != '".$db->escape(
getDolCurrency()).
"'", true).
'</td>';
311 print
' <td>'.$langs->trans(
'Rate').
' / '.$langs->getCurrencySymbol(
getDolCurrency()).
'</td>';
312 print
' <td><input type="text" min="0" step="any" class="maxwidth75" id="rateinput" name="rateinput" value="'.dol_escape_htmltag((
string) $rateinput).
'"></td>';
315 print
' <td>'.$langs->trans(
'RateIndirect').
' / '.$langs->getCurrencySymbol(
getDolCurrency()).
'</td>';
316 print
' <td><input type="text" min="0" step="any" class="maxwidth75" id="rateindirectinput" name="rateindirectinput" value="'.dol_escape_htmltag((
string) $rateindirectinput).
'"></td>';
318 print
'<script type="text/javascript">';
319 print
'jQuery(document).ready(function () {
321 jQuery("#rateindirectinput").keyup(function () {
322 var valindirect = jQuery(this).val();
323 valdirect = 1 / parseFloat(valindirect);
324 jQuery("#rateinput").val(valdirect);
325 console.log("Rate Direct:"+valdirect)
332 print
'<input type="hidden" name="action" value="create">';
333 print
'<input type="submit" class="button button-add small" name="btnCreateCurrencyRate" value="'.$langs->trans(
'CreateRate').
'">';
336 print
'</tr></table>';
347$sql =
'SELECT cr.rowid, cr.date_sync, cr.rate, cr.rate_indirect, cr.entity, m.code, m.name';
349$parameters = array();
350$reshook = $hookmanager->executeHooks(
'printFieldListSelect', $parameters);
351$sql .= $hookmanager->resPrint;
352$sql .=
' FROM '.MAIN_DB_PREFIX.
'multicurrency_rate as cr ';
353$sql .=
" INNER JOIN ".MAIN_DB_PREFIX.
"multicurrency AS m ON cr.fk_multicurrency = m.rowid";
355 $sql .=
natural_search(array_keys($fieldstosearchall), $search_all);
357if ($search_date_sync && $search_date_sync_end) {
358 $sql .=
" AND (cr.date_sync BETWEEN '".$db->idate($search_date_sync).
"' AND '".$db->idate($search_date_sync_end).
"')";
359} elseif ($search_date_sync && !$search_date_sync_end) {
360 $sql .=
natural_search(
'cr.date_sync', $db->idate($search_date_sync));
368$sql .=
" WHERE cr.entity IN (".getEntity(
'multicurrency').
")";
372$parameters = array();
373$reshook = $hookmanager->executeHooks(
'printFieldListWhere', $parameters);
374$sql .= $hookmanager->resPrint;
375$sql .=
" GROUP BY cr.rowid, cr.date_sync, cr.rate, cr.rate_indirect, m.code, cr.entity, m.code, m.name";
378$parameters = array();
379$reshook = $hookmanager->executeHooks(
'printFieldSelect', $parameters);
380$sql .= $hookmanager->resPrint;
382$sql .= $db->order($sortfield, $sortorder);
385$nbtotalofrecords =
'';
387 $result = $db->query($sql);
390 $nbtotalofrecords = $db->num_rows($result);
391 if (($page * $limit) > (
int) $nbtotalofrecords) {
396 setEventMessage($langs->trans(
'No_record_on_multicurrency_rate'),
'warnings');
400$sql .= $db->plimit($limit + 1, $offset);
402$resql = $db->query($sql);
404 $num = $db->num_rows($resql);
405 $arrayofselected = is_array($toselect) ? $toselect : array();
408 if (!empty($contextpage) && $contextpage != $_SERVER[
"PHP_SELF"]) {
409 $param .=
'&contextpage='.urlencode($contextpage);
411 if ($limit > 0 && $limit != $conf->liste_limit) {
412 $param .=
'&limit='.((int) $limit);
415 $param .=
"&search_all=".urlencode($search_all);
418 if ($search_date_sync) {
419 $param =
"&search_date_sync=".$search_date_sync;
421 if ($search_date_sync_end) {
422 $param =
"&search_date_sync_end=".$search_date_sync_end;
425 $param =
"&search_rate=".urlencode($search_rate);
427 if ($search_code !=
'') {
428 $param .=
"&search_code=".urlencode($search_code);
432 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_param.tpl.php';
435 $arrayofmassactions[
'predelete'] = $langs->trans(
"Delete");
437 if (in_array($massaction, array(
'presend',
'predelete'))) {
438 $arrayofmassactions = array();
440 $massactionbutton = $form->selectMassAction(
'', $arrayofmassactions);
442 print
'<form method="POST" id="searchFormList" action="'.$_SERVER[
"PHP_SELF"].
'" name="formulaire">'.
"\n";
443 if ($optioncss !=
'') {
444 print
'<input type="hidden" name="optioncss" value="'.$optioncss.
'">';
446 print
'<input type="hidden" name="token" value="'.newToken().
'">';
447 print
'<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
448 print
'<input type="hidden" name="action" value="list">';
449 print
'<input type="hidden" name="sortfield" value="'.$sortfield.
'">';
450 print
'<input type="hidden" name="sortorder" value="'.$sortorder.
'">';
451 print
'<input type="hidden" name="page" value="'.$page.
'">';
452 print
'<input type="hidden" name="contextpage" value="'.$contextpage.
'">';
453 print
'<input type="hidden" name="page_y" value="">';
454 print
'<input type="hidden" name="type" value="'.$type.
'">';
456 print_barre_liste($texte, $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords,
'title_currency.png', 0, $newcardbutton,
'', $limit);
458 include DOL_DOCUMENT_ROOT.
'/core/tpl/massactions_pre.tpl.php';
462 foreach ($fieldstosearchall as $key => $val) {
463 $fieldstosearchall[$key] = $langs->trans($val);
464 $setupstring .= $key.
"=".$val.
";";
466 print
'<div class="divsearchfieldfilter">'.$langs->trans(
"FilterOnInto", $search_all).implode(
', ', $fieldstosearchall).
'</div>'.
"\n";
471 $parameters = array();
472 $reshook = $hookmanager->executeHooks(
'printFieldPreListTitle', $parameters, $object, $action);
473 if (empty($reshook)) {
474 $moreforfilter .= $hookmanager->resPrint;
476 $moreforfilter = $hookmanager->resPrint;
479 'arrayfields' => &$arrayfields,
482 if (!empty($moreforfilter)) {
483 print
'<div class="liste_titre liste_titre_bydiv centpercent">';
484 print $moreforfilter;
488 $varpage = empty($contextpage) ? $_SERVER[
"PHP_SELF"] : $contextpage;
489 $htmlofselectarray = $form->multiSelectArrayWithCheckbox(
'selectedfields', $arrayfields, $varpage, $conf->main_checkbox_left_column);
490 $selectedfields = (($mode !=
'kanban' && $mode !=
'kanbangroupby') ? $htmlofselectarray :
'');
491 $selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons(
'checkforselect', 1) :
'');
493 print
'<div class="div-table-responsive">';
494 print
'<table class="tagtable nobottomiftotal noborder liste'.($moreforfilter ?
" listwithfilterbefore" :
"").
'">'.
"\n";
498 print
'<tr class="liste_titre_filter">';
501 if ($conf->main_checkbox_left_column) {
502 print
'<td class="liste_titre center maxwidthsearch">';
503 $searchpicto = $form->showFilterButtons(
'left');
508 if (!empty($arrayfields[
'cr.date_sync'][
'checked'])) {
509 print
'<td class="liste_titre" align="left">';
510 print $form->selectDate(
dol_print_date($search_date_sync,
"%Y-%m-%d"),
'search_date_sync', 0, 0, 1);
511 print $form->selectDate(
dol_print_date($search_date_sync_end,
"%Y-%m-%d"),
'search_date_sync_end', 0, 0, 1);
515 if (!empty($arrayfields[
'm.code'][
'checked'])) {
516 print
'<td class="liste_titre" align="left">';
517 print $form->selectMultiCurrency($multicurrency_code,
'search_code', 1,
" code != '".
getDolCurrency().
"'",
true);
521 if (!empty($arrayfields[
'cr.rate'][
'checked'])) {
522 print
'<td class="liste_titre" align="left">';
523 print
'<input class="flat maxwidth75" type="text" name="search_rate" value="'.dol_escape_htmltag($search_rate).
'">';
528 $parameters = array(
'arrayfields' => $arrayfields);
529 $reshook = $hookmanager->executeHooks(
'printFieldListOption', $parameters);
530 print $hookmanager->resPrint;
533 if (!$conf->main_checkbox_left_column) {
534 print
'<td class="liste_titre center">';
535 $searchpicto = $form->showFilterButtons();
541 print
'<tr class="liste_titre">';
543 if ($conf->main_checkbox_left_column) {
544 print_liste_field_titre($selectedfields, $_SERVER[
"PHP_SELF"],
"",
'',
'',
'', $sortfield, $sortorder,
'maxwidthsearch center ');
546 if (!empty($arrayfields[
'cr.date_sync'][
'checked'])) {
548 print_liste_field_titre($arrayfields[
'cr.date_sync'][
'label'], $_SERVER[
"PHP_SELF"],
"cr.date_sync",
"", $param,
"", $sortfield, $sortorder);
550 if (!empty($arrayfields[
'm.code'][
'checked'])) {
551 print_liste_field_titre($arrayfields[
'm.code'][
'label'], $_SERVER[
"PHP_SELF"],
"m.code",
"", $param,
"", $sortfield, $sortorder);
553 if (!empty($arrayfields[
'cr.rate'][
'checked'])) {
554 print_liste_field_titre($arrayfields[
'cr.rate'][
'label'], $_SERVER[
"PHP_SELF"],
"cr.rate",
"", $param,
"", $sortfield, $sortorder);
558 $parameters = array(
'arrayfields' => $arrayfields,
'param' => $param,
'sortfield' => $sortfield,
'sortorder' => $sortorder);
559 $reshook = $hookmanager->executeHooks(
'printFieldListTitle', $parameters);
560 print $hookmanager->resPrint;
562 if (!$conf->main_checkbox_left_column) {
563 print_liste_field_titre($selectedfields, $_SERVER[
"PHP_SELF"],
"",
'',
'',
'align="center"', $sortfield, $sortorder,
'maxwidthsearch center ');
570 while ($i < min($num, $limit)) {
571 $obj = $db->fetch_object($resql);
573 print
'<tr class="oddeven">';
576 if ($action ==
"updateRate" && $obj->rowid == $id_rate_selected) {
577 if ($conf->main_checkbox_left_column) {
578 print
'<td class="center">';
581 print
'<td><input class="minwidth200" name="dateinput" value="'.
date(
'Y-m-d',
dol_stringtotime($obj->date_sync)) .
'" type="date"></td>';
582 print
'<td>' . $form->selectMultiCurrency($obj->code,
'multicurrency_code', 1,
" code != '".getDolCurrency().
"'",
true) .
'</td>';
583 print
'<td><input type="text" min="0" step="any" class="maxwidth100" name="rateinput" value="' .
dol_escape_htmltag($obj->rate) .
'">';
584 print
'<input type="hidden" name="page" value="'.dol_escape_htmltag((
string) $page).
'">';
585 print
'<input type="hidden" name="id_rate" value="'.dol_escape_htmltag($obj->rowid).
'">';
586 print
'<button type="submit" class="button small reposition" name="action" value="update">'.$langs->trans(
"Modify").
'</button>';
587 print
'<button type="submit" class="button small reposition" name="action" value="cancel">'.$langs->trans(
"Cancel").
'</button>';
589 if (!$conf->main_checkbox_left_column) {
590 print
'<td class="center">';
595 if ($conf->main_checkbox_left_column) {
596 print
'<td class="nowrap center">';
597 if ($massactionbutton || $massaction) {
599 if (in_array($obj->rowid, $arrayofselected)) {
602 print
'<a class="editfielda marginleftonly marginrightonly reposition" href="'.$_SERVER[
"PHP_SELF"].
'?action=updateRate&token='.
newToken().
'&id_rate='.$obj->rowid.
'">'.
img_picto(
'edit',
'edit').
'</a>';
603 print
'<a class="marginleftonly marginrightonly reposition" href="'.$_SERVER[
"PHP_SELF"].
'?action=deleteRate&token='.
newToken().
'&id_rate='.$obj->rowid.
'">'.
img_picto(
'delete',
'delete').
'</a>';
604 print
'<input id="cb'.$obj->rowid.
'" class="flat checkforselect marginleftonly" type="checkbox" name="toselect[]" value="'.$obj->rowid.
'"'.($selected ?
' checked="checked"' :
'').
'>';
613 if (!empty($arrayfields[
'cr.date_sync'][
'checked'])) {
614 print
'<td class="tdoverflowmax200">';
615 print $obj->date_sync;
623 if (!empty($arrayfields[
'm.code'][
'checked'])) {
624 print
'<td class="tdoverflowmax200">';
626 print
' - <span class="opacitymedium">'.$obj->name.
'</span>';
635 if (!empty($arrayfields[
'cr.rate'][
'checked'])) {
636 print
'<td class="tdoverflowmax200">';
645 if (!empty($arrayfields[
'cr.rate_indirect'][
'checked'])) {
646 print
'<td class="tdoverflowmax200">';
647 print $obj->rate_indirect;
656 $parameters = array(
'arrayfields' => $arrayfields,
'obj' => $obj);
657 $reshook = $hookmanager->executeHooks(
'printFieldListValue', $parameters);
658 print $hookmanager->resPrint;
661 if (!$conf->main_checkbox_left_column) {
662 print
'<td class="nowrap center">';
663 if ($massactionbutton || $massaction) {
665 if (in_array($obj->rowid, $arrayofselected)) {
668 print
'<a class="editfielda marginleftonly marginrightonly" href="'.$_SERVER[
"PHP_SELF"].
'?action=updateRate&token='.
newToken().
'&id_rate='.$obj->rowid.
'">'.
img_picto(
'edit',
'edit').
'</a>';
669 print
'<a class="marginleftonly marginrightonly" href="'.$_SERVER[
"PHP_SELF"].
'?action=deleteRate&token='.
newToken().
'&id_rate='.$obj->rowid.
'">'.
img_picto(
'delete',
'delete').
'</a>';
670 print
'<input id="cb'.$obj->rowid.
'" class="flat checkforselect marginleftonly" type="checkbox" name="toselect[]" value="'.$obj->rowid.
'"'.($selected ?
' checked="checked"' :
'').
'>';
if(! $sortfield) if(! $sortorder) $object
llxFooter($comment='', $zone='private', $disabledoutputofmessages=0)
Empty footer.
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.
dol_stringtotime($string, $gm=1)
Convert a string date into a GM Timestamps date Warning: YYYY-MM-DDTHH:MM:SS+02:00 (RFC3339) is not s...
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...
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='', $noduplicate=0, $attop=0)
Set event messages in dol_events session object.
print_liste_field_titre($name, $file="", $field="", $begin="", $param="", $moreattrib="", $sortfield="", $sortorder="", $prefix="", $tooltip="", $forcenowrapcolumntitle=0)
Show title line of an array.
print_barre_liste($title, $page, $file, $options='', $sortfield='', $sortorder='', $morehtmlcenter='', $num=-1, $totalnboflines='', $picto='generic', $pictoisfullpath=0, $morehtmlright='', $morecss='', $limit=-1, $selectlimitsuffix=0, $hidenavigation=0, $pagenavastextinput=0, $morehtmlrightbeforearrow='')
Print a title with navigation controls for pagination.
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=0, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2, $allowothertags=array())
Show picto whatever it's its name (generic function)
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, $morecssdiv='')
Show tabs of a record.
price2num($amount, $rounding='', $option=0)
Function that return a number with universal decimal format (decimal separator is '.
setEventMessage($mesgs, $style='mesgs', $noduplicate=0, $attop=0)
Set event message in dol_events session object.
natural_search($fields, $value, $mode=0, $nofirstand=0, $sqltoadd='')
Generate natural SQL search string for a criteria (this criteria can be tested on one or several fiel...
getDolGlobalInt($key, $default=0)
Return a Dolibarr global constant int value.
dol_sort_array(&$array, $index, $order='asc', $natsort=0, $case_sensitive=0, $keepindex=0)
Advanced sort array by the value of a given key, which produces ascending (default) or descending out...
newToken()
Return the value of token currently saved into session with name 'newtoken'.
getDolCurrency()
Return the main currency ('EUR', 'USD', ...)
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
dol_print_date($time, $format='', $tzoutput='auto', $outputlangs=null, $encodetooutput=false, $decorate=0)
Output date in a string format according to outputlangs (or langs if not defined).
dol_print_error($db=null, $error='', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
load_fiche_titre($title, $morehtmlright='', $picto='generic', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='', $morecssonpicto='widthpictotitle')
Load a title with picto.
getDolGlobalString($key, $default='')
Return a Dolibarr global constant string value.
isModEnabled($module)
Is Dolibarr module enabled.
dol_syslog($message, $level=LOG_INFO, $ident=0, $suffixinfilename='', $restricttologhandler='', $logcontext=null)
Write log message into outputs.
dol_escape_htmltag($stringtoescape, $keepb=0, $keepn=0, $noescapetags='', $escapeonlyhtmltags=0, $cleanalsojavascript=0)
Returns text escaped for inclusion in HTML alt or title or value tags, or into values of HTML input f...
multicurrencyAdminPrepareHead()
Prepare array with list of tabs.
if(getDolGlobalString( 'TAKEPOS_SHOW_CUSTOMER')) print $langs trans('Date')." left Label right Qty right Price right TotalHT right TotalTTC right right right right right right right right right centpercent right TotalHT right n right VAT right n right TotalVAT right n No sujeto a RE IRPF right TotalLT1 right n right TotalLT2 right n right TotalTTC right n takeposcustomercurrency takeposcustomercurrency takeposcustomercurrency takeposcustomercurrency right TotalTTC takeposcustomercurrency right takeposcustomercurrency n right PaymentTypeShortLIQ right SELECT p pos_change as p datep as date
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program.