33if (!defined(
'NOREQUIREMENU')) {
34 define(
'NOREQUIREMENU',
'1');
36if (!defined(
'NOREQUIREHTML')) {
37 define(
'NOREQUIREHTML',
'1');
39if (!defined(
'NOREQUIREAJAX')) {
40 define(
'NOREQUIREAJAX',
'1');
44require
'../main.inc.php';
53require_once DOL_DOCUMENT_ROOT.
'/core/class/html.form.class.php';
54require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formother.class.php';
55require_once DOL_DOCUMENT_ROOT.
'/core/class/hookmanager.class.php';
56require_once DOL_DOCUMENT_ROOT.
'/core/lib/date.lib.php';
57require_once DOL_DOCUMENT_ROOT.
'/categories/class/categorie.class.php';
58require_once DOL_DOCUMENT_ROOT.
'/compta/facture/class/facture.class.php';
59require_once DOL_DOCUMENT_ROOT.
'/societe/class/societe.class.php';
62$langs->loadLangs(array(
"bills",
"orders",
"commercial",
"cashdesk",
"receiptprinter",
"banks"));
65$action =
GETPOST(
'action',
'aZ09');
67$setcurrency =
GETPOST(
'setcurrency',
'aZ09');
69$hookmanager->initHooks(array(
'takeposfrontend'));
70if (empty($_SESSION[
"takeposterminal"])) {
72 $_SESSION[
"takeposterminal"] = 1;
73 } elseif (!empty($_COOKIE[
"takeposterminal"])) {
74 $_SESSION[
"takeposterminal"] = preg_replace(
'/[^a-zA-Z0-9_\-]/',
'', $_COOKIE[
"takeposterminal"]);
78if ($setterminal > 0) {
79 $_SESSION[
"takeposterminal"] = (int) $setterminal;
80 dolSetCookie(
"takeposterminal", (
string) $setterminal, -1);
83if ($setcurrency !=
"") {
84 $_SESSION[
"takeposcustomercurrency"] = $setcurrency;
91$maxcategbydefaultforthisdevice = 12;
92$maxproductbydefaultforthisdevice = 24;
94$MAXCATEG =
getDolGlobalInt(
'TAKEPOS_NB_MAXCATEG', $maxcategbydefaultforthisdevice);
95$MAXPRODUCT =
getDolGlobalInt(
'TAKEPOS_NB_MAXPRODUCT', $maxproductbydefaultforthisdevice);
97$term = empty($_SESSION[
'takeposterminal']) ? 1 : $_SESSION[
'takeposterminal'];
122$arrayofjs = array(
'/takepos/js/jquery.colorbox-min.js');
123$arrayofcss = array(
'/takepos/css/pos.css.php',
'/takepos/css/colorbox.css');
126 $arrayofcss[] =
'/takepos/css/colorful.css';
131$title =
'TakePOS - Dolibarr '.DOL_VERSION;
135$head =
'<meta name="apple-mobile-web-app-title" content="TakePOS"/>
136<meta name="apple-mobile-web-app-capable" content="yes">
137<meta name="mobile-web-app-capable" content="yes">
138<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"/>';
140top_htmlhead($head, $title, $disablejs, $disablehead, $arrayofjs, $arrayofcss);
143$categories = $categorie->get_full_arbo(
'product',
getDolGlobalInt(
'TAKEPOS_ROOT_CATEGORY_ID'), 1);
148$levelofrootcategory = 0;
150 foreach ($categories as $key => $categorycursor) {
152 if ($categorycursor[
'id'] ==
getDolGlobalInt(
'TAKEPOS_ROOT_CATEGORY_ID')) {
153 $levelofrootcategory = $categorycursor[
'level'];
159$levelofmaincategories = $levelofrootcategory + 1;
161$maincategories = array();
162$subcategories = array();
163foreach ($categories as $key => $categorycursor) {
164 if ($categorycursor[
'level'] == $levelofmaincategories) {
165 $maincategories[$key] = $categorycursor;
166 } elseif ($categorycursor[
'level'] > $levelofmaincategories) {
167 $subcategories[$key] = $categorycursor;
175$keyCodeForEnter =
'';
176if (!empty($_SESSION[
'takeposterminal'])) {
177 $keyCodeForEnter =
getDolGlobalInt(
'CASHDESK_READER_KEYCODE_FOR_ENTER'.$_SESSION[
'takeposterminal']) > 0 ?
getDolGlobalString(
'CASHDESK_READER_KEYCODE_FOR_ENTER'.$_SESSION[
'takeposterminal']) :
'';
181<body
class=
"bodytakepos" style=
"overflow: hidden;">
184var categories = <?php echo json_encode($maincategories); ?>;
185var subcategories = <?php echo json_encode($subcategories); ?>;
189var currentsubcategories=[];
192var place=
"<?php echo $place; ?>";
196var search2_timer=
null;
215function ClearSearch(clearSearchResults) {
216 console.log(
"ClearSearch");
217 $(
"#search").val(
'');
218 $(
"#qty").html(
"<?php echo $langs->trans("Qty
"); ?>").removeClass(
'clicked');
219 $(
"#price").html(
"<?php echo $langs->trans("Price
"); ?>").removeClass(
'clicked');
220 $(
"#reduction").html(
"<?php echo $langs->trans("LineDiscountShort
"); ?>").removeClass(
'clicked');
221 <?php
if (
$conf->browser->layout ==
'classic') { ?>
222 setFocusOnSearchField();
224 if (clearSearchResults) {
225 $(
"#search").trigger(
'keyup');
230function setFocusOnSearchField() {
231 console.log(
"Call setFocusOnSearchField in page index.php");
232 <?php
if (
$conf->browser->layout ==
'classic') { ?>
233 console.log(
"has keyboard from localStorage, so we can force focus on search field");
234 $(
"#search").focus();
238function PrintCategories(first) {
239 console.log(
"PrintCategories");
240 for (i = 0; i < <?php echo($MAXCATEG - 2); ?>; i++) {
241 if (typeof (categories[parseInt(i)+parseInt(first)]) ==
"undefined")
243 $(
"#catdivdesc"+i).hide();
244 $(
"#catdesc"+i).text(
"");
245 $(
"#catimg"+i).attr(
"src",
"genimg/empty.png");
246 $(
"#catwatermark"+i).hide();
247 $(
"#catdiv"+i).attr(
'class',
'wrapper divempty');
250 $(
"#catdivdesc"+i).show();
253 $(
"#catdesc"+i).html(categories[parseInt(i)+parseInt(first)][
'label'].bold() +
' - ' + categories[parseInt(i)+parseInt(first)][
'description']);
255 $(
"#catdesc"+i).text(categories[parseInt(i)+parseInt(first)][
'label']);
257 $(
"#catimg"+i).attr(
"src",
"genimg/index.php?query=cat&id="+categories[parseInt(i)+parseInt(first)][
'rowid']);
258 $(
"#catdiv"+i).data(
"rowid",categories[parseInt(i)+parseInt(first)][
'rowid']);
259 $(
"#catdiv"+i).attr(
"data-rowid",categories[parseInt(i)+parseInt(first)][
'rowid']);
260 $(
"#catdiv"+i).attr(
'class',
'wrapper');
261 $(
"#catwatermark"+i).show();
265function MoreCategories(moreorless) {
266 console.log(
"MoreCategories moreorless="+moreorless+
" pagecategories="+pagecategories);
267 if (moreorless ==
"more") {
268 $(
'#catimg15').animate({opacity:
'0.5'}, 1);
269 $(
'#catimg15').animate({opacity:
'1'}, 100);
270 pagecategories=pagecategories+1;
272 if (moreorless ==
"less") {
273 $(
'#catimg14').animate({opacity:
'0.5'}, 1);
274 $(
'#catimg14').animate({opacity:
'1'}, 100);
275 if (pagecategories==0)
return;
276 pagecategories=pagecategories-1;
278 if (typeof (categories[<?php echo($MAXCATEG - 2); ?> * pagecategories] && moreorless ==
"more") ==
"undefined") {
279 pagecategories=pagecategories-1;
283 for (i = 0; i < <?php echo($MAXCATEG - 2); ?>; i++) {
284 if (typeof (categories[i+(<?php echo($MAXCATEG - 2); ?> * pagecategories)]) ==
"undefined") {
286 console.log(
"complete with empty record");
287 $(
"#catdivdesc"+i).hide();
288 $(
"#catdesc"+i).text(
"");
289 $(
"#catimg"+i).attr(
"src",
"genimg/empty.png");
290 $(
"#catwatermark"+i).hide();
293 $(
"#catdivdesc"+i).show();
296 $(
"#catdesc"+i).html(categories[i+(<?php echo($MAXCATEG - 2); ?> * pagecategories)][
'label'].bold() +
' - ' + categories[i+(<?php echo($MAXCATEG - 2); ?> * pagecategories)][
'description']);
298 $(
"#catdesc"+i).text(categories[i+(<?php echo($MAXCATEG - 2); ?> * pagecategories)][
'label']);
300 $(
"#catimg"+i).attr(
"src",
"genimg/index.php?query=cat&id="+categories[i+(<?php echo($MAXCATEG - 2); ?> * pagecategories)][
'rowid']);
301 $(
"#catdiv"+i).data(
"rowid",categories[i+(<?php echo($MAXCATEG - 2); ?> * pagecategories)][
'rowid']);
302 $(
"#catdiv"+i).attr(
"data-rowid",categories[i+(<?php echo($MAXCATEG - 2); ?> * pagecategories)][
'rowid']);
303 $(
"#catwatermark"+i).show();
310function PrintSubCategory(ishow, val) {
311 $(
"#prodivdesc"+ishow).show();
313 $(
"#prodesc"+ishow).html(val.label.bold() +
' - ' + val.description);
314 $(
"#probutton"+ishow).html(val.label);
316 $(
"#prodesc"+ishow).text(val.label);
317 $(
"#probutton"+ishow).text(val.label);
319 $(
"#probutton"+ishow).show();
320 $(
"#proprice"+ishow).attr(
"class",
"hidden");
321 $(
"#proprice"+ishow).html(
"");
322 $(
"#proimg"+ishow).attr(
"src",
"genimg/index.php?query=cat&id="+val.rowid);
323 $(
"#prodiv"+ishow).data(
"rowid",val.rowid);
324 $(
"#prodiv"+ishow).attr(
"data-rowid",val.rowid);
325 $(
"#prodiv"+ishow).data(
"iscat", 1);
326 $(
"#prodiv"+ishow).attr(
"data-iscat", 1);
327 $(
"#prodiv"+ishow).removeClass(
"divempty");
328 $(
"#prowatermark"+ishow).show();
332function LoadProducts(
position, issubcat) {
333 console.log(
"LoadProducts position="+
position+
" issubcat="+issubcat);
334 var maxproduct = <?php echo (
int) ($MAXPRODUCT - 2); ?>;
337 currentcat =
"supplements";
339 if (subcategories.count == 0) {
340 alert(
"No product found into categories level 2 or more");
343 $(
'#catimg'+
position).animate({opacity:
'0.5'}, 1);
344 $(
'#catimg'+
position).animate({opacity:
'1'}, 100);
345 if (issubcat ==
true) {
346 currentcat = $(
'#prodiv'+
position).data(
'rowid');
349 currentcat = $(
'#catdiv'+
position).data(
'rowid');
350 console.log(
"currentcat="+currentcat);
353 if (currentcat == undefined) {
359 currentsubcategories = [];
360 if (currentcat !=
"supplements") {
361 console.log(
"Loop on each category level 2 or more");
362 jQuery.each(subcategories,
function(i, val) {
363 if (currentcat == val.fk_parent) {
364 currentsubcategories.push(val);
369 while (ishow < currentsubcategories.length && ishow < maxproduct) {
370 PrintSubCategory(ishow, currentsubcategories[ishow]);
376 if (maxproduct >= 1) {
377 limit = maxproduct - 1;
381 let socid = jQuery(
'#thirdpartyid').val();
382 if ((socid === undefined || socid ===
"") && parseInt(
"<?php echo dol_escape_js($socid) ?>") > 0) {
383 socid = parseInt(
"<?php echo dol_escape_js($socid); ?>");
387 $.getJSON(
'<?php echo DOL_URL_ROOT ?>/takepos/ajax/ajax.php?action=getProducts&token=<?php echo currentToken();?>&thirdpartyid=' + socid +
'&category='+currentcat+
'&tosell=1&limit='+limit+
'&offset=0',
function(data) {
389 console.log(
"Call ajax.php (in LoadProducts) to get Products of category "+currentcat+
" then loop on result to fill image thumbs");
390 console.log(
"Found "+data.length+
" record");
392 if (data.length == 0 && currentcat ==
"supplements") {
393 alert(
"No supplements found into the supplement category. Check the module setup and your product categories.");
396 while (ishow < maxproduct) {
397 console.log(
"ishow"+ishow+
" idata="+idata);
398 console.log(data[idata]);
400 if (typeof (data[idata]) ==
"undefined") {
402 echo
'$("#prodivdesc"+ishow).hide();';
403 echo
'$("#prodesc"+ishow).text("");';
404 echo
'$("#proimg"+ishow).attr("title","");';
405 echo
'$("#proimg"+ishow).attr("src","genimg/empty.png");';
407 echo
'$("#probutton"+ishow).hide();';
408 echo
'$("#probutton"+ishow).text("");';
410 $(
"#proprice"+ishow).attr(
"class",
"hidden");
411 $(
"#proprice"+ishow).html(
"");
413 $(
"#prodiv"+ishow).data(
"rowid",
"");
414 $(
"#prodiv"+ishow).attr(
"data-rowid",
"");
416 $(
"#prodiv"+ishow).data(
"iscat",
"0");
417 $(
"#prodiv"+ishow).attr(
"data-iscat",
"0");
419 $(
"#prodiv"+ishow).attr(
"class",
"wrapper2 divempty");
422 $titlestring =
"'".dol_escape_js($langs->transnoentities(
'Ref').
': ').
"' + data[idata]['ref']";
423 $titlestring .=
" + ' - ".dol_escape_js($langs->trans(
"Barcode").
': ').
"' + data[idata]['barcode']";
425 var titlestring = <?php echo $titlestring; ?>;
427 echo
'$("#prodivdesc"+ishow).show();';
429 echo
'$("#prodesc"+ishow).html(data[parseInt(idata)][\'ref\'].bold() + \' - \' + data[parseInt(idata)][\'label\']);';
431 echo
'$("#prodesc"+ishow).html(data[parseInt(idata)][\'ref\'].bold());';
433 echo
'$("#prodesc"+ishow).html(data[parseInt(idata)][\'label\']);';
435 echo
'$("#proimg"+ishow).attr("title", titlestring);';
436 echo
'$("#proimg"+ishow).attr("src", "genimg/index.php?query=pro&id="+data[idata][\'id\']);';
438 echo
'$("#probutton"+ishow).show();';
439 echo
'$("#probutton"+ishow).html(data[parseInt(idata)][\'label\']);';
442 if (data[parseInt(idata)][
'price_formated']) {
443 $(
"#proprice" + ishow).attr(
"class",
"productprice");
447 $(
"#proprice" + ishow).html(data[parseInt(idata)][
'price_formated']);
451 $(
"#proprice" + ishow).html(data[parseInt(idata)][
'price_ttc_formated']);
456 console.log(
"#prodiv"+ishow+
".data(rowid)="+data[idata][
'id']);
458 $(
"#prodiv"+ishow).data(
"rowid", data[idata][
'id']);
459 $(
"#prodiv"+ishow).attr(
"data-rowid", data[idata][
'id']);
460 console.log($(
'#prodiv4').data(
'rowid'));
462 $(
"#prodiv"+ishow).data(
"iscat", 0);
463 $(
"#prodiv"+ishow).attr(
"data-iscat", 0);
465 $(
"#prodiv"+ishow).attr(
"class",
"wrapper2");
469 $parameters = array();
470 $parameters[
'caller'] =
'loadProducts';
471 $hookmanager->executeHooks(
'completeJSProductDisplay', $parameters);
472 print $hookmanager->resPrint;
475 $(
"#prowatermark"+ishow).hide();
484function MoreProducts(moreorless) {
485 console.log(
"MoreProducts");
487 if ($(
'#search_pagination').val() !=
'') {
488 return Search2(
'<?php echo(isset($keyCodeForEnter) ? $keyCodeForEnter : ''); ?>', moreorless);
491 var maxproduct = <?php echo($MAXPRODUCT - 2); ?>;
493 if (moreorless==
"more"){
494 $(
'#proimg31').animate({opacity:
'0.5'}, 1);
495 $(
'#proimg31').animate({opacity:
'1'}, 100);
496 pageproducts=pageproducts+1;
498 if (moreorless==
"less"){
499 $(
'#proimg30').animate({opacity:
'0.5'}, 1);
500 $(
'#proimg30').animate({opacity:
'1'}, 100);
501 if (pageproducts==0)
return;
502 pageproducts=pageproducts-1;
508 if (maxproduct >= 1) {
509 limit = maxproduct-1;
513 var first = maxproduct * pageproducts;
514 var offset = Math.max(0, first - currentsubcategories.length);
517 let socid = jQuery(
'#thirdpartyid').val();
518 if ((socid === undefined || socid ===
"") && parseInt(
"<?php echo dol_escape_js($socid) ?>") > 0) {
519 socid = parseInt(
"<?php echo dol_escape_js($socid); ?>");
523 $.getJSON(
'<?php echo DOL_URL_ROOT ?>/takepos/ajax/ajax.php?action=getProducts&token=<?php echo currentToken();?>&thirdpartyid=' + socid +
'&category='+currentcat+
'&tosell=1&limit='+limit+
'&offset='+offset,
function(data) {
524 console.log(
"Call ajax.php (in MoreProducts) to get Products of category "+currentcat);
526 if (typeof (data[0]) ==
"undefined" && first >= currentsubcategories.length && moreorless==
"more"){
527 pageproducts=pageproducts-1;
531 while (ishow < maxproduct && first + ishow < currentsubcategories.length) {
532 PrintSubCategory(ishow, currentsubcategories[first + ishow]);
536 while (ishow < maxproduct) {
537 if (typeof (data[idata]) ==
"undefined") {
538 $(
"#prodivdesc"+ishow).hide();
539 $(
"#prodesc"+ishow).text(
"");
540 $(
"#probutton"+ishow).text(
"");
541 $(
"#probutton"+ishow).hide();
542 $(
"#proprice"+ishow).attr(
"class",
"");
543 $(
"#proprice"+ishow).html(
"");
544 $(
"#proimg"+ishow).attr(
"src",
"genimg/empty.png");
545 $(
"#prodiv"+ishow).data(
"rowid",
"");
546 $(
"#prodiv"+ishow).attr(
"data-rowid",
"");
547 $(
"#prodiv"+ishow).data(
"iscat",0);
548 $(
"#prodiv"+ishow).attr(
"data-iscat",0);
550 $(
"#prodivdesc"+ishow).show();
552 $(
"#prodesc"+ishow).html(data[parseInt(idata)][
'ref'].bold() +
' - ' + data[parseInt(idata)][
'label']);
553 <?php } elseif (
getDolGlobalInt(
'TAKEPOS_SHOW_PRODUCT_REFERENCE') == 2) { ?>
554 $(
"#prodesc"+ishow).html(data[parseInt(idata)][
'ref'].bold());
556 $(
"#prodesc"+ishow).html(data[parseInt(idata)][
'label']);
558 $(
"#probutton"+ishow).html(data[parseInt(idata)][
'label']);
559 $(
"#probutton"+ishow).show();
560 if (data[parseInt(idata)][
'price_formated']) {
561 $(
"#proprice" + ishow).attr(
"class",
"productprice");
565 $(
"#proprice" + ishow).html(data[parseInt(idata)][
'price_formated']);
569 $(
"#proprice" + ishow).html(data[parseInt(idata)][
'price_ttc_formated']);
574 $(
"#proimg"+ishow).attr(
"src",
"genimg/index.php?query=pro&id="+data[idata][
'id']);
575 $(
"#prodiv"+ishow).data(
"rowid",data[idata][
'id']);
576 $(
"#prodiv"+ishow).attr(
"data-rowid",data[idata][
'id']);
577 $(
"#prodiv"+ishow).data(
"iscat",0);
578 $(
"#prodiv"+ishow).attr(
"data-iscat",0);
580 $(
"#prowatermark"+ishow).hide();
589function ClickProduct(
position, qty = 1, qty_std = 0) {
590 console.log(
"ClickProduct at position"+
position);
591 if ($(
'#invoiceid').val() ==
"") {
592 invoiceid = $(
'#invoiceid').val();
595 $(
'#proimg'+
position).animate({opacity:
'0.5'}, 1);
596 $(
'#proimg'+
position).animate({opacity:
'1'}, 100);
597 if ($(
'#prodiv'+
position).data(
'iscat') == 1){
598 console.log(
"Click on a category at position "+
position);
602 invoiceid = $(
"#invoiceid").val();
603 idproduct=$(
'#prodiv'+
position).data(
'rowid');
604 console.log(
"Click on product at position "+
position+
" for idproduct "+idproduct+
", qty="+qty+
" invoiceid="+invoiceid);
605 if (idproduct ==
"") {
609 addInvoiceLine =
function(qty, qty_std_inner = 0) {
611 $(
"#poslines").load(
"invoice.php?action=addline&token=<?php echo currentToken(); ?>&place="+place+
"&idproduct="+idproduct+
"&selectedline="+selectedline+
"&qty="+qty+
"&invoiceid="+invoiceid+(qty_std_inner ?
'&qty_std=1' :
''), function() {
614 echo
"CustomerDisplay();";
621 if ($(
'#prodiv'+
position).data(
'unit') == 2) {
622 WeighingScale(addInvoiceLine);
624 addInvoiceLine(qty, qty_std);
627 addInvoiceLine(qty, qty_std);
634function ChangeThirdparty(idcustomer) {
635 console.log(
"ChangeThirdparty");
637 $(
"#poslines").load(
"<?php echo DOL_URL_ROOT ?>/societe/list.php?action=change&token=<?php echo currentToken();?>&type=t&contextpage=poslist&idcustomer="+idcustomer+
"&place="+place+
"",
function() {
643function deleteline() {
644 invoiceid = $(
"#invoiceid").val();
645 console.log(
"Delete line invoiceid="+invoiceid);
646 $(
"#poslines").load(
"invoice.php?action=deleteline&token=<?php echo currentToken(); ?>&place="+place+
"&idline="+selectedline+
"&invoiceid="+invoiceid,
function() {
653 console.log(
"Open box to select the thirdparty place="+place);
654 $.colorbox({href:
"../societe/list.php?type=t&contextpage=poslist&nomassaction=1&place="+place, width:
"90%", height:
"80%", transition:
"none", iframe:
"true", title:
"<?php echo $langs->trans("Customer
"); ?>"});
658 console.log(
"Open box to select the contact place="+place);
659 $.colorbox({href:
"../contact/list.php?type=c&contextpage=poslist&nomassaction=1&place="+place, width:
"90%", height:
"80%", transition:
"none", iframe:
"true", title:
"<?php echo $langs->trans("Contact"); ?>"});
664 console.log(
"Open box to select the history");
665 $.colorbox({href:
"../compta/facture/list.php?contextpage=poslist&search_module_source=takepos", width:
"90%", height:
"80%", transition:
"none", iframe:
"true", title:
"<?php echo $langs->trans("History
"); ?>"});
668function Reduction() {
669 invoiceid = $(
"#invoiceid").val();
670 console.log(
"Open popup to enter reduction on invoiceid="+invoiceid);
671 $.colorbox({href:
"reduction.php?place="+place+
"&invoiceid="+invoiceid, width:
"80%", height:
"90%", transition:
"none", iframe:
"true", title:
""});
674var closeBillParams=
"";
675function CloseBill() {
677 $parameters = array();
678 $reshook = $hookmanager->executeHooks(
'paramsForCloseBill', $parameters, $obj, $action);
680 echo
"customerAnchorTag = document.querySelector('a[id=\"customer\"]'); ";
681 echo
"if (customerAnchorTag && customerAnchorTag.innerText.trim() === '".dol_escape_js($langs->transnoentitiesnoconv(
"Customer")).
"') { ";
682 echo
"alert('".dol_escape_js($langs->transnoentitiesnoconv(
"NoClientErrorMessage")).
"'); ";
686 invoiceid = $(
"#invoiceid").val();
687 console.log(
"Open popup to enter payment on invoiceid="+invoiceid);
689 if ($(
"#idcustomer").val() ==
"") {
690 alert(
"<?php echo dol_escape_js($langs->transnoentitiesnoconv('TakePosCustomerMandatory'), 2); ?>");
701 if (empty($alternative_payurl)) {
707 $.colorbox({href:
"<?php echo $payurl; ?>?place="+place+
"&invoiceid="+invoiceid+closeBillParams, width:
"80%", height:
"90%", transition:
"none", iframe:
"true", title:
""});
711 invoiceid = $(
"#invoiceid").val();
712 console.log(
"Open popup to split on invoiceid="+invoiceid);
713 $.colorbox({href:
"split.php?place="+place+
"&invoiceid="+invoiceid, width:
"80%", height:
"90%", transition:
"none", iframe:
"true", title:
""});
717 console.log(
"Open box to select floor place="+place);
718 $.colorbox({href:
"floors.php?place="+place, width:
"90%", height:
"90%", transition:
"none", iframe:
"true", title:
"<?php echo $langs->trans("Floors
"); ?>"});
722 invoiceid = $(
"#invoiceid").val();
723 console.log(
"Open box to enter a free product on invoiceid="+invoiceid);
724 $.colorbox({href:
"freezone.php?action=freezone&token=<?php echo newToken(); ?>&place="+place+
"&invoiceid="+invoiceid, width:
"80%", height:
"40%", transition:
"none", iframe:
"true", title:
"<?php echo $langs->trans("FreeZone
"); ?>"});
727function TakeposOrderNotes() {
728 console.log(
"Open box to order notes");
729 ModalBox(
'ModalNote');
730 $(
"#textinput").focus();
734 console.log(
"Refresh by reloading place="+place+
" invoiceid="+invoiceid);
735 $(
"#poslines").load(
"invoice.php?place="+place+
"&invoiceid="+invoiceid,
function() {
742 invoiceid = $(
"#invoiceid").val();
744 console.log(
"New with place = <?php echo $place; ?>, js place="+place+
", invoiceid="+invoiceid);
746 if (invoiceid ==
'') {
747 $(
"#poslines").load(
"invoice.php?action=delete&token=<?php echo currentToken(); ?>&place=" + place,
function () {
752 $(
"#idcustomer").val(
"");
756 $.getJSON(
'<?php echo DOL_URL_ROOT ?>/takepos/ajax/ajax.php?action=getInvoice&token=<?php echo currentToken();?>&id='+invoiceid,
function(data) {
759 if (parseInt(data[
'paye']) === 1) {
762 r = confirm(
'<?php echo($place > 0 ? $langs->transnoentitiesnoconv("ConfirmDeletionOfThisPOSSale") : $langs->transnoentitiesnoconv("ConfirmDiscardOfThisPOSSale")); ?>');
767 $(
"#poslines").load(
"invoice.php?action=delete&token=<?php echo currentToken(); ?>&place=" + place,
function () {
772 $(
"#idcustomer").val(
"");
783function Search2(keyCodeForEnter, moreorless) {
784 var eventKeyCode =
null;
786 if (window.event && window.event.keyCode) {
787 eventKeyCode = window.event.keyCode;
789 if (eventKeyCode ===
null && keyCodeForEnter !==
'') {
794 console.log(
"Search2 Call ajax search to replace products keyCodeForEnter="+keyCodeForEnter+
", eventKeyCode="+eventKeyCode);
796 var search_term = $(
'#search').val();
797 var search_start = 0;
798 var search_limit = <?php echo $MAXPRODUCT - 2; ?>;
799 if (moreorless !=
null) {
800 search_term = $(
'#search_pagination').val();
801 search_start = $(
'#search_start_'+moreorless).val();
804 console.log(
"search_term="+search_term);
806 if (search_term ==
'') {
807 $(
"[id^=prowatermark]").html(
"");
808 $(
"[id^=prodesc]").text(
"");
809 $(
"[id^=probutton]").text(
"");
810 $(
"[id^=probutton]").hide();
811 $(
"[id^=proprice]").attr(
"class",
"hidden");
812 $(
"[id^=proprice]").html(
"");
813 $(
"[id^=proimg]").attr(
"src",
"genimg/empty.png");
814 $(
"[id^=prodiv]").data(
"rowid",
"");
815 $(
"[id^=prodiv]").attr(
"data-rowid",
"");
820 if (keyCodeForEnter ==
'' || eventKeyCode == keyCodeForEnter) {
824 if (search ===
true) {
828 clearTimeout(search2_timer);
832 search2_timer = setTimeout(
function(){
834 jQuery(
".wrapper2 .catwatermark").hide();
835 var nbsearchresults = 0;
838 let socid = jQuery(
'#thirdpartyid').val();
839 if ((socid === undefined || socid ===
"") && parseInt(
"<?php echo dol_escape_js($socid) ?>") > 0) {
840 socid = parseInt(
"<?php echo dol_escape_js($socid); ?>");
843 $.getJSON(
'<?php echo DOL_URL_ROOT ?>/takepos/ajax/ajax.php?action=search&token=<?php echo currentToken();?>&search_term=' + search_term +
'&thirdpartyid=' + socid +
'&search_start=' + search_start +
'&search_limit=' + search_limit,
function (data) {
844 for (i = 0; i < <?php echo($MAXPRODUCT - 2); ?>; i++) {
845 if (typeof (data[i]) ==
"undefined") {
846 $(
"#prowatermark" + i).html(
"");
847 $(
"#prodesc" + i).text(
"");
848 $(
"#probutton" + i).text(
"");
849 $(
"#probutton" + i).hide();
850 $(
"#proprice" + i).attr(
"class",
"hidden");
851 $(
"#proprice" + i).html(
"");
852 $(
"#proimg" + i).attr(
"src",
"genimg/empty.png");
853 $(
"#prodiv" + i).data(
"rowid",
"");
854 $(
"#prodiv" + i).attr(
"data-rowid",
"");
858 $titlestring =
"'".dol_escape_js($langs->transnoentities(
'Ref').
': ').
"' + data[i]['ref']";
859 $titlestring .=
" + ' - ".dol_escape_js($langs->trans(
"Barcode").
': ').
"' + data[i]['barcode']";
861 var titlestring = <?php echo $titlestring; ?>;
863 $(
"#prodesc" + i).html(data[i][
'ref'].bold() +
' - ' + data[i][
'label']);
864 <?php } elseif (
getDolGlobalInt(
'TAKEPOS_SHOW_PRODUCT_REFERENCE') == 2) { ?>
865 $(
"#prodesc" + i).html(data[i][
'ref'].bold());
867 $(
"#prodesc" + i).html(data[i][
'label']);
869 $(
"#prodivdesc" + i).show();
870 $(
"#probutton" + i).html(data[i][
'label']);
871 $(
"#probutton" + i).show();
872 if (data[i][
'price_formated']) {
873 $(
"#proprice" + i).attr(
"class",
"productprice");
877 $(
"#proprice" + i).html(data[i][
'price_formated']);
881 $(
"#proprice" + i).html(data[i][
'price_ttc_formated']);
886 $(
"#proimg" + i).attr(
"title", titlestring);
887 if( undefined !== data[i][
'img']) {
888 $(
"#proimg" + i).attr(
"src", data[i][
'img']);
891 $(
"#proimg" + i).attr(
"src",
"genimg/index.php?query=pro&id=" + data[i][
'rowid']);
893 $(
"#prodiv" + i).data(
"rowid", data[i][
'rowid']);
894 $(
"#prodiv" + i).attr(
"data-rowid", data[i][
'rowid']);
895 $(
"#prodiv" + i).data(
"iscat", 0);
896 $(
"#prodiv" + i).attr(
"data-iscat", 0);
900 $parameters = array();
901 $parameters[
'caller'] =
'search2';
902 $hookmanager->executeHooks(
'completeJSProductDisplay', $parameters);
903 print $hookmanager->resPrint;
908 }).always(
function (data) {
910 if ($(
'#search').val().length > 0 && data.length == 1) {
911 console.log($(
'#search').val()+
' - '+data[0][
'barcode']);
912 if ($(
'#search').val() == data[0][
'barcode'] &&
'thirdparty' == data[0][
'object']) {
913 console.log(
"There is only 1 answer with barcode matching the search, so we change the thirdparty "+data[0][
'rowid']);
914 ChangeThirdparty(data[0][
'rowid']);
916 else if (
'product' == data[0][
'object'] && $(
'#search').val() == data[0][
'barcode']) {
917 console.log(
"There is only 1 answer and we found search on a barcode, so we add the product in basket, qty="+data[0][
'qty']);
918 ClickProduct(0, data[0][
'qty'], 1);
921 if (eventKeyCode == keyCodeForEnter){
922 if (data.length == 0) {
923 $(
'#search').val(
'<?php
924 $langs->load('errors
');
925 echo dol_escape_js($langs->transnoentitiesnoconv("ErrorRecordNotFoundShort"));
926 ?> ('+search_term+
')');
927 $(
'#search').select();
929 else ClearSearch(
false);
932 $(
"#search_pagination").val($(
"#search").val());
933 if (search_start == 0) {
934 $(
"#prodiv<?php echo $MAXPRODUCT - 2; ?> span").hide();
937 $(
"#prodiv<?php echo $MAXPRODUCT - 2; ?> span").show();
938 var search_start_less = Math.max(0, parseInt(search_start) - parseInt(<?php echo $MAXPRODUCT - 2;?>));
939 $(
"#search_start_less").val(search_start_less);
941 if (nbsearchresults != <?php echo $MAXPRODUCT - 2; ?>) {
942 $(
"#prodiv<?php echo $MAXPRODUCT - 1; ?> span").hide();
945 $(
"#prodiv<?php echo $MAXPRODUCT - 1; ?> span").show();
946 var search_start_more = parseInt(search_start) + parseInt(<?php echo $MAXPRODUCT - 2;?>);
947 $(
"#search_start_more").val(search_start_more);
956function Edit(number) {
957 console.log(
"We click on PAD on key="+number);
959 if (typeof(selectedtext) ==
"undefined") {
963 var text=selectedtext+
"<br> ";
969 $(
"#qty").html(
"<?php echo $langs->trans("Qty
"); ?>").removeClass(
'clicked');
970 $(
"#price").html(
"<?php echo $langs->trans("Price
"); ?>").removeClass(
'clicked');
971 $(
"#reduction").html(
"<?php echo $langs->trans("LineDiscountShort
"); ?>").removeClass(
'clicked');
973 }
else if (number==
'qty') {
974 if (editaction==
'qty' && editnumber !=
'') {
975 $(
"#poslines").load(
"invoice.php?action=updateqty&token=<?php echo currentToken(); ?>&place="+place+
"&idline="+selectedline+
"&number="+editnumber,
function() {
978 $(
"#qty").html(
"<?php echo $langs->trans("Qty
"); ?>").removeClass(
'clicked');
981 setFocusOnSearchField();
987 }
else if (number==
'p') {
988 if (editaction==
'p' && editnumber!=
"") {
989 $(
"#poslines").load(
"invoice.php?action=updateprice&token=<?php echo currentToken(); ?>&place="+place+
"&idline="+selectedline+
"&number="+editnumber,
function() {
992 $(
"#price").html(
"<?php echo $langs->trans("Price
"); ?>").removeClass(
'clicked');
1001 }
else if (number==
'r') {
1002 if (editaction==
'r' && editnumber!=
"") {
1003 $(
"#poslines").load(
"invoice.php?action=updatereduction&token=<?php echo currentToken(); ?>&place="+place+
"&idline="+selectedline+
"&number="+editnumber,
function() {
1006 $(
"#reduction").html(
"<?php echo $langs->trans("LineDiscountShort
"); ?>").removeClass(
'clicked');
1017 editnumber=editnumber+number;
1019 if (editaction==
'qty'){
1020 text=text+
"<?php echo $langs->trans("Modify
")." ->
".$langs->trans("Qty
").":
"; ?>";
1021 $(
"#qty").html(
"OK").addClass(
"clicked");
1022 $(
"#price").html(
"<?php echo $langs->trans("Price
"); ?>").removeClass(
'clicked');
1023 $(
"#reduction").html(
"<?php echo $langs->trans("LineDiscountShort
"); ?>").removeClass(
'clicked');
1025 if (editaction==
'p'){
1026 text=text+
"<?php echo $langs->trans("Modify
")." ->
".$langs->trans("Price
").":
"; ?>";
1027 $(
"#qty").html(
"<?php echo $langs->trans("Qty
"); ?>").removeClass(
'clicked');
1028 $(
"#price").html(
"OK").addClass(
"clicked");
1029 $(
"#reduction").html(
"<?php echo $langs->trans("LineDiscountShort
"); ?>").removeClass(
'clicked');
1031 if (editaction==
'r'){
1032 text=text+
"<?php echo $langs->trans("Modify
")." ->
".$langs->trans("LineDiscountShort
").":
"; ?>";
1033 $(
"#qty").html(
"<?php echo $langs->trans("Qty
"); ?>").removeClass(
'clicked');
1034 $(
"#price").html(
"<?php echo $langs->trans("Price
"); ?>").removeClass(
'clicked');
1035 $(
"#reduction").html(
"OK").addClass(
"clicked");
1037 $(
'#'+selectedline).find(
"td:first").html(text+editnumber);
1041function TakeposPrintingOrder(){
1042 console.log(
"TakeposPrintingOrder output invoice to print order");
1043 $(
"#poslines").load(
"invoice.php?action=order&token=<?php echo currentToken();?>&place="+place,
function() {
1048function TakeposPrintingTemp(){
1049 console.log(
"TakeposPrintingTemp");
1050 $(
"#poslines").load(
"invoice.php?action=temp&token=<?php echo currentToken();?>&place="+place,
function() {
1055function OpenDrawer(){
1056 console.log(
"OpenDrawer call ajax url http://<?php print getDolGlobalString('TAKEPOS_PRINT_SERVER'); ?>:8111/print");
1059 data: { token:
'notrequired' },
1061 if (
getDolGlobalString(
'TAKEPOS_PRINT_SERVER') && filter_var(
$conf->global->TAKEPOS_PRINT_SERVER, FILTER_VALIDATE_URL) ==
true) {
1062 echo
"url: '".getDolGlobalString(
'TAKEPOS_PRINT_SERVER',
'localhost').
"/printer/drawer.php',";
1064 echo
"url: 'http://".getDolGlobalString(
'TAKEPOS_PRINT_SERVER',
'localhost').
":8111/print',";
1072function DolibarrOpenDrawer() {
1073 console.log(
"DolibarrOpenDrawer call ajax url /takepos/ajax/ajax.php?action=opendrawer&token=<?php echo currentToken();?>&term=<?php print urlencode(empty($_SESSION["takeposterminal
"]) ? '' : $_SESSION["takeposterminal
"]); ?>");
1076 data: { token:
'<?php echo currentToken(); ?>' },
1077 url:
"<?php print DOL_URL_ROOT.'/takepos/ajax/ajax.php?action=opendrawer&token='.currentToken().'&term='.urlencode(empty($_SESSION["takeposterminal
"]) ? '' : $_SESSION["takeposterminal
"]); ?>",
1081function MoreActions(totalactions) {
1082 for (i = 0; i <= totalactions; i++) {
1083 $(
"#action" + i).toggle();
1085 $(
"#actionnext").toggle();
1086 $(
"#actionprevious").toggle();
1089function ControlCashOpening()
1091 $.colorbox({href:
"../compta/cashcontrol/cashcontrol_card.php?action=create&contextpage=takepos", width:
"90%", height:
"60%", transition:
"none", iframe:
"true", title:
"<?php echo $langs->trans("NewCashFence
"); ?>"});
1094function CloseCashFence(rowid)
1096 $.colorbox({href:
"../compta/cashcontrol/cashcontrol_card.php?id="+rowid+
"&contextpage=takepos", width:
"90%", height:
"90%", transition:
"none", iframe:
"true", title:
"<?php echo $langs->trans("NewCashFence
"); ?>"});
1099function CashReport(rowid)
1101 $.colorbox({href:
"../compta/cashcontrol/report.php?id="+rowid+
"&contextpage=takepos", width:
"60%", height:
"90%", transition:
"none", iframe:
"true", title:
"<?php echo $langs->trans("CashReport
"); ?>"});
1108function ModalBox(ModalID)
1110 var modal = document.getElementById(ModalID);
1111 modal.style.display =
"block";
1114function DirectPayment(){
1115 console.log(
"DirectPayment");
1116 $(
"#poslines").load(
"invoice.php?place="+place+
"&action=valid&token=<?php echo currentToken(); ?>&pay=LIQ",
function() {
1117 $(
'#invoiceid').val(
"");
1121function FullScreen() {
1122 document.documentElement.requestFullscreen();
1125function WeighingScale(callback) {
1126 console.log(
"Weighing Scale: invoiceid = " + placeid +
", lineid = " + selectedline);
1131 if (idproduct ==
"" && selectedline > 0) {
1132 urlProduct =
"<?php echo DOL_URL_ROOT; ?>/api/index.php/takeposconnector/invoices/" + placeid +
"/lines/" + selectedline +
"/product";
1134 urlProduct =
"<?php echo DOL_URL_ROOT; ?>/api/index.php/products/" + idproduct;
1138 headers: {
"DOLAPIKEY":
'<?php echo $user->api_key; ?>' },
1141 .done(
function(product) {
1142 if (callback === undefined) {
1143 callback =
function(qty) {
1144 $(
"#poslines").load(
"invoice.php?token=<?php echo currentToken(); ?>&action=updateqty&place="+place+
"&idline="+selectedline+
"&number="+qty);
1147 if (product.fk_unit ==
"2") {
1148 askForWeight(product.multiprices_ttc[1], callback, function (errorMessage) {
1149 console.log(
"Erreur: " + errorMessage);
1155 editnumber = globalWeight;
1156 $(
"#poslines").load(
"invoice.php?token=<?php echo currentToken(); ?>&action=updateqty&place="+place+
"&idline="+selectedline+
"&number="+editnumber,
function() {
1163 data: { token:
'notrequired' },
1164 url:
'<?php print getDolGlobalString('TAKEPOS_PRINT_SERVER
'); ?>/scale/index.php',
1166 .done(
function( editnumber ) {
1167 $(
"#poslines").load(
"invoice.php?token=<?php echo currentToken(); ?>&action=updateqty&place="+place+
"&idline="+selectedline+
"&number="+editnumber,
function() {
1174$( document ).ready(
function() {
1180 if (empty($_SESSION[
"takeposterminal"]) || $_SESSION[
"takeposterminal"] ==
"") {
1181 print
"ModalBox('ModalTerminal');";
1184 if (
getDolGlobalString(
'TAKEPOS_CONTROL_CASH_OPENING') && !empty($_SESSION[
"takeposterminal"])) {
1189 $sql =
"SELECT rowid, status FROM ".MAIN_DB_PREFIX.
"pos_cash_fence WHERE";
1190 $sql .=
" entity = ".((int)
$conf->entity).
" AND ";
1191 $sql .=
" posnumber = ".((int) $_SESSION[
"takeposterminal"]).
" AND ";
1193 $resql =
$db->query($sql);
1195 $obj =
$db->fetch_object($resql);
1197 if (!isset($obj->rowid) || is_null($obj->rowid)) {
1198 print
"ControlCashOpening();";
1205 var elem1 = $(
"#topnav-left")[0];
1206 var elem2 = $(
"#topnav-right")[0];
1207 var checkOverflow =
function() {
1208 if (scrollBars().horizontal) $(
"#topnav").addClass(
"overflow");
1209 else $(
"#topnav").removeClass(
"overflow");
1212 var scrollBars =
function(){
1213 var container= $(
'#topnav')[0];
1215 vertical:container.scrollHeight > container.clientHeight,
1216 horizontal:container.scrollWidth > container.clientWidth
1220 $(window).resize(
function(){
1224 let resizeObserver =
new ResizeObserver(() => {
1227 resizeObserver.observe(elem1);
1228 resizeObserver.observe(elem2);
1231 var pressTimer = [];
1235 $(
".indicator").mousedown(
function(){
1236 direction = $(
this).hasClass(
"left") ? -1 : 1;
1238 pressTimer.push(setInterval(scrollTo, 100));
1241 $(
".indicator").mouseup(
function(){
1242 pressTimer.forEach(clearInterval);
1245 $(
"body").mouseup(
function(){
1246 pressTimer.forEach(clearInterval);
1247 console.log(
"body mouseup");
1250 function scrollTo(){
1251 console.log(
"here");
1252 var pos = $(
"#topnav").scrollLeft();
1253 document.getElementById(
"topnav").scrollTo({ left: $(
"#topnav").scrollLeft() + direction * step, behavior:
'smooth' })
1256 $(
"#topnav").scroll(
function(){
1257 if (($(
"#topnav").offsetWidth + $(
"#topnav").scrollLeft >= $(
"#topnav").scrollWidth)) {
1265<div
class=
"container">
1270 <div
class=
"header">
1271 <div
id=
"topnav" class=
"topnav">
1272 <div
id=
"topnav-left" class=
"topnav-left">
1273 <div
class=
"inline-block valignmiddle">
1274 <a
class=
"topnav-terminalhour" onclick=
"ModalBox('ModalTerminal')">
1275 <span
class=
"fa fa-cash-register"></span>
1276 <span
class=
"hideonsmartphone">
1278 if (!empty($_SESSION[
"takeposterminal"])) {
1279 echo
getDolGlobalString(
"TAKEPOS_TERMINAL_NAME_".$_SESSION[
"takeposterminal"], $langs->trans(
"TerminalName", $_SESSION[
"takeposterminal"]));
1284 echo
'<span class="hideonsmartphone"> - '.dol_print_date(
dol_now(),
"day").
'</span>'; ?>
1288 print
'<a class="valignmiddle tdoverflowmax100" id="multicurrency" onclick="ModalBox(\'ModalCurrency\')" title=""><span class="fas fa-coins paddingrightonly"></span>';
1289 print
'<span class="hideonsmartphone">'.$langs->trans(
"Currency").
'</span>';
1293 <!-- section
for customer -->
1294 <div
class=
"inline-block valignmiddle" id=
"customerandsales"></div>
1295 <input
type=
"hidden" id=
"idcustomer" value=
"">
1296 <!-- section
for shopping carts -->
1297 <div
class=
"inline-block valignmiddle" id=
"shoppingcart"></div>
1298 <!-- More info about customer -->
1299 <div
class=
"inline-block valignmiddle tdoverflowmax150onsmartphone" id=
"moreinfo"></div>
1303 <!-- More info about warehouse -->
1304 <div
class=
"inline-block valignmiddle tdoverflowmax150onsmartphone" id=
"infowarehouse"></div>
1308 <div
id=
"topnav-right" class=
"topnav-right">
1310 $reshook = $hookmanager->executeHooks(
'takepos_login_block_other');
1311 if ($reshook == 0) {
1313 <div
class=
"login_block_other takepos">
1314 <input
type=
"text" id=
"search" name=
"search" class=
"input-nobottom" onkeyup=
"Search2('<?php echo dol_escape_js($keyCodeForEnter); ?>', null);" placeholder=
"<?php echo dol_escape_htmltag($langs->trans("Search
")); ?>" autofocus>
1315 <a onclick=
"ClearSearch(false);" class=
"nohover"><span
class=
"fa fa-backspace"></span></a>
1316 <a href=
"<?php echo DOL_URL_ROOT.'/'; ?>" target=
"backoffice" rel=
"opener"><!-- we need rel=
"opener" here, we are on same domain and we need to be able to reuse
this tab several times -->
1317 <span
class=
"fas fa-home"></span></a>
1318 <?php
if (empty(
$conf->dol_use_jmobile)) { ?>
1319 <a
class=
"hideonsmartphone" onclick=
"FullScreen();" title=
"<?php echo dol_escape_htmltag($langs->trans("ClickFullScreenEscapeToLeave
")); ?>"><span
class=
"fa fa-expand-arrows-alt"></span></a>
1325 <div
class=
"login_block_user">
1327 print
top_menu_user(1, DOL_URL_ROOT.
'/user/logout.php?token='.
newToken().
'&urlfrom='.urlencode(
'/takepos/?setterminal='.((
int) $term)));
1331 <div
class=
"arrows">
1332 <span
class=
"indicator left"><i
class=
"fa fa-arrow-left"></i></span>
1333 <span
class=
"indicator right"><i
class=
"fa fa-arrow-right"></i></span>
1341<!-- Modal terminal box -->
1342<div
id=
"ModalTerminal" class=
"modal">
1343 <div
class=
"modal-content">
1344 <div
class=
"modal-header">
1348 <span
class=
"close" href=
"#" onclick=
"document.getElementById('ModalTerminal').style.display = 'none';">×</span>
1351 <h3><?php print $langs->trans(
"TerminalSelect"); ?></h3>
1353 <div
class=
"modal-body">
1354 <
button type=
"button" class=
"block" onclick=
"location.href='index.php?setterminal=1'"><?php print
getDolGlobalString(
"TAKEPOS_TERMINAL_NAME_1", $langs->trans(
"TerminalName", 1)); ?></
button>
1357 for ($i = 2; $i <= $nbloop; $i++) {
1358 print
'<button type="button" class="block" onclick="location.href=\'index.php?setterminal='.$i.
'\'">'.getDolGlobalString("TAKEPOS_TERMINAL_NAME_
".$i, $langs->trans("TerminalName
", $i)).'</button>';
1365<!-- Modal multicurrency box -->
1366<?php if (isModEnabled('multicurrency')) { ?>
1367<div id="ModalCurrency
" class="modal
">
1368 <div class="modal-content
">
1369 <div class="modal-header
">
1370 <span class="close
" href="#
" onclick="document.getElementById(
'ModalCurrency').style.display =
'none';
">×</span>
1371 <h3><?php print $langs->trans("SetMultiCurrencyCode
"); ?></h3>
1373 <div class="modal-body
">
1375 $sql = 'SELECT code FROM '.MAIN_DB_PREFIX.'multicurrency';
1376 $sql .= " WHERE entity IN (
'".getEntity('multicurrency
')."')
";
1377 $resql = $db->query($sql);
1379 while ($obj = $db->fetch_object($resql)) {
1380 print '<button type="button" class="block
" onclick="location.href=\
'index.php?setcurrency='.urlencode($obj->code).
'\'">'.$obj->code.'</button>';
1389<!-- Modal popup to create a Credit Note -->
1390<div id="ModalCreditNote
" class="modal
">
1391 <div class="modal-content
">
1392 <div class="modal-header
">
1393 <span class="close
" href="#
" onclick="document.getElementById(
'ModalCreditNote').style.display =
'none';
">×</span>
1394 <h3><?php print $langs->trans("invoiceAvoirWithLines
"); ?></h3>
1396 <div class="modal-body
">
1397 <button type="button" class="block
" onclick="CreditNote(); document.getElementById(
'ModalCreditNote').style.display =
'none';
"><?php print $langs->trans("Yes
"); ?></button>
1398 <button type="button" class="block
" onclick="document.getElementById(
'ModalCreditNote').style.display =
'none';
"><?php print $langs->trans("No
"); ?></button>
1404<div id="ModalNote
" class="modal
">
1405 <div class="modal-content
">
1406 <div class="modal-header
">
1407 <span class="close
" href="#
" onclick="document.getElementById(
'ModalNote').style.display =
'none';
">×</span>
1408 <h3><?php print $langs->trans("Note
"); ?></h3>
1410 <div class="modal-body
">
1411 <input type="text
" class="block
" id="textinput
">
1412 <button type="button" class="block
" onclick="SetNote(); document.getElementById(
'ModalNote').style.display =
'none';
">OK</button>
1421 <div id="poslines
" class="div1
">
1425 <button type="button" class="calcbutton
" onclick="Edit(7);
">7</button>
1426 <button type="button" class="calcbutton
" onclick="Edit(8);
">8</button>
1427 <button type="button" class="calcbutton
" onclick="Edit(9);
">9</button>
1428 <button type="button" id="qty
" class="calcbutton2
" onclick="Edit(
'qty')
"><?php echo $langs->trans("Qty
"); ?></button>
1429 <button type="button" class="calcbutton
" onclick="Edit(4);
">4</button>
1430 <button type="button" class="calcbutton
" onclick="Edit(5);
">5</button>
1431 <button type="button" class="calcbutton
" onclick="Edit(6);
">6</button>
1432 <button type="button" id="price" class="calcbutton2
" onclick="Edit(
'p')
"><?php echo $langs->trans("Price
"); ?></button>
1433 <button type="button" class="calcbutton
" onclick="Edit(1);
">1</button>
1434 <button type="button" class="calcbutton
" onclick="Edit(2);
">2</button>
1435 <button type="button" class="calcbutton
" onclick="Edit(3);
">3</button>
1436 <button type="button" id="reduction
" class="calcbutton2
" onclick="Edit(
'r')
"><?php echo $langs->trans("LineDiscountShort
"); ?></button>
1437 <button type="button" class="calcbutton
" onclick="Edit(0);
">0</button>
1438 <button type="button" class="calcbutton
" onclick="Edit(
'.')
">.</button>
1439 <button type="button" class="calcbutton poscolorblue
" onclick="Edit(
'c')
">C</button>
1440 <?php if ($user->hasRight('takepos', 'editlines')) { ?>
1441 <button type="button" class="calcbutton2 poscolordelete
" id="delete" onclick="deleteline()
"><span class="fa fa-trash
"></span></button>
1447// Dependency modulecheck
1448if (!isModEnabled('invoice')) {
1449 setEventMessages($langs->trans("ErrorModuleSetupNotComplete
", $langs->transnoentitiesnoconv("Invoice
")), null, 'errors');
1452// TakePOS setup check
1453if (isset($_SESSION["takeposterminal
"]) && $_SESSION["takeposterminal
"]) {
1454 $sql = "SELECT code, libelle FROM
" . MAIN_DB_PREFIX . "c_paiement
";
1455 $sql .= " WHERE entity IN (
" . getEntity('c_paiement') . ")
";
1456 $sql .= " AND
active = 1
";
1457 $sql .= " ORDER BY libelle
";
1459 $resql = $db->query($sql);
1460 $paiementsModes = array();
1462 while ($obj = $db->fetch_object($resql)) {
1463 $paycode = $obj->code;
1464 if ($paycode == 'LIQ') {
1467 if ($paycode == 'CHQ') {
1468 $paycode = 'CHEQUE';
1471 $constantforkey = "CASHDESK_ID_BANKACCOUNT_
" . $paycode . $_SESSION["takeposterminal
"];
1472 //var_dump($constantforkey.' '.getDolGlobalInt($constantforkey));
1473 if (getDolGlobalInt($constantforkey) > 0) {
1474 array_push($paiementsModes, $obj);
1479 if (empty($paiementsModes) && isModEnabled("bank
")) {
1480 $langs->load('errors');
1481 setEventMessages($langs->trans("ErrorModuleSetupNotComplete
", $langs->transnoentitiesnoconv("TakePOS
")), null, 'errors');
1482 setEventMessages($langs->trans("ProblemIsInSetupOfTerminal
", $_SESSION["takeposterminal
"]), null, 'errors');
1486if (count($maincategories) == 0) {
1487 if (getDolGlobalInt('TAKEPOS_ROOT_CATEGORY_ID') > 0) {
1488 $tmpcategory = new Categorie($db);
1489 $tmpcategory->fetch(getDolGlobalInt('TAKEPOS_ROOT_CATEGORY_ID'));
1490 setEventMessages($langs->trans("TakeposNeedsAtLeastOnSubCategoryIntoParentCategory
", $tmpcategory->label), null, 'errors');
1492 setEventMessages($langs->trans("TakeposNeedsCategories
"), null, 'errors');
1495// User menu and external TakePOS modules
1499if (! getDolGlobalString('TAKEPOS_HIDE_HISTORY')) {
1500 $menus[$r++] = array('title' => '<span class="fa fa-history paddingrightonly
"></span><div class="trunc
">'.$langs->trans("History
").'</div>', 'action' => 'History();');
1503if (getDolGlobalString('TAKEPOS_HIDE_HEAD_BAR')) {
1504 if (getDolGlobalString('TAKEPOS_CHOOSE_CONTACT')) {
1505 $menus[$r++] = array('title' => '<span class="far fa-building paddingrightonly
"></span><div class="trunc
">'.$langs->trans("Contact").'</div>', 'action' => 'Contact();');
1507 $menus[$r++] = array('title' => '<span class="far fa-building paddingrightonly
"></span><div class="trunc
">'.$langs->trans("Customer
").'</div>', 'action' => 'Customer();');
1511if (!getDolGlobalString('TAKEPOS_BAR_RESTAURANT')) {
1512 $menus[$r++] = array('title' => '<span class="fa fa-layer-group paddingrightonly
"></span><div class="trunc
">'.$langs->trans("New
").'</div>', 'action' => 'New();');
1514 // BAR RESTAURANT specific menu
1515 $menus[$r++] = array('title' => '<span class="fa fa-layer-group paddingrightonly
"></span><div class="trunc
">'.$langs->trans("Place
").'</div>', 'action' => 'Floors();');
1518// Add a non predefined product
1519if (!getDolGlobalString('TAKEPOS_NO_FREE_ZONE_PRODUCT')) {
1520 $menus[$r++] = array('title' => '<span class="fa fa-cube paddingrightonly
"></span><div class="trunc
">'.$langs->trans("FreeZone
").'</div>', 'action' => 'FreeZone();');
1523// BAR RESTAURANT specific menu "Print on kitchen/order printer
"
1524if (getDolGlobalString('TAKEPOS_BAR_RESTAURANT')) {
1525 if (getDolGlobalString('TAKEPOS_SUPPLEMENTS')) {
1526 $menus[$r++] = array('title' => '<span class="fa fa-cube paddingrightonly
"></span><div class="trunc
">'.$langs->trans("ProductSupplements
").'</div>', 'action' => 'LoadProducts(\'supplements\');');
1529 if (getDolGlobalString('TAKEPOS_ORDER_PRINTERS')) {
1530 $menus[$r++] = array('title' => '<span class="fa fa-blender-phone paddingrightonly
"></span><div class="trunc
">'.$langs->trans("SentOrderToKitchen
").'</span>', 'action' => 'TakeposPrintingOrder();');
1535$menus[$r++] = array('title' => '<span class="fa fa-percent paddingrightonly
"></span><div class="trunc
">'.$langs->trans("InvoiceDiscountShort
").'</div>', 'action' => 'Reduction();');
1537if (!getDolGlobalString('TAKEPOS_NO_SPLIT_SALE')) {
1538 $menus[$r++] = array('title' => '<span class="fas fa-cut paddingrightonly
"></span><div class="trunc
">'.$langs->trans("SplitSale
").'</div>', 'action' => 'Split();');
1541// Last action that close the sell (payments)
1542$menus[$r++] = array('title' => '<span class="far fa-money-bill-alt paddingrightonly
"></span><div class="trunc
">'.$langs->trans("Payment
").'</div>', 'action' => 'CloseBill();');
1543if (getDolGlobalString('TAKEPOS_DIRECT_PAYMENT')) {
1544 $menus[$r++] = array('title' => '<span class="far fa-money-bill-alt paddingrightonly
"></span><div class="trunc
">'.$langs->trans("DirectPayment
").' <span class="opacitymedium
">('.$langs->trans("Cash
").')</span></div>', 'action' => 'DirectPayment();');
1547$customprinterallowed = false;
1548$customprinttemplateallowed = true;
1550// BAR RESTAURANT specific menu
1551if (getDolGlobalString('TAKEPOS_BAR_RESTAURANT')) {
1552 // Button to print receipt before payment
1553 $customprinterallowed = true;
1554 $customprinttemplateallowed = true;
1557include_once DOL_DOCUMENT_ROOT.'/blockedlog/lib/blockedlog.lib.php';
1558if (isALNERunningVersion()) {
1559 // Custom printer may be allowed if mandatory information in template are guaranteed. For the moment, we prefer not allow this.
1560 $customprinttemplateallowed = false;
1563// Button to print receipt
1564// This section should be same than into invoice.php
1565if (getDolGlobalString('TAKEPOS_PRINT_METHOD') == "takeposconnector
") { // deprecated method
1566 if (getDolGlobalString('TAKEPOS_PRINT_SERVER') && filter_var(getDolGlobalString('TAKEPOS_PRINT_SERVER'), FILTER_VALIDATE_URL) == true) {
1567 // If TAKEPOS_PRINT_SERVER is an URL
1568 $menus[$r++] = array('title' => '<span class="fa fa-receipt paddingrightonly
"></span><div class="trunc
">'.$langs->trans("PrintTicket
").'</div>', 'action' => 'PrintByESCPOSOld(placeid);');
1570 // If TAKEPOS_PRINT_SERVER is an IP
1571 // Print by calling the receipt.php to get HTML content and send the HTML content to TAKEPOS_PRINT_SERVER:8111/print
1572 $menus[$r++] = array('title' => '<span class="fa fa-receipt paddingrightonly
"></span><div class="trunc
">'.$langs->trans("PrintTicket
").'</div>', 'action' => 'PrintHTMLToSlashPrint(placeid);');
1574} elseif ($customprinterallowed && $customprinttemplateallowed && (isModEnabled('receiptprinter') && getDolGlobalInt('TAKEPOS_PRINTER_TO_USE'.$term) > 0) || getDolGlobalString('TAKEPOS_PRINT_METHOD') == "receiptprinter
") { // @phpstan-ignore-line
1575 // Button Print Receipt on special custom printer using custom template
1576 $nameOfPrinter = dol_getIdFromCode($db, getDolGlobalInt('TAKEPOS_PRINTER_TO_USE'.$term), 'printer_receipt', 'rowid', 'name', 1);
1577 $menus[$r++] = array('title' => '<div title="'.dolPrintHTMLForAttribute($langs->trans("PrintOn", $nameOfPrinter)).'"><span class="fa fa-receipt paddingrightonly
"></span><div class="trunc
">'.$langs->trans("PrintTicket
").'</div></div>', 'action' => 'PrintByESCPOS(placeid);');
1579 // Button Print Receipt on browser
1580 $menus[$r++] = array('title' => '<span class="fa fa-receipt paddingrightonly
"></span><div class="trunc
">'.$langs->trans("PrintTicket
").'</div>', 'action' => 'PrintByBrowser(placeid);');
1583if (getDolGlobalString('TAKEPOS_PRINT_METHOD') == "takeposconnector
" && getDolGlobalString('TAKEPOS_ORDER_NOTES') == 1) {
1584 $menus[$r++] = array('title' => '<span class="fa fa-sticky-note paddingrightonly
"></span><div class="trunc
">'.$langs->trans("OrderNotes
").'</div>', 'action' => 'TakeposOrderNotes();');
1588if (getDolGlobalString('TAKEPOS_PRINT_METHOD') == "takeposconnector
") {
1589 $menus[$r++] = array('title' => '<span class="fa fa-receipt paddingrightonly
"></span><div class="trunc
">'.$langs->trans("DOL_OPEN_DRAWER
").'</div>', 'action' => 'OpenDrawer();');
1591if (getDolGlobalInt('TAKEPOS_ADD_BUTTON_OPEN_DRAWER'.$term) > 0) {
1592 $menus[$r++] = array(
1593 'title' => '<span class="fa fa-receipt paddingrightonly
"></span><div class="trunc
">'.$langs->trans("DOL_OPEN_DRAWER
").'</div>',
1594 'action' => 'DolibarrOpenDrawer();',
1598// If there is an open cash control started
1599$sql = "SELECT rowid,
status, entity FROM
".MAIN_DB_PREFIX."pos_cash_fence WHERE
";
1600$sql .= " entity =
".((int) $conf->entity)." AND
";
1601$sql .= " posnumber =
".((int) empty($_SESSION["takeposterminal
"]) ? 0 : $_SESSION["takeposterminal
"])." AND
";
1602$sql .= " date_creation >
'".$db->idate(dol_get_first_hour(dol_now()))."'";
1603$sql .= " AND
status = 0
";
1605$resql = $db->query($sql);
1607 $num = $db->num_rows($resql);
1609 $obj = $db->fetch_object($resql);
1610 $menus[$r++] = array('title' => '<span class="fas fa-file-invoice-dollar paddingrightonly
"></span><div class="trunc
">'.$langs->trans("CashReport
").'</div>', 'action' => 'CashReport('.$obj->rowid.');');
1611 if ($obj->status == 0) {
1612 $menus[$r++] = array('title' => '<span class="fas fa-cash-
register paddingrightonly
"></span><div class="trunc
">'.$langs->trans("CloseCashFence
").'</div>', 'action' => 'CloseCashFence('.$obj->rowid.');');
1617if (getDolGlobalString('TAKEPOS_HIDE_HEAD_BAR')) {
1618 $menus[$r++] = array('title' => '<span class="fa fa-sign-out-alt pictofixedwidth
"></span><div class="trunc
">'.$langs->trans("Logout
").'</div>', 'action' => 'window.location.href=\''.DOL_URL_ROOT.'/user/logout.php?token='.newToken().'\';');
1621if (getDolGlobalString('TAKEPOS_WEIGHING_SCALE')) {
1622 $menus[$r++] = array('title' => '<span class="fa fa-balance-scale pictofixedwidth
"></span><div class="trunc
">'.$langs->trans("WeighingScale
").'</div>', 'action' => 'WeighingScale();');
1625$parameters = array('menus' => $menus);
1626$reshook = $hookmanager->executeHooks('ActionButtons', $parameters);
1627if ($reshook == 0) { //add buttons
1628 if (is_array($hookmanager->resArray)) {
1629 foreach ($hookmanager->resArray as $resArray) {
1630 foreach ($resArray as $butmenu) {
1631 $menus[$r++] = $butmenu;
1635} elseif ($reshook == 1) {
1636 $r = 0; //replace buttons
1637 if (is_array($hookmanager->resArray)) {
1638 foreach ($hookmanager->resArray as $resArray) {
1639 foreach ($resArray as $butmenu) {
1640 $menus[$r++] = $butmenu;
1647 <!-- Show buttons -->
1648 <div id="dialogforpopuptakepos
"></div>
1650 /* Style de la popup */
1651 #dialogforpopuptakepos {
1660 box-shadow: 0 0 10px rgba(0,0,0,0.3);
1662 font-family: sans-serif;
1669 foreach ($menus as $menu) {
1671 if (count($menus) > 12 and $i == 12) {
1672 echo '<button style="'.(empty($menu['style
']) ? '' : $menu['style
']).'" type="button" id="actionnext
" class="actionbutton
" onclick="MoreActions(
'.count($menus).')
">'.$langs->trans("Next
").'</button>';
1673 echo '<button style="display: none;
" type="button" id="actionprevious
" class="actionbutton
" onclick="MoreActions(
'.count($menus).')
">'.$langs->trans("Previous
").'</button>';
1674 echo '<button style="display: none;
" type="button" id="action
'.$i.'" class="actionbutton
" onclick="'.(empty($menu['action
']) ? '' : $menu['action
']).'">'.$menu['title'].'</button>';
1675 } elseif ($i > 12) {
1676 echo '<button style="display: none;
" type="button" id="action
'.$i.'" class="actionbutton
" onclick="'.(empty($menu['action
']) ? '' : $menu['action
']).'">'.$menu['title'].'</button>';
1677 // TODO keep style but hide button
1679 echo '<button style="'.(empty($menu['style
']) ? '' : $menu['style
']).'" type="button" id="action
'.$i.'" class="actionbutton
" onclick="'.(empty($menu['action
']) ? '' : $menu['action
']).'">'.$menu['title'].'</button>';
1683 if (getDolGlobalString('TAKEPOS_HIDE_HEAD_BAR') && !getDolGlobalString('TAKEPOS_HIDE_SEARCH')) {
1684 print '<!-- Show the search input text -->'."\n
";
1685 print '<div class="margintoponly
">';
1686 print '<input type="text
" id="search
" class="input-search-takepos input-nobottom
" name="search
" onkeyup="Search2(\
''.
dol_escape_js($keyCodeForEnter).
'\',
null);
" style="width: 80%; width:calc(100% - 51px); font-size: 150%;
" placeholder="'.dol_escape_htmltag($langs->trans("Search")).'" autofocus> ';
1687 print '<a class="marginleftonly hideonsmartphone
" onclick="ClearSearch(
false);
">'.img_picto('', 'searchclear.png').'</a>';
1698 <!-- Show categories -->
1700 if (getDolGlobalInt('TAKEPOS_HIDE_CATEGORIES') == 1) {
1701 print '<div class="div4
" style= "display: none;
">';
1703 print '<div class="div4
">';
1707 while ($count < $MAXCATEG) {
1709 <div class="wrapper
" <?php if ($count == ($MAXCATEG - 2)) {
1710 echo 'onclick="MoreCategories(\
'less\')"';
1711 } elseif ($count == ($MAXCATEG - 1)) {
1712 echo
'onclick="MoreCategories(\'more\')"';
1714 echo
'onclick="LoadProducts('.$count.
')"';
1715 } ?>
id=
"catdiv<?php echo $count; ?>">
1717 if ($count == ($MAXCATEG - 2)) {
1719 echo
'<span class="fa fa-chevron-left centerinmiddle" style="font-size: 5em; cursor: pointer;"></span>';
1720 } elseif ($count == ($MAXCATEG - 1)) {
1722 echo
'<span class="fa fa-chevron-right centerinmiddle" style="font-size: 5em; cursor: pointer;"></span>';
1725 echo
'<img class="imgwrapper" id="catimg'.$count.
'" />';
1728 <?php
if ($count != $MAXCATEG - 2 && $count != $MAXCATEG - 1) { ?>
1729 <div
class=
"description" id=
"catdivdesc<?php echo $count; ?>">
1730 <div
class=
"description_content" id=
"catdesc<?php echo $count; ?>"></div>
1733 <div
class=
"catwatermark" id=
'catwatermark<?php echo $count; ?>'>...</div>
1741 <!-- Show product -->
1742 <div
class=
"div5<?php if (getDolGlobalInt('TAKEPOS_HIDE_CATEGORIES') == 1) {
1743 print ' centpercent';
1748 while ($count < $MAXPRODUCT) {
1749 print
'<div class="wrapper2'.(($count >= ($MAXPRODUCT - 2)) ?
' arrow' :
'').
'" id="prodiv'.$count.
'" '; ?>
1750 <?php
if ($count == ($MAXPRODUCT - 2)) {
1751 ?> onclick=
"MoreProducts('less')" <?php
1753 if ($count == ($MAXPRODUCT - 1)) {
1754 ?> onclick=
"MoreProducts('more')" <?php
1756 echo
'onclick="ClickProduct('.((int) $count).
')"';
1759 if ($count == ($MAXPRODUCT - 2)) {
1761 print
'<span class="fa fa-chevron-left centerinmiddle" style="font-size: 5em; cursor: pointer;"></span>';
1762 } elseif ($count == ($MAXPRODUCT - 1)) {
1764 print
'<span class="fa fa-chevron-right centerinmiddle" style="font-size: 5em; cursor: pointer;"></span>';
1767 print
'<div class="" id="proprice'.$count.
'"></div>';
1770 print
'<button type="button" id="probutton'.$count.
'" class="productbutton" style="display: none;"></button>';
1772 print
'<img class="imgwrapper" title="" id="proimg'.$count.
'">';
1775 <?php
if ($count != $MAXPRODUCT - 2 && $count != $MAXPRODUCT - 1 && !
getDolGlobalString(
'TAKEPOS_HIDE_PRODUCT_IMAGES')) { ?>
1776 <div
class=
"description" id=
"prodivdesc<?php echo $count; ?>">
1777 <div
class=
"description_content" id=
"prodesc<?php echo $count; ?>"></div>
1780 <div
class=
"catwatermark" id=
'prowatermark<?php echo $count; ?>'>...</div>
1786 <input
type=
"hidden" id=
"search_start_less" value=
"0">
1787 <input
type=
"hidden" id=
"search_start_more" value=
"0">
1788 <input
type=
"hidden" id=
"search_pagination" value=
"">
while( $i< $imaxinloop)
The main.inc.php has been included so the following variable are now defined:
llxFooter($comment='', $zone='private', $disabledoutputofmessages=0)
Empty footer.
Class to manage categories.
print $langs trans("Ref").' m titre as m m statut as status
Or an array listing all the potential status of the object: array: int of the status => translated la...
dol_get_first_hour($date, $gm='tzserver')
Return GMT time for first hour of a given GMT date (it removes hours, min and second part)
dol_now($mode='gmt')
Return date for now.
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.
dolSetCookie(string $cookiename, string $cookievalue, int $expire=-1)
Set a cookie.
getDolGlobalInt($key, $default=0)
Return a Dolibarr global constant int value.
dol_escape_js($stringtoescape, $mode=0, $noescapebackslashn=0)
Returns text escaped for inclusion into JavaScript code.
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'.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0, $nodefault=0)
Return value of a param into GET or POST supervariable.
GETPOSTINT($paramname, $method=0, $nodefault=0)
Return the value of a $_GET or $_POST supervariable, converted into integer.
dol_buildpath($path, $type=0, $returnemptyifnotfound=0)
Return path of url or filesystem.
getDolGlobalString($key, $default='')
Return a Dolibarr global constant string value.
isModEnabled($module)
Is Dolibarr module enabled.
multi select button
0 = Do not include form tag and submit button -1 = Do not include form tag but include submit button
top_htmlhead($head, $title='', $disablejs=0, $disablehead=0, $arrayofjs=array(), $arrayofcss=array(), $disableforlogin=0, $disablenofollow=0, $disablenoindex=0)
Output html header of a page.
top_menu_user($hideloginname=0, $urllogout='')
Build the tooltip on user login.
if(preg_match('/(crypted|dolcrypt):/i', $dolibarr_main_db_pass)||!empty($dolibarr_main_db_encrypted_pass)) $conf db type
'integer', 'integer:ObjectClass:PathToClass[:AddCreateButtonOrNot[:Filter[:Sortfield]]]',...
$conf db name
Only used if Module[ID]Name translation string is not found.
restrictedArea(User $user, $features, $object=0, $tableandshare='', $feature2='', $dbt_keyfield='fk_soc', $dbt_select='rowid', $isdraft=0, $nodie=0, $mode='')
Check permissions of a user to show a page and an object.