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_direct =
GETPOST(
'search_rate_direct',
'alpha');
90$search_code =
GETPOST(
'search_code',
'alpha');
91$multicurrency_code =
GETPOST(
'multicurrency_code',
'alpha');
103$hookmanager->initHooks(array(
'EditorRatelist',
'globallist'));
110$fieldstosearchall = array(
111 'cr.date_sync' =>
"date_sync",
113 'cr.rate_direct' =>
"rate_direct",
119 'cr.date_sync' => array(
'label' =>
'Date',
'checked' =>
'1'),
120 'cr.rate' => array(
'label' =>
'Rate',
'checked' =>
'1'),
121 'cr.rate_direct' => array(
'label' =>
'RateDirect',
'checked' =>
'0',
'enabled' => (!
getDolGlobalString(
'MULTICURRENCY_USE_RATE_DIRECT') ?
'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_direct = $ratedirectinput;
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 $currencyRate->rate_direct = $ratedirectinput;
187 $res = $currencyRate->update($user);
198if ($action ==
"deleteRate" && $user->hasRight(
'multicurrency',
'currency',
'read')) {
200 $current_rate->fetch((
int) $id_rate_selected);
204 $current_currency->fetch($current_rate->fk_multicurrency);
205 if ($current_currency) {
206 $delayedhtmlcontent = $form->formconfirm(
207 $_SERVER[
"PHP_SELF"].
'?id_rate='.$id_rate_selected,
208 $langs->trans(
'DeleteLineRate'),
209 $langs->trans(
'ConfirmDeleteLineRate', $current_rate->rate, $current_currency->name, $current_rate->date_sync),
216 dol_syslog(
"Multicurrency::fetch", LOG_WARNING);
223if ($action ==
"confirm_delete" && $user->hasRight(
'multicurrency',
'currency',
'read')) {
225 $current_rate->fetch((
int) $id_rate_selected);
227 $result = $current_rate->delete($user);
234 setEventMessages($langs->trans(
'NoCurrencyRateSelected'),
null,
"warnings");
235 dol_syslog($langs->trans(
'NoCurrencyRateSelected'), LOG_WARNING);
240if (
GETPOST(
'cancel',
'alpha')) {
244if (!
GETPOST(
'confirmmassaction',
'alpha') && $massaction !=
'presend' && $massaction !=
'confirm_presend') {
248$parameters = array();
249$reshook = $hookmanager->executeHooks(
'doActions', $parameters, $object, $action);
253if (empty($reshook)) {
255 include DOL_DOCUMENT_ROOT.
'/core/actions_changeselectedfields.inc.php';
258 if (
GETPOST(
'button_removefilter_x',
'alpha') ||
GETPOST(
'button_removefilter.x',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')) {
260 $search_date_sync =
"";
261 $search_date_sync_end =
"";
264 $search_array_options = array();
268 $objectclass =
"CurrencyRate";
269 $uploaddir =
$conf->multicurrency->multidir_output;
270 $permissiontoread = $user->admin;
271 $permissiontodelete = $user->admin;
272 include DOL_DOCUMENT_ROOT.
'/core/actions_massactions.inc.php';
282$title = $langs->trans(
"CurrencyRate");
283$page_name =
"MultiCurrencySetup";
288$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>';
293print
dol_get_fiche_head($head,
'ratelist', $langs->trans(
"ModuleSetup"), -1,
"multicurrency");
297if (!in_array($action, array(
"updateRate",
"deleteRate"))) {
298 print
'<form action="'.$_SERVER[
"PHP_SELF"].
'" method="post" name="formulaire">';
299 print
'<input type="hidden" name="token" value="'.newToken().
'">';
301 print
'<div class="div-table-responsive-no-min">';
302 print
'<table class="noborder centpercent"><tr>';
304 print
' <td>'.$langs->trans(
'Date').
'</td>';
306 print $form->selectDate($dateinput,
'dateinput', 0, 0, 1,
'', 1, 1);
309 print
'<td> '.$langs->trans(
'Currency').
'</td>';
310 print
'<td>'.$form->selectMultiCurrency((GETPOSTISSET(
'multicurrency_code') ?
GETPOST(
'multicurrency_code',
'alpha') : $multicurrency_code),
'multicurrency_code', 1,
"(code:<>:'".
$db->escape(
getDolCurrency()).
"')", true).
'</td>';
312 print
' <td>'.$langs->trans(
'Rate').
' / '.$langs->getCurrencySymbol(
getDolCurrency()).
'</td>';
313 print
' <td><input type="text" min="0" step="any" class="maxwidth75" id="rateinput" name="rateinput" value="'.dol_escape_htmltag((
string) $rateinput).
'"></td>';
322 print
' <td>'.$langs->trans(
'RateDirect').
' / '.$langs->getCurrencySymbol(
getDolCurrency()).
'</td>';
323 print
' <td><input type="text" min="0" step="any" class="maxwidth75" id="ratedirectinput" name="ratedirectinput" value="'.dol_escape_htmltag((
string) $ratedirectinput).
'"></td>';
325 print
'<script type="text/javascript">';
326 print
'jQuery(document).ready(function () {
328 jQuery("#ratedirectinput").keyup(function () {
329 var valdirect = jQuery(this).val();
330 valindirect = 1 / parseFloat(valdirect);
331 jQuery("#rateinput").val(valindirect);
332 console.log("Rate Indirect:"+valindirect)
356 print
'<input type="hidden" name="action" value="create">';
357 print
'<input type="submit" class="button button-add small" name="btnCreateCurrencyRate" value="'.$langs->trans(
'CreateRate').
'">';
360 print
'</tr></table>';
371$sql =
'SELECT cr.rowid, cr.date_sync, cr.rate, cr.rate_direct, cr.entity, m.code, m.name';
373$parameters = array();
374$reshook = $hookmanager->executeHooks(
'printFieldListSelect', $parameters);
375$sql .= $hookmanager->resPrint;
376$sql .=
' FROM '.MAIN_DB_PREFIX.
'multicurrency_rate as cr ';
377$sql .=
" INNER JOIN ".MAIN_DB_PREFIX.
"multicurrency AS m ON cr.fk_multicurrency = m.rowid";
379 $sql .=
natural_search(array_keys($fieldstosearchall), $search_all);
381if ($search_date_sync && $search_date_sync_end) {
382 $sql .=
" AND (cr.date_sync BETWEEN '".$db->idate($search_date_sync).
"' AND '".
$db->idate($search_date_sync_end).
"')";
383} elseif ($search_date_sync && !$search_date_sync_end) {
392$sql .=
" WHERE cr.entity IN (".getEntity(
'multicurrency').
")";
396$parameters = array();
397$reshook = $hookmanager->executeHooks(
'printFieldListWhere', $parameters);
398$sql .= $hookmanager->resPrint;
399$sql .=
" GROUP BY cr.rowid, cr.date_sync, cr.rate, cr.rate_direct, m.code, cr.entity, m.code, m.name";
402$parameters = array();
403$reshook = $hookmanager->executeHooks(
'printFieldSelect', $parameters);
404$sql .= $hookmanager->resPrint;
406$sql .=
$db->order($sortfield, $sortorder);
409$nbtotalofrecords =
'';
411 $result =
$db->query($sql);
414 $nbtotalofrecords =
$db->num_rows($result);
415 if (($page * $limit) > (
int) $nbtotalofrecords) {
420 setEventMessage($langs->trans(
'No_record_on_multicurrency_rate'),
'warnings');
424$sql .=
$db->plimit($limit + 1, $offset);
426$resql =
$db->query($sql);
428 $num =
$db->num_rows($resql);
429 $arrayofselected = is_array($toselect) ? $toselect : array();
432 if (!empty($contextpage) && $contextpage != $_SERVER[
"PHP_SELF"]) {
433 $param .=
'&contextpage='.urlencode($contextpage);
435 if ($limit > 0 && $limit !=
$conf->liste_limit) {
436 $param .=
'&limit='.((int) $limit);
439 $param .=
"&search_all=".urlencode($search_all);
442 if ($search_date_sync) {
443 $param =
"&search_date_sync=".$search_date_sync;
445 if ($search_date_sync_end) {
446 $param =
"&search_date_sync_end=".$search_date_sync_end;
449 $param =
"&search_rate=".urlencode($search_rate);
451 if ($search_code !=
'') {
452 $param .=
"&search_code=".urlencode($search_code);
456 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_param.tpl.php';
459 $arrayofmassactions[
'predelete'] = $langs->trans(
"Delete");
461 if (in_array($massaction, array(
'presend',
'predelete'))) {
462 $arrayofmassactions = array();
464 $massactionbutton = $form->selectMassAction(
'', $arrayofmassactions);
466 print
'<form method="POST" id="searchFormList" action="'.$_SERVER[
"PHP_SELF"].
'" name="formulaire">'.
"\n";
467 if ($optioncss !=
'') {
468 print
'<input type="hidden" name="optioncss" value="'.$optioncss.
'">';
470 print
'<input type="hidden" name="token" value="'.newToken().
'">';
471 print
'<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
472 print
'<input type="hidden" name="action" value="list">';
473 print
'<input type="hidden" name="sortfield" value="'.$sortfield.
'">';
474 print
'<input type="hidden" name="sortorder" value="'.$sortorder.
'">';
475 print
'<input type="hidden" name="page" value="'.$page.
'">';
476 print
'<input type="hidden" name="contextpage" value="'.$contextpage.
'">';
477 print
'<input type="hidden" name="page_y" value="">';
478 print
'<input type="hidden" name="type" value="'.$type.
'">';
480 print_barre_liste($texte, $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords,
'title_currency.png', 0, $newcardbutton,
'', $limit);
482 include DOL_DOCUMENT_ROOT.
'/core/tpl/massactions_pre.tpl.php';
486 foreach ($fieldstosearchall as $key => $val) {
487 $fieldstosearchall[$key] = $langs->trans($val);
488 $setupstring .= $key.
"=".$val.
";";
490 print
'<div class="divsearchfieldfilter">'.$langs->trans(
"FilterOnInto", $search_all).implode(
', ', $fieldstosearchall).
'</div>'.
"\n";
495 $parameters = array();
496 $reshook = $hookmanager->executeHooks(
'printFieldPreListTitle', $parameters, $object, $action);
497 if (empty($reshook)) {
498 $moreforfilter .= $hookmanager->resPrint;
500 $moreforfilter = $hookmanager->resPrint;
503 'arrayfields' => &$arrayfields,
506 if (!empty($moreforfilter)) {
507 print
'<div class="liste_titre liste_titre_bydiv centpercent">';
508 print $moreforfilter;
512 $varpage = empty($contextpage) ? $_SERVER[
"PHP_SELF"] : $contextpage;
513 $htmlofselectarray = $form->multiSelectArrayWithCheckbox(
'selectedfields', $arrayfields, $varpage,
$conf->main_checkbox_left_column);
514 $selectedfields = (($mode !=
'kanban' && $mode !=
'kanbangroupby') ? $htmlofselectarray :
'');
515 $selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons(
'checkforselect', 1) :
'');
517 print
'<div class="div-table-responsive">';
518 print
'<table class="tagtable nobottomiftotal noborder liste'.($moreforfilter ?
" listwithfilterbefore" :
"").
'">'.
"\n";
522 print
'<tr class="liste_titre_filter">';
525 if (
$conf->main_checkbox_left_column) {
526 print
'<td class="liste_titre center maxwidthsearch">';
527 $searchpicto = $form->showFilterButtons(
'left');
532 if (!empty($arrayfields[
'cr.date_sync'][
'checked'])) {
533 print
'<td class="liste_titre" align="left">';
534 print $form->selectDate(
dol_print_date($search_date_sync,
"%Y-%m-%d"),
'search_date_sync', 0, 0, 1);
535 print $form->selectDate(
dol_print_date($search_date_sync_end,
"%Y-%m-%d"),
'search_date_sync_end', 0, 0, 1);
539 if (!empty($arrayfields[
'm.code'][
'checked'])) {
540 print
'<td class="liste_titre" align="left">';
541 print $form->selectMultiCurrency($multicurrency_code,
'search_code', 1,
"(code:<>:'".
getDolCurrency().
"')",
true);
545 if (!empty($arrayfields[
'cr.rate'][
'checked'])) {
546 print
'<td class="liste_titre" align="left">';
547 print
'<input class="flat maxwidth75" type="text" name="search_rate" value="'.dol_escape_htmltag($search_rate).
'">';
551 if (!empty($arrayfields[
'cr.rate_direct'][
'checked'])) {
552 print
'<td class="liste_titre" align="left">';
553 print
'<input class="flat maxwidth75" type="text" name="search_rate_direct" value="'.dol_escape_htmltag($search_rate_direct).
'">';
558 $parameters = array(
'arrayfields' => $arrayfields);
559 $reshook = $hookmanager->executeHooks(
'printFieldListOption', $parameters);
560 print $hookmanager->resPrint;
563 if (!
$conf->main_checkbox_left_column) {
564 print
'<td class="liste_titre center">';
565 $searchpicto = $form->showFilterButtons();
571 print
'<tr class="liste_titre">';
573 if (
$conf->main_checkbox_left_column) {
574 print_liste_field_titre($selectedfields, $_SERVER[
"PHP_SELF"],
"",
'',
'',
'', $sortfield, $sortorder,
'maxwidthsearch center ');
576 if (!empty($arrayfields[
'cr.date_sync'][
'checked'])) {
578 print_liste_field_titre($arrayfields[
'cr.date_sync'][
'label'], $_SERVER[
"PHP_SELF"],
"cr.date_sync",
"", $param,
"", $sortfield, $sortorder);
580 if (!empty($arrayfields[
'm.code'][
'checked'])) {
581 print_liste_field_titre($arrayfields[
'm.code'][
'label'], $_SERVER[
"PHP_SELF"],
"m.code",
"", $param,
"", $sortfield, $sortorder);
583 if (!empty($arrayfields[
'cr.rate'][
'checked'])) {
584 print_liste_field_titre($arrayfields[
'cr.rate'][
'label'], $_SERVER[
"PHP_SELF"],
"cr.rate",
"", $param,
"", $sortfield, $sortorder);
586 if (!empty($arrayfields[
'cr.rate_direct'][
'checked'])) {
587 print_liste_field_titre($arrayfields[
'cr.rate_direct'][
'label'], $_SERVER[
"PHP_SELF"],
"cr.rate_direct",
"", $param,
"", $sortfield, $sortorder);
591 $parameters = array(
'arrayfields' => $arrayfields,
'param' => $param,
'sortfield' => $sortfield,
'sortorder' => $sortorder);
592 $reshook = $hookmanager->executeHooks(
'printFieldListTitle', $parameters);
593 print $hookmanager->resPrint;
595 if (!
$conf->main_checkbox_left_column) {
596 print_liste_field_titre($selectedfields, $_SERVER[
"PHP_SELF"],
"",
'',
'',
'align="center"', $sortfield, $sortorder,
'maxwidthsearch center ');
603 while ($i < min($num, $limit)) {
604 $obj =
$db->fetch_object($resql);
606 print
'<tr class="oddeven">';
609 if ($action ==
"updateRate" && $obj->rowid == $id_rate_selected) {
610 if (
$conf->main_checkbox_left_column) {
611 print
'<td class="center">';
614 print
'<td><input class="minwidth200" name="dateinput" value="'.
date(
'Y-m-d',
dol_stringtotime($obj->date_sync)) .
'" type="date"></td>';
615 print
'<td>' . $form->selectMultiCurrency($obj->code,
'multicurrency_code', 1,
"(code:<>:'".getDolCurrency().
"')",
true) .
'</td>';
616 print
'<td><input type="text" min="0" step="any" class="maxwidth100" name="rateinput" value="' .
dol_escape_htmltag($obj->rate) .
'">';
617 print
'<input type="hidden" name="page" value="'.dol_escape_htmltag((
string) $page).
'">';
618 print
'<input type="hidden" name="id_rate" value="'.dol_escape_htmltag($obj->rowid).
'">';
619 print
'<button type="submit" class="button small reposition" name="action" value="update">'.$langs->trans(
"Modify").
'</button>';
620 print
'<button type="submit" class="button small reposition" name="action" value="cancel">'.$langs->trans(
"Cancel").
'</button>';
622 if (!
$conf->main_checkbox_left_column) {
623 print
'<td class="center">';
628 if (
$conf->main_checkbox_left_column) {
629 print
'<td class="nowrap center">';
630 if ($massactionbutton || $massaction) {
632 if (in_array($obj->rowid, $arrayofselected)) {
635 print
'<a class="editfielda marginleftonly marginrightonly reposition" href="'.$_SERVER[
"PHP_SELF"].
'?action=updateRate&token='.newToken().
'&id_rate='.$obj->rowid.
'">'.
img_picto(
'edit',
'edit').
'</a>';
636 print
'<a class="marginleftonly marginrightonly reposition" href="'.$_SERVER[
"PHP_SELF"].
'?action=deleteRate&token='.newToken().
'&id_rate='.$obj->rowid.
'">'.
img_picto(
'delete',
'delete').
'</a>';
637 print
'<input id="cb'.$obj->rowid.
'" class="flat checkforselect marginleftonly" type="checkbox" name="toselect[]" value="'.$obj->rowid.
'"'.($selected ?
' checked="checked"' :
'').
'>';
646 if (!empty($arrayfields[
'cr.date_sync'][
'checked'])) {
647 print
'<td class="tdoverflowmax200">';
648 print $obj->date_sync;
656 if (!empty($arrayfields[
'm.code'][
'checked'])) {
657 print
'<td class="tdoverflowmax200">';
659 print
' - <span class="opacitymedium">'.$obj->name.
'</span>';
668 if (!empty($arrayfields[
'cr.rate'][
'checked'])) {
669 print
'<td class="tdoverflowmax200">';
678 if (!empty($arrayfields[
'cr.rate_direct'][
'checked'])) {
679 print
'<td class="tdoverflowmax200">';
680 print $obj->rate_direct;
689 $parameters = array(
'arrayfields' => $arrayfields,
'obj' => $obj);
690 $reshook = $hookmanager->executeHooks(
'printFieldListValue', $parameters);
691 print $hookmanager->resPrint;
694 if (!
$conf->main_checkbox_left_column) {
695 print
'<td class="nowrap center">';
696 if ($massactionbutton || $massaction) {
698 if (in_array($obj->rowid, $arrayofselected)) {
701 print
'<a class="editfielda marginleftonly marginrightonly" href="'.$_SERVER[
"PHP_SELF"].
'?action=updateRate&token='.newToken().
'&id_rate='.$obj->rowid.
'">'.
img_picto(
'edit',
'edit').
'</a>';
702 print
'<a class="marginleftonly marginrightonly" href="'.$_SERVER[
"PHP_SELF"].
'?action=deleteRate&token='.newToken().
'&id_rate='.$obj->rowid.
'">'.
img_picto(
'delete',
'delete').
'</a>';
703 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...
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.
print $langs trans('Date')." left Ref 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 Paid 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.