30 if (!defined(
'NOCSRFCHECK')) define(
'NOCSRFCHECK',
'1');
31 if (!defined(
'NOTOKENRENEWAL')) define(
'NOTOKENRENEWAL',
'1');
32 if (!defined(
'NOREQUIREMENU')) define(
'NOREQUIREMENU',
'1');
33 if (!defined(
'NOREQUIREHTML')) define(
'NOREQUIREHTML',
'1');
34 if (!defined(
'NOREQUIREAJAX')) define(
'NOREQUIREAJAX',
'1');
36 require
'../main.inc.php';
37 require_once DOL_DOCUMENT_ROOT.
'/core/class/html.form.class.php';
38 require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formother.class.php';
39 require_once DOL_DOCUMENT_ROOT.
'/societe/class/societe.class.php';
40 require_once DOL_DOCUMENT_ROOT.
'/categories/class/categorie.class.php';
41 require_once DOL_DOCUMENT_ROOT.
'/compta/facture/class/facture.class.php';
42 require_once DOL_DOCUMENT_ROOT.
'/core/class/hookmanager.class.php';
43 require_once DOL_DOCUMENT_ROOT.
'/core/lib/date.lib.php';
45 $place = (
GETPOST(
'place',
'aZ09') ?
GETPOST(
'place',
'aZ09') : 0);
46 $action =
GETPOST(
'action',
'aZ09');
47 $setterminal =
GETPOST(
'setterminal',
'int');
48 $setcurrency =
GETPOST(
'setcurrency',
'aZ09');
50 if ($_SESSION[
"takeposterminal"] ==
"")
52 if ($conf->global->TAKEPOS_NUM_TERMINALS ==
"1") $_SESSION[
"takeposterminal"] = 1;
53 elseif (!empty($_COOKIE[
"takeposterminal"])) $_SESSION["takeposterminal"] = preg_replace('/[^a-zA-Z0-9_\-]/', '', $_COOKIE["takeposterminal"]);
58 $_SESSION[
"takeposterminal"] = $setterminal;
59 setcookie(
"takeposterminal", $setterminal, (time() + (86400 * 354)),
'/', null,
false,
true);
62 if ($setcurrency !=
"")
64 $_SESSION[
"takeposcustomercurrency"] = $setcurrency;
67 $_SESSION[
"urlfrom"] =
'/takepos/index.php';
69 $langs->loadLangs(array(
"bills",
"orders",
"commercial",
"cashdesk",
"receiptprinter",
"banks"));
73 $maxcategbydefaultforthisdevice = 12;
74 $maxproductbydefaultforthisdevice = 24;
75 if ($conf->browser->layout ==
'phone')
77 $maxcategbydefaultforthisdevice = 8;
78 $maxproductbydefaultforthisdevice = 16;
80 if ($_SESSION[
"takeposterminal"] !=
"" && $conf->global->TAKEPOS_PHONE_BASIC_LAYOUT == 1)
82 $_SESSION[
"basiclayout"] = 1;
83 header(
"Location: phone.php?mobilepage=invoice");
87 $MAXCATEG = (empty($conf->global->TAKEPOS_NB_MAXCATEG) ? $maxcategbydefaultforthisdevice : $conf->global->TAKEPOS_NB_MAXCATEG);
88 $MAXPRODUCT = (empty($conf->global->TAKEPOS_NB_MAXPRODUCT) ? $maxproductbydefaultforthisdevice : $conf->global->TAKEPOS_NB_MAXPRODUCT);
106 $form =
new Form($db);
109 $title =
'TakePOS - Dolibarr '.DOL_VERSION;
110 if (!empty($conf->global->MAIN_APPLICATION_TITLE)) $title =
'TakePOS - '.$conf->global->MAIN_APPLICATION_TITLE;
111 $head =
'<meta name="apple-mobile-web-app-title" content="TakePOS"/>
112 <meta name="apple-mobile-web-app-capable" content="yes">
113 <meta name="mobile-web-app-capable" content="yes">
114 <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"/>';
115 top_htmlhead($head, $title, $disablejs, $disablehead, $arrayofjs, $arrayofcss);
118 <link rel=
"stylesheet" href=
"css/pos.css.php">
119 <link rel=
"stylesheet" href=
"css/colorbox.css" type=
"text/css" media=
"screen" />
121 if ($conf->global->TAKEPOS_COLOR_THEME == 1)
print '<link rel="stylesheet" href="css/colorful.css">';
123 <script
type=
"text/javascript" src=
"js/jquery.colorbox-min.js"></script> <!-- TODO It seems we don
't need this -->
124 <script language="javascript">
126 $categories = $categorie->get_full_arbo('product
', (($conf->global->TAKEPOS_ROOT_CATEGORY_ID > 0) ? $conf->global->TAKEPOS_ROOT_CATEGORY_ID : 0), 1);
129 // Search root category to know its level
130 //$conf->global->TAKEPOS_ROOT_CATEGORY_ID=0;
131 $levelofrootcategory = 0;
132 if ($conf->global->TAKEPOS_ROOT_CATEGORY_ID > 0)
134 foreach ($categories as $key => $categorycursor)
136 if ($categorycursor['id'] == $conf->global->TAKEPOS_ROOT_CATEGORY_ID)
138 $levelofrootcategory = $categorycursor['level
'];
144 $levelofmaincategories = $levelofrootcategory + 1;
146 $maincategories = array();
147 $subcategories = array();
148 foreach ($categories as $key => $categorycursor)
150 if ($categorycursor['level
'] == $levelofmaincategories)
152 $maincategories[$key] = $categorycursor;
154 $subcategories[$key] = $categorycursor;
158 $maincategories = dol_sort_array($maincategories, 'label
');
159 $subcategories = dol_sort_array($subcategories, 'label
');
162 var categories = <?php echo json_encode($maincategories); ?>;
163 var subcategories = <?php echo json_encode($subcategories); ?>;
167 var pagecategories=0;
169 var place="<?php echo $place; ?>";
170 var editaction="qty";
176 app.hasKeyboard = false;
177 this.keyboardPress = function() {
178 app.hasKeyboard = true;
179 $(window).unbind("keyup", app.keyboardPress);
180 localStorage.hasKeyboard = true;
181 console.log("has keyboard!")
183 $(window).on("keyup", app.keyboardPress)
184 if(localStorage.hasKeyboard) {
185 app.hasKeyboard = true;
186 $(window).unbind("keyup", app.keyboardPress);
187 console.log("has keyboard from localStorage")
191 function ClearSearch() {
192 console.log("ClearSearch");
193 $("#search").val('');
194 <?php if ($conf->browser->layout == 'classic
') { ?>
195 setFocusOnSearchField();
199 // Set the focus on search field but only on desktop. On tablet or smartphone, we don't to avoid to have the keyboard open automatically
200 function setFocusOnSearchField() {
201 console.log(
"Call setFocusOnSearchField in page index.php");
202 <?php
if ($conf->browser->layout ==
'classic') { ?>
203 console.log(
"has keyboard from localStorage, so we can force focus on search field");
204 $(
"#search").focus();
208 function PrintCategories(first) {
209 console.log(
"PrintCategories");
210 for (i = 0; i < <?php echo ($MAXCATEG - 2); ?>; i++) {
211 if (typeof (categories[parseInt(i)+parseInt(first)]) ==
"undefined")
213 $(
"#catdivdesc"+i).hide();
214 $(
"#catdesc"+i).text(
"");
215 $(
"#catimg"+i).attr(
"src",
"genimg/empty.png");
216 $(
"#catwatermark"+i).hide();
217 $(
"#catdiv"+i).attr(
'class',
'wrapper divempty');
220 $(
"#catdivdesc"+i).show();
221 $(
"#catdesc"+i).text(categories[parseInt(i)+parseInt(first)][
'label']);
222 $(
"#catimg"+i).attr(
"src",
"genimg/index.php?query=cat&id="+categories[parseInt(i)+parseInt(first)][
'rowid']);
223 $(
"#catdiv"+i).data(
"rowid",categories[parseInt(i)+parseInt(first)][
'rowid']);
224 $(
"#catdiv"+i).attr(
'class',
'wrapper');
225 $(
"#catwatermark"+i).show();
229 function MoreCategories(moreorless) {
230 console.log(
"MoreCategories moreorless="+moreorless+
" pagecategories="+pagecategories);
231 if (moreorless==
"more") {
232 $(
'#catimg15').animate({opacity:
'0.5'}, 1);
233 $(
'#catimg15').animate({opacity:
'1'}, 100);
234 pagecategories=pagecategories+1;
236 if (moreorless==
"less") {
237 $(
'#catimg14').animate({opacity:
'0.5'}, 1);
238 $(
'#catimg14').animate({opacity:
'1'}, 100);
239 if (pagecategories==0)
return;
240 pagecategories=pagecategories-1;
242 if (typeof (categories[<?php echo ($MAXCATEG - 2); ?> * pagecategories] && moreorless==
"more") ==
"undefined"){
243 pagecategories=pagecategories-1;
246 for (i = 0; i < <?php echo ($MAXCATEG - 2); ?>; i++) {
247 if (typeof (categories[i+(<?php echo ($MAXCATEG - 2); ?> * pagecategories)]) ==
"undefined") {
248 $(
"#catdivdesc"+i).hide();
249 $(
"#catdesc"+i).text(
"");
250 $(
"#catimg"+i).attr(
"src",
"genimg/empty.png");
251 $(
"#catwatermark"+i).hide();
254 $(
"#catdivdesc"+i).show();
255 $(
"#catdesc"+i).text(categories[i+(<?php echo ($MAXCATEG - 2); ?> * pagecategories)][
'label']);
256 $(
"#catimg"+i).attr(
"src",
"genimg/index.php?query=cat&id="+categories[i+(<?php echo ($MAXCATEG - 2); ?> * pagecategories)][
'rowid']);
257 $(
"#catdiv"+i).data(
"rowid",categories[i+(<?php echo ($MAXCATEG - 2); ?> * pagecategories)][
'rowid']);
258 $(
"#catwatermark"+i).show();
265 function LoadProducts(position, issubcat) {
266 console.log(
"LoadProducts");
267 var maxproduct = <?php echo ($MAXPRODUCT - 2); ?>;
269 if (position==
"supplements") currentcat=
"supplements";
272 $(
'#catimg'+position).animate({opacity:
'0.5'}, 1);
273 $(
'#catimg'+position).animate({opacity:
'1'}, 100);
274 if (issubcat==
true) currentcat=$(
'#prodiv'+position).data(
'rowid');
275 else currentcat=$(
'#catdiv'+position).data(
'rowid');
277 if (currentcat == undefined)
return;
281 jQuery.each(subcategories,
function(i, val) {
282 if (currentcat==val.fk_parent) {
283 $(
"#prodivdesc"+ishow).show();
284 $(
"#prodesc"+ishow).text(val.label);
285 $(
"#proprice"+ishow).attr(
"class",
"hidden");
286 $(
"#proprice"+ishow).html(
"");
287 $(
"#proimg"+ishow).attr(
"src",
"genimg/index.php?query=cat&id="+val.rowid);
288 $(
"#prodiv"+ishow).data(
"rowid",val.rowid);
289 $(
"#prodiv"+ishow).data(
"iscat",1);
290 $(
"#prowatermark"+ishow).show();
296 $.getJSON(
'<?php echo DOL_URL_ROOT ?>/takepos/ajax/ajax.php?action=getProducts&category='+currentcat,
function(data) {
297 console.log(
"Call ajax.php (in LoadProducts) to get Products of category "+currentcat+
" then loop on result to fill image thumbs");
299 while (ishow < maxproduct) {
301 console.log(data[idata]);
302 if (typeof (data[idata]) ==
"undefined") {
303 <?php
if (!$conf->global->TAKEPOS_HIDE_PRODUCT_IMAGES)
305 echo
'$("#prodivdesc"+ishow).hide();';
306 echo
'$("#prodesc"+ishow).text("");';
307 echo
'$("#proimg"+ishow).attr("title","");';
308 echo
'$("#proimg"+ishow).attr("src","genimg/empty.png");';
310 echo
'$("#probutton"+ishow).hide();';
311 echo
'$("#probutton"+ishow).text("");';
313 $(
"#proprice"+ishow).attr(
"class",
"hidden");
314 $(
"#proprice"+ishow).html(
"");
315 $(
"#prodiv"+ishow).data(
"rowid",
"");
316 $(
"#prodiv"+ishow).attr(
"class",
"wrapper2 divempty");
317 $(
"#prowatermark"+ishow).hide();
320 else if ((data[idata][
'status']) ==
"1") {
322 $titlestring =
"'".dol_escape_js($langs->transnoentities(
'Ref').
': ').
"' + data[idata]['ref']";
323 $titlestring .=
" + ' - ".dol_escape_js($langs->trans(
"Barcode").
': ').
"' + data[idata]['barcode']";
325 var titlestring = <?php echo $titlestring; ?>;
326 <?php
if (!$conf->global->TAKEPOS_HIDE_PRODUCT_IMAGES)
328 echo
'$("#prodivdesc"+ishow).show();';
329 echo
'$("#prodesc"+ishow).text(data[parseInt(idata)][\'label\']);';
330 echo
'$("#proimg"+ishow).attr("title", titlestring);';
331 echo
'$("#proimg"+ishow).attr("src", "genimg/index.php?query=pro&id="+data[idata][\'id\']);';
334 echo
'$("#probutton"+ishow).show();';
335 echo
'$("#probutton"+ishow).text(data[parseInt(idata)][\'label\']);';
338 if (data[parseInt(idata)][
'price_formated']) {
339 $(
"#proprice"+ishow).attr(
"class",
"productprice");
340 $(
"#proprice"+ishow).html(data[parseInt(idata)][
'price_formated']);
342 $(
"#prodiv"+ishow).data(
"rowid", data[idata][
'id']);
343 $(
"#prodiv"+ishow).data(
"iscat", 0);
344 $(
"#prodiv"+ishow).attr(
"class",
"wrapper2");
345 $(
"#prowatermark"+ishow).hide();
356 function MoreProducts(moreorless) {
357 console.log(
"MoreProducts");
358 var maxproduct = <?php echo ($MAXPRODUCT - 2); ?>;
360 if (moreorless==
"more"){
361 $(
'#proimg31').animate({opacity:
'0.5'}, 1);
362 $(
'#proimg31').animate({opacity:
'1'}, 100);
363 pageproducts=pageproducts+1;
365 if (moreorless==
"less"){
366 $(
'#proimg30').animate({opacity:
'0.5'}, 1);
367 $(
'#proimg30').animate({opacity:
'1'}, 100);
368 if (pageproducts==0)
return;
369 pageproducts=pageproducts-1;
371 $.getJSON(
'<?php echo DOL_URL_ROOT ?>/takepos/ajax/ajax.php?action=getProducts&category='+currentcat,
function(data) {
372 console.log(
"Call ajax.php (in MoreProducts) to get Products of category "+currentcat);
374 if (typeof (data[(maxproduct * pageproducts)]) ==
"undefined" && moreorless==
"more"){
375 pageproducts=pageproducts-1;
378 idata=<?php echo ($MAXPRODUCT - 2); ?> * pageproducts;
381 while (ishow < maxproduct) {
382 if (typeof (data[idata]) ==
"undefined") {
383 $(
"#prodivdesc"+ishow).hide();
384 $(
"#prodesc"+ishow).text(
"");
385 $(
"#proprice"+ishow).attr(
"class",
"");
386 $(
"#proprice"+ishow).html(
"");
387 $(
"#proimg"+ishow).attr(
"src",
"genimg/empty.png");
388 $(
"#prodiv"+ishow).data(
"rowid",
"");
391 else if ((data[idata][
'status']) ==
"1") {
393 $(
"#prodivdesc"+ishow).show();
394 $(
"#prodesc"+ishow).text(data[parseInt(idata)][
'label']);
395 if (data[parseInt(idata)][
'price_formated']) {
396 $(
"#proprice"+ishow).attr(
"class",
"productprice");
397 $(
"#proprice"+ishow).html(data[parseInt(idata)][
'price_formated']);
399 $(
"#proimg"+ishow).attr(
"src",
"genimg/index.php?query=pro&id="+data[idata][
'id']);
400 $(
"#prodiv"+ishow).data(
"rowid",data[idata][
'id']);
401 $(
"#prodiv"+ishow).data(
"iscat",0);
404 $(
"#prowatermark"+ishow).hide();
412 function ClickProduct(position) {
413 console.log(
"ClickProduct");
414 $(
'#proimg'+position).animate({opacity:
'0.5'}, 1);
415 $(
'#proimg'+position).animate({opacity:
'1'}, 100);
416 if ($(
'#prodiv'+position).data(
'iscat')==1){
417 console.log(
"Click on a category at position "+position);
418 LoadProducts(position,
true);
421 idproduct=$(
'#prodiv'+position).data(
'rowid');
422 console.log(
"Click on product at position "+position+
" for idproduct "+idproduct);
423 if (idproduct==
"")
return;
425 $(
"#poslines").load(
"invoice.php?action=addline&place="+place+
"&idproduct="+idproduct+
"&selectedline="+selectedline,
function() {
433 function ChangeThirdparty(idcustomer) {
434 console.log(
"ChangeThirdparty");
436 $(
"#poslines").load(
"../societe/list.php?action=change&type=t&contextpage=poslist&idcustomer="+idcustomer+
"&place="+place+
"",
function() {
442 function deleteline() {
443 console.log(
"Delete line");
444 $(
"#poslines").load(
"invoice.php?action=deleteline&token=<?php echo newToken(); ?>&place="+place+
"&idline="+selectedline,
function() {
450 function Customer() {
451 console.log(
"Open box to select the thirdparty place="+place);
452 $.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
"); ?>"});
457 console.log(
"Open box to select the history");
458 $.colorbox({href:
"../compta/facture/list.php?contextpage=poslist", width:
"90%", height:
"80%", transition:
"none", iframe:
"true", title:
"<?php echo $langs->trans("History
"); ?>"});
461 function Reduction() {
462 invoiceid = $(
"#invoiceid").val();
463 console.log(
"Open popup to enter reduction on invoiceid="+invoiceid);
464 $.colorbox({href:
"reduction.php?place="+place+
"&invoiceid="+invoiceid, width:
"80%", height:
"90%", transition:
"none", iframe:
"true", title:
""});
467 function CloseBill() {
468 invoiceid = $(
"#invoiceid").val();
469 console.log(
"Open popup to enter payment on invoiceid="+invoiceid);
470 $.colorbox({href:
"pay.php?place="+place+
"&invoiceid="+invoiceid, width:
"80%", height:
"90%", transition:
"none", iframe:
"true", title:
""});
474 console.log(
"Open box to select floor place="+place);
475 $.colorbox({href:
"floors.php?place="+place, width:
"90%", height:
"90%", transition:
"none", iframe:
"true", title:
"<?php echo $langs->trans("Floors
"); ?>"});
478 function FreeZone() {
479 console.log(
"Open box to enter a free product");
480 $.colorbox({href:
"freezone.php?action=freezone&place="+place, onClosed:
function () { Refresh(); },width:
"80%", height:
"200px", transition:
"none", iframe:
"true", title:
"<?php echo $langs->trans("FreeZone
"); ?>"});
483 function TakeposOrderNotes() {
484 console.log(
"Open box to order notes");
485 $.colorbox({href:
"freezone.php?action=addnote&place="+place+
"&idline="+selectedline, onClosed:
function () { Refresh(); },width:
"80%", height:
"250px", transition:
"none", iframe:
"true", title:
"<?php echo $langs->trans("OrderNotes
"); ?>"});
489 console.log(
"Refresh by reloading place="+place+
" invoiceid="+invoiceid);
490 $(
"#poslines").load(
"invoice.php?place="+place+
"&invoiceid="+invoiceid,
function() {
497 invoiceid = $(
"#invoiceid").val();
499 console.log(
"New with place = <?php echo $place; ?>, js place="+place+
", invoiceid="+invoiceid);
501 $.getJSON(
'<?php echo DOL_URL_ROOT ?>/takepos/ajax/ajax.php?action=getInvoice&id='+invoiceid,
function(data) {
504 if (parseInt(data[
'paye']) === 1) {
507 r = confirm(
'<?php echo ($place > 0 ? $langs->transnoentitiesnoconv("ConfirmDeletionOfThisPOSSale") : $langs->transnoentitiesnoconv("ConfirmDiscardOfThisPOSSale")); ?>');
512 $(
"#poslines").load(
"invoice.php?action=delete&token=<?php echo newToken(); ?>&place=" + place,
function () {
526 function Search2(keyCodeForEnter) {
527 console.log(
"Search2 Call ajax search to replace products keyCodeForEnter="+keyCodeForEnter);
530 var eventKeyCode = window.event.keyCode;
531 if (typeof keyCodeForEnter ===
'undefined' || eventKeyCode == keyCodeForEnter) {
535 if (search ===
true) {
537 jQuery(
".wrapper2 .catwatermark").hide();
538 $.getJSON(
'<?php echo DOL_URL_ROOT ?>/takepos/ajax/ajax.php?action=search&term=' + $(
'#search').val(),
function (data) {
539 for (i = 0; i < <?php echo $MAXPRODUCT ?>; i++) {
540 if (typeof (data[i]) ==
"undefined") {
541 $(
"#prodesc" + i).text(
"");
542 $(
"#proprice" + i).attr(
"class",
"hidden");
543 $(
"#proprice" + i).html(
"");
544 $(
"#proimg" + i).attr(
"src",
"genimg/empty.png");
545 $(
"#prodiv" + i).data(
"rowid",
"");
549 $titlestring =
"'".dol_escape_js($langs->transnoentities(
'Ref').
': ').
"' + data[i]['ref']";
550 $titlestring .=
" + ' - ".dol_escape_js($langs->trans(
"Barcode").
': ').
"' + data[i]['barcode']";
552 var titlestring = <?php echo $titlestring; ?>;
553 $(
"#prodesc" + i).text(data[i][
'label']);
554 $(
"#prodivdesc" + i).show();
555 if (data[i][
'price_formated']) {
556 $(
"#proprice" + i).attr(
"class",
"productprice");
557 $(
"#proprice" + i).html(data[i][
'price_formated']);
559 $(
"#proimg" + i).attr(
"title", titlestring);
560 $(
"#proimg" + i).attr(
"src",
"genimg/index.php?query=pro&id=" + data[i][
'rowid']);
561 $(
"#prodiv" + i).data(
"rowid", data[i][
'rowid']);
562 $(
"#prodiv" + i).data(
"iscat", 0);
564 }).always(
function (data) {
566 if ($(
'#search').val().length > 0 && data.length == 1) {
567 console.log($(
'#search').val()+
' - '+data[0][
'barcode']);
568 if ($(
'#search').val() == data[0][
'barcode'] &&
'thirdparty' == data[0][
'object']) {
569 console.log(
"There is only 1 answer with barcode matching the search, so we change the thirdparty "+data[0][
'rowid']);
570 ChangeThirdparty(data[0][
'rowid']);
572 else if ($(
'#search').val() == data[0][
'barcode'] &&
'product' == data[0][
'object']) {
573 console.log(
"There is only 1 answer with barcode matching the search, so we add the product in basket");
577 if (eventKeyCode == keyCodeForEnter){
578 if (data.length == 0) {
579 $(
'#search').val(
'<?php
580 $langs->load('errors
');
581 echo dol_escape_js($langs->trans("ErrorRecordNotFound"));
583 $(
'#search').select();
592 function Edit(number) {
594 if (typeof(selectedtext) ==
"undefined")
return;
596 var text=selectedtext+
"<br> ";
603 else if (number==
'qty'){
604 console.log(
"Edit "+number);
605 if (editaction==
'qty' && editnumber!=
""){
606 $(
"#poslines").load(
"invoice.php?action=updateqty&place="+place+
"&idline="+selectedline+
"&number="+editnumber,
function() {
609 $(
"#qty").html(
"<?php echo $langs->trans("Qty
"); ?>");
612 setFocusOnSearchField();
619 else if (number==
'p'){
620 console.log(
"Edit "+number);
621 if (editaction==
'p' && editnumber!=
""){
622 $(
"#poslines").load(
"invoice.php?action=updateprice&place="+place+
"&idline="+selectedline+
"&number="+editnumber,
function() {
625 $(
"#price").html(
"<?php echo $langs->trans("Price
"); ?>");
635 else if (number==
'r'){
636 console.log(
"Edit "+number);
637 if (editaction==
'r' && editnumber!=
""){
638 $(
"#poslines").load(
"invoice.php?action=updatereduction&place="+place+
"&idline="+selectedline+
"&number="+editnumber,
function() {
641 $(
"#reduction").html(
"<?php echo $langs->trans("ReductionShort
"); ?>");
652 editnumber=editnumber+number;
654 if (editaction==
'qty'){
655 text=text+
"<?php echo $langs->trans("Modify
")." ->
".$langs->trans("Qty
").":
"; ?>";
656 $(
"#qty").html(
"OK");
657 $(
"#price").html(
"<?php echo $langs->trans("Price
"); ?>");
658 $(
"#reduction").html(
"<?php echo $langs->trans("ReductionShort
"); ?>");
660 if (editaction==
'p'){
661 text=text+
"<?php echo $langs->trans("Modify
")." ->
".$langs->trans("Price
").":
"; ?>";
662 $(
"#qty").html(
"<?php echo $langs->trans("Qty
"); ?>");
663 $(
"#price").html(
"OK");
664 $(
"#reduction").html(
"<?php echo $langs->trans("ReductionShort
"); ?>");
666 if (editaction==
'r'){
667 text=text+
"<?php echo $langs->trans("Modify
")." ->
".$langs->trans("ReductionShort
").":
"; ?>";
668 $(
"#qty").html(
"<?php echo $langs->trans("Qty
"); ?>");
669 $(
"#price").html(
"<?php echo $langs->trans("Price
"); ?>");
670 $(
"#reduction").html(
"OK");
672 $(
'#'+selectedline).find(
"td:first").html(text+editnumber);
675 function TakeposPrintingOrder(){
676 console.log(
"TakeposPrintingOrder");
677 $(
"#poslines").load(
"invoice.php?action=order&place="+place,
function() {
682 function TakeposPrintingTemp(){
683 console.log(
"TakeposPrintingTemp");
684 $(
"#poslines").load(
"invoice.php?action=temp&place="+place,
function() {
689 function OpenDrawer(){
690 console.log(
"OpenDrawer call ajax url http://<?php print $conf->global->TAKEPOS_PRINT_SERVER; ?>:8111/print");
694 if (filter_var($conf->global->TAKEPOS_PRINT_SERVER, FILTER_VALIDATE_URL) ==
true) echo
"url: '".$conf->global->TAKEPOS_PRINT_SERVER.
"/printer/drawer.php',";
695 else echo
"url: 'http://".$conf->global->TAKEPOS_PRINT_SERVER.
":8111/print',";
701 function DolibarrOpenDrawer() {
702 console.log(
"DolibarrOpenDrawer call ajax url /takepos/ajax/ajax.php?action=opendrawer&term=<?php print $_SESSION["takeposterminal
"] ?>");
705 url:
"<?php print dol_buildpath('/takepos/ajax/ajax.php', 1).'?action=opendrawer&term='.$_SESSION["takeposterminal
"]; ?>",
709 function MoreActions(totalactions){
712 for (i = 0; i <= totalactions; i++){
713 if (i<12) $(
"#action"+i).hide();
714 else $(
"#action"+i).show();
717 else if (pageactions==1){
719 for (i = 0; i <= totalactions; i++){
720 if (i<12) $(
"#action"+i).show();
721 else $(
"#action"+i).hide();
726 function ControlCashOpening()
728 $.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
"); ?>"});
731 function CloseCashFence(
rowid)
733 $.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
"); ?>"});
736 function CashReport(
rowid)
738 $.colorbox({href:
"../compta/cashcontrol/report.php?id="+
rowid+
"&contextpage=takepos", width:
"60%", height:
"90%", transition:
"none", iframe:
"true", title:
"<?php echo $langs->trans("CashReport
"); ?>"});
742 function ModalBox(ModalID)
744 var modal = document.getElementById(ModalID);
745 modal.style.display =
"block";
748 function DirectPayment(){
749 console.log(
"DirectPayment");
750 $(
"#poslines").load(
"invoice.php?place="+place+
"&action=valid&pay=<?php echo $langs->trans("cash
"); ?>",
function() {
754 function FullScreen() {
755 document.documentElement.requestFullscreen();
758 function WeighingScale(){
759 console.log(
"Weighing Scale");
762 url:
'<?php print $conf->global->TAKEPOS_PRINT_SERVER; ?>/scale/index.php',
764 .done(
function( editnumber ) {
765 $(
"#poslines").load(
"invoice.php?action=updateqty&place="+place+
"&idline="+selectedline+
"&number="+editnumber,
function() {
771 $( document ).ready(
function() {
777 if ($_SESSION[
"takeposterminal"] ==
"")
779 print "ModalBox('ModalTerminal');";
781 if ($conf->global->TAKEPOS_CONTROL_CASH_OPENING) {
782 $sql =
"SELECT rowid, status FROM ".MAIN_DB_PREFIX.
"pos_cash_fence WHERE";
783 $sql .=
" entity = ".$conf->entity.
" AND ";
785 $resql = $db->query($sql);
787 $obj = $db->fetch_object(
$resql);
789 if ($obj->rowid == null)
print "ControlCashOpening();";
796 <body
class=
"bodytakepos" style=
"overflow: hidden;">
798 $keyCodeForEnter = $conf->global->{
'CASHDESK_READER_KEYCODE_FOR_ENTER'.$_SESSION[
'takeposterminal']} > 0 ? $conf->global->{
'CASHDESK_READER_KEYCODE_FOR_ENTER'.$_SESSION[
'takeposterminal']} :
'';
800 <div
class=
"container">
803 if (empty($conf->global->TAKEPOS_HIDE_HEAD_BAR)) {
807 <div
class=
"topnav-left">
808 <div
class=
"inline-block valignmiddle">
809 <a
class=
"topnav-terminalhour" onclick=
"ModalBox('ModalTerminal');">
810 <span
class=
"fa fa-cash-register"></span>
811 <span
class=
"hideonsmartphone">
812 <?php echo $langs->trans(
"Terminal"); ?>
815 if ($_SESSION[
"takeposterminal"] ==
"") echo
"1";
816 else echo $_SESSION[
"takeposterminal"];
817 echo
'<span class="hideonsmartphone"> - '.dol_print_date(
dol_now(),
"day").
'</span>';
821 if (!empty($conf->multicurrency->enabled)) {
822 print '<a class="valignmiddle tdoverflowmax100" id="multicurrency" onclick="ModalBox(\'ModalCurrency\');" title=""><span class="fas fa-coins paddingrightonly"></span>';
823 print '<span class="hideonsmartphone">'.$langs->trans(
"Currency").
'</span>';
828 <!-- section
for customer and open sales -->
829 <div
class=
"inline-block valignmiddle" id=
"customerandsales">
831 <!-- More info about customer -->
832 <div
class=
"inline-block valignmiddle tdoverflowmax150onsmartphone" id=
"moreinfo"></div>
833 <div
class=
"inline-block valignmiddle tdoverflowmax150onsmartphone" id=
"infowarehouse"></div>
835 <div
class=
"topnav-right">
836 <div
class=
"login_block_other">
837 <input type=
"text" id=
"search" name=
"search" onkeyup=
"Search2(<?php echo $keyCodeForEnter; ?>);" placeholder=
"<?php echo $langs->trans("Search
"); ?>" autofocus>
838 <a onclick=
"ClearSearch();"><span
class=
"fa fa-backspace"></span></a>
839 <a onclick=
"window.location.href='<?php echo DOL_URL_ROOT.'/'; ?>';"><span
class=
"fas fa-home"></span></a>
840 <?php
if (empty($conf->dol_use_jmobile)) { ?>
841 <a
class=
"hideonsmartphone" onclick=
"FullScreen();"><span
class=
"fa fa-expand-arrows-alt"></span></a>
844 <div
class=
"login_block_user">
856 <!-- Modal terminal box -->
857 <div
id=
"ModalTerminal" class=
"modal">
858 <div
class=
"modal-content">
859 <div
class=
"modal-header">
860 <span
class=
"close" href=
"#" onclick=
"document.getElementById('ModalTerminal').style.display = 'none';">×</span>
861 <h3><?php
print $langs->trans(
"TerminalSelect"); ?></h3>
863 <div
class=
"modal-body">
864 <button type=
"button" class=
"block" onclick=
"location.href='index.php?setterminal=1'"><?php
print $langs->trans(
"Terminal"); ?> 1</button>
866 for ($i = 2; $i <= $conf->global->TAKEPOS_NUM_TERMINALS; $i++)
868 print '<button type="button" class="block" onclick="location.href=\'index.php?setterminal='.$i.
'\'">'.$langs->trans("Terminal
").' '.$i.'</button>';
875 <!-- Modal multicurrency box -->
876 <?php if (!empty($conf->multicurrency->enabled)) { ?>
877 <div id="ModalCurrency
" class="modal
">
878 <div class="modal-content
">
879 <div class="modal-header
">
880 <span class="close
" href="#
" onclick="document.getElementById(
'ModalCurrency').style.display =
'none';
">×</span>
881 <h3><?php print $langs->trans("SetMultiCurrencyCode
"); ?></h3>
883 <div class="modal-body
">
885 $sql = 'SELECT code FROM '.MAIN_DB_PREFIX.'multicurrency';
886 $sql .= " WHERE entity IN (
'".getEntity('multicurrency
')."')
";
887 $resql = $db->query($sql);
890 while ($obj = $db->fetch_object($resql))
891 print '<button type="button
" class="block
" onclick="location.href=\
'index.php?setcurrency='.$obj->code.
'\'">'.$obj->code.'</button>';
899 <!-- Modal terminal Credit Note -->
900 <div id="ModalCreditNote
" class="modal
">
901 <div class="modal-content
">
902 <div class="modal-header
">
903 <span class="close
" href="#
" onclick="document.getElementById(
'ModalCreditNote').style.display =
'none';
">×</span>
904 <h3><?php print $langs->trans("invoiceAvoirWithLines
"); ?></h3>
906 <div class="modal-body
">
907 <button type="button
" class="block
" onclick="CreditNote(); document.getElementById(
'ModalCreditNote').style.display =
'none';
"><?php print $langs->trans("Yes
"); ?></button>
908 <button type="button
" class="block
" onclick="document.getElementById(
'ModalCreditNote').style.display =
'none';
"><?php print $langs->trans("No
"); ?></button>
913 <div class="row1<?php
if (empty($conf->global->TAKEPOS_HIDE_HEAD_BAR))
print 'withhead'; ?>
">
915 <div id="poslines
" class="div1
">
919 <button type="button
" class="calcbutton
" onclick="Edit(7);
">7</button>
920 <button type="button
" class="calcbutton
" onclick="Edit(8);
">8</button>
921 <button type="button
" class="calcbutton
" onclick="Edit(9);
">9</button>
922 <button type="button
" id="qty
" class="calcbutton2
" onclick="Edit(
'qty');
"><?php echo $langs->trans("Qty
"); ?></button>
923 <button type="button
" class="calcbutton
" onclick="Edit(4);
">4</button>
924 <button type="button
" class="calcbutton
" onclick="Edit(5);
">5</button>
925 <button type="button
" class="calcbutton
" onclick="Edit(6);
">6</button>
926 <button type="button
" id="price" class="calcbutton2
" onclick="Edit(
'p');
"><?php echo $langs->trans("Price
"); ?></button>
927 <button type="button
" class="calcbutton
" onclick="Edit(1);
">1</button>
928 <button type="button
" class="calcbutton
" onclick="Edit(2);
">2</button>
929 <button type="button
" class="calcbutton
" onclick="Edit(3);
">3</button>
930 <button type="button
" id="reduction
" class="calcbutton2
" onclick="Edit(
'r');
"><?php echo $langs->trans("ReductionShort
"); ?></button>
931 <button type="button
" class="calcbutton
" onclick="Edit(0);
">0</button>
932 <button type="button
" class="calcbutton
" onclick="Edit(
'.');
">.</button>
933 <button type="button
" class="calcbutton poscolorblue
" onclick="Edit(
'c');
">C</button>
934 <button type="button
" class="calcbutton2 poscolordelete
" id="delete" onclick="deleteline();
"><span class="fa fa-trash
"></span></button>
939 // TakePOS setup check
940 $sql = "SELECT
code, libelle FROM
".MAIN_DB_PREFIX."c_paiement
";
941 $sql .= " WHERE entity IN (
".getEntity('c_paiement').")
";
942 $sql .= " AND active = 1
";
943 $sql .= " ORDER BY libelle
";
945 $resql = $db->query($sql);
946 $paiementsModes = array();
948 while ($obj = $db->fetch_object($resql)) {
949 $paycode = $obj->code;
950 if ($paycode == 'LIQ') $paycode = 'CASH';
951 if ($paycode == 'CHQ') $paycode = 'CHEQUE';
953 $constantforkey = "CASHDESK_ID_BANKACCOUNT_
".$paycode.$_SESSION["takeposterminal
"];
954 //var_dump($constantforkey.' '.$conf->global->$constantforkey);
955 if (!empty($conf->global->$constantforkey) && $conf->global->$constantforkey > 0) array_push($paiementsModes, $obj);
959 if (empty($paiementsModes)) {
960 $langs->load('errors');
961 setEventMessages($langs->trans("ErrorModuleSetupNotComplete
", $langs->transnoentitiesnoconv("TakePOS
")), null, 'errors');
962 setEventMessages($langs->trans("ProblemIsInSetupOfTerminal
", $_SESSION["takeposterminal
"]), null, 'errors');
964 if (count($maincategories) == 0) {
965 if ($conf->global->TAKEPOS_ROOT_CATEGORY_ID > 0) {
966 $tmpcategory = new Categorie($db);
967 $tmpcategory->fetch($conf->global->TAKEPOS_ROOT_CATEGORY_ID);
968 setEventMessages($langs->trans("TakeposNeedsAtLeastOnSubCategoryIntoParentCategory
", $tmpcategory->label), null, 'errors');
970 setEventMessages($langs->trans("TakeposNeedsCategories
"), null, 'errors');
973 // User menu and external TakePOS modules
977 if (empty($conf->global->TAKEPOS_BAR_RESTAURANT))
979 $menus[$r++] = array('title'=>'<span class="fa fa-layer-group paddingrightonly
"></span><div class="trunc
">'.$langs->trans("New
").'</div>', 'action'=>'New();');
981 // BAR RESTAURANT specific menu
982 $menus[$r++] = array('title'=>'<span class="fa fa-layer-group paddingrightonly
"></span><div class="trunc
">'.$langs->trans("Place
").'</div>', 'action'=>'Floors();');
985 if (!empty($conf->global->TAKEPOS_HIDE_HEAD_BAR)) {
986 $menus[$r++] = array('title'=>'<span class="far fa-building paddingrightonly
"></span><div class="trunc
">'.$langs->trans("Customer
").'</div>', 'action'=>'Customer();');
988 $menus[$r++] = array('title'=>'<span class="fa fa-history paddingrightonly
"></span><div class="trunc
">'.$langs->trans("History
").'</div>', 'action'=>'History();');
989 $menus[$r++] = array('title'=>'<span class="fa fa-cube paddingrightonly
"></span><div class="trunc
">'.$langs->trans("FreeZone
").'</div>', 'action'=>'FreeZone();');
990 $menus[$r++] = array('title'=>'<span class="fa fa-percent paddingrightonly
"></span><div class="trunc
">'.$langs->trans("Reduction
").'</div>', 'action'=>'Reduction();');
991 $menus[$r++] = array('title'=>'<span class="far fa-money-bill-alt paddingrightonly
"></span><div class="trunc
">'.$langs->trans("Payment
").'</div>', 'action'=>'CloseBill();');
993 if ($conf->global->TAKEPOS_DIRECT_PAYMENT) {
994 $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();');
997 // BAR RESTAURANT specific menu
998 if ($conf->global->TAKEPOS_BAR_RESTAURANT)
1000 if ($conf->global->TAKEPOS_ORDER_PRINTERS)
1002 $menus[$r++] = array('title'=>$langs->trans("Order
"), 'action'=>'TakeposPrintingOrder();');
1004 //Button to print receipt before payment
1005 if ($conf->global->TAKEPOS_BAR_RESTAURANT)
1007 if ($conf->global->TAKEPOS_PRINT_METHOD == "takeposconnector
") {
1008 if (filter_var($conf->global->TAKEPOS_PRINT_SERVER, FILTER_VALIDATE_URL) == true) $menus[$r++] = array('title'=>'<span class="fa fa-receipt paddingrightonly
"></span><div class="trunc
">'.$langs->trans("Receipt
").'</div>', 'action'=>'TakeposConnector(placeid);');
1009 else $menus[$r++] = array('title'=>'<span class="fa fa-receipt paddingrightonly
"></span><div class="trunc
">'.$langs->trans("Receipt
").'</div>', 'action'=>'TakeposPrinting(placeid);');
1010 } elseif ($conf->global->TAKEPOS_PRINT_METHOD == "receiptprinter
") {
1011 $menus[$r++] = array('title'=>'<span class="fa fa-receipt paddingrightonly
"></span><div class="trunc
">'.$langs->trans("Receipt
").'</div>', 'action'=>'DolibarrTakeposPrinting(placeid);');
1013 $menus[$r++] = array('title'=>'<span class="fa fa-receipt paddingrightonly
"></span><div class="trunc
">'.$langs->trans("Receipt
").'</div>', 'action'=>'Print(placeid);');
1016 if ($conf->global->TAKEPOS_PRINT_METHOD == "takeposconnector
" && $conf->global->TAKEPOS_ORDER_NOTES == 1)
1018 $menus[$r++] = array('title'=>'<span class="fa fa-receipt paddingrightonly
"></span><div class="trunc
">'.$langs->trans("OrderNotes
").'</div>', 'action'=>'TakeposOrderNotes();');
1020 if ($conf->global->TAKEPOS_SUPPLEMENTS)
1022 $menus[$r++] = array('title'=>'<span class="fa fa-receipt paddingrightonly
"></span><div class="trunc
">'.$langs->trans("ProductSupplements
").'</div>', 'action'=>'LoadProducts(\'supplements\');');
1026 if ($conf->global->TAKEPOS_PRINT_METHOD == "takeposconnector
") {
1027 $menus[$r++] = array('title'=>'<span class="fa fa-receipt paddingrightonly
"></span><div class="trunc
">'.$langs->trans("DOL_OPEN_DRAWER
").'</div>', 'action'=>'OpenDrawer();');
1029 if ($conf->global->TAKEPOS_PRINT_METHOD == "receiptprinter
") {
1030 $menus[$r++] = array(
1031 'title' => '<span class="fa fa-receipt paddingrightonly
"></span><div class="trunc
">'.$langs->trans("DOL_OPEN_DRAWER
").'</div>',
1032 'action' => 'DolibarrOpenDrawer();',
1036 $sql = "SELECT
rowid, status, entity FROM
".MAIN_DB_PREFIX."pos_cash_fence WHERE
";
1037 $sql .= " entity =
".$conf->entity." AND
";
1038 $sql .= " date_creation >
'".$db->idate(dol_get_first_hour(dol_now()))."'";
1039 $resql = $db->query($sql);
1042 $num = $db->num_rows($resql);
1045 $obj = $db->fetch_object($resql);
1046 $menus[$r++] = array('title'=>'<span class="fas fa-file-invoice-dollar paddingrightonly
"></span><div class="trunc
">'.$langs->trans("CashReport
").'</div>', 'action'=>'CashReport('.$obj->rowid.');');
1047 if ($obj->status == 0) $menus[$r++] = array('title'=>'<span class="fas fa-cash-
register paddingrightonly
"></span><div class="trunc
">'.$langs->trans("CloseCashFence
").'</div>', 'action'=>'CloseCashFence('.$obj->rowid.');');
1051 $hookmanager->initHooks(array('takeposfrontend'));
1052 $reshook = $hookmanager->executeHooks('ActionButtons');
1053 if (!empty($reshook)) {
1054 if (is_array($reshook) && !isset($reshook['title'])) {
1055 foreach ($reshook as $reshook) {
1056 $menus[$r++] = $reshook;
1059 $menus[$r++] = $reshook;
1063 if ($r % 3 == 2) $menus[$r++] = array('title'=>'', 'style'=>'visibility: hidden;');
1065 if (!empty($conf->global->TAKEPOS_HIDE_HEAD_BAR)) {
1066 $menus[$r++] = array('title'=>'<span class="fa fa-sign-out-alt paddingrightonly
"></span><div class="trunc
">'.$langs->trans("Logout
").'</div>', 'action'=>'window.location.href=\''.DOL_URL_ROOT.'/user/logout.php\';');
1069 if ($conf->global->TAKEPOS_WEIGHING_SCALE)
1071 $menus[$r++] = array('title'=>'<span class="fa fa-balance-scale paddingrightonly
"></span><div class="trunc
">'.$langs->trans("WeighingScale
").'</div>', 'action'=>'WeighingScale();');
1075 <!-- Show buttons -->
1079 foreach ($menus as $menu)
1082 if (count($menus) > 12 and $i == 12)
1084 echo '<button style="'.$menu['style
'].'" type="button
" id="actionnext
" class="actionbutton
" onclick="MoreActions(
'.count($menus).');
">'.$langs->trans("Next
").'</button>';
1085 echo '<button style="display: none;
" type="button
" id="action
'.$i.'" class="actionbutton
" onclick="'.$menu['action
'].'">'.$menu['title'].'</button>';
1086 } elseif ($i > 12) echo '<button style="display: none;
" type="button
" id="action
'.$i.'" class="actionbutton
" onclick="'.$menu['action
'].'">'.$menu['title'].'</button>';
1087 else echo '<button style="'.$menu['style
'].'" type="button
" id="action
'.$i.'" class="actionbutton
" onclick="'.$menu['action
'].'">'.$menu['title'].'</button>';
1090 if (!empty($conf->global->TAKEPOS_HIDE_HEAD_BAR)) {
1091 print '<!-- Show the search input text -->'."\n";
1092 print '<div class="margintoponly
">';
1093 print '<input type="text
" id="search
" name="search
" onkeyup="Search2(
'.$keyCodeForEnter.');
" style="width:80%;width:calc(100% - 51px);font-size: 150%;
" placeholder="'.$langs->trans("Search").'" autofocus> ';
1094 print '<a class="marginleftonly hideonsmartphone
" onclick="ClearSearch();
">'.img_picto('', 'searchclear').'</a>';
1101 <div class="row2<?php
if (empty($conf->global->TAKEPOS_HIDE_HEAD_BAR))
print 'withhead'; ?>
">
1103 <!-- Show categories -->
1107 while ($count < $MAXCATEG)
1110 <div class="wrapper
" <?php if ($count == ($MAXCATEG - 2)) echo 'onclick="MoreCategories(\
'less\');"'; elseif ($count == ($MAXCATEG - 1)) echo 'onclick="MoreCategories(\'more\');"';
else echo 'onclick="LoadProducts('.$count.');"'; ?>
id="catdiv<?php echo $count; ?>">
1112 if ($count == ($MAXCATEG - 2)) {
1114 echo
'<span class="fa fa-chevron-left centerinmiddle" style="font-size: 5em;"></span>';
1115 } elseif ($count == ($MAXCATEG - 1)) {
1117 echo
'<span class="fa fa-chevron-right centerinmiddle" style="font-size: 5em;"></span>';
1119 if (!$conf->global->TAKEPOS_HIDE_CATEGORY_IMAGES) echo
'<img class="imgwrapper" height="100%" id="catimg'.$count.
'" />';
1122 <?php
if ($count != ($MAXCATEG - 2) && $count != ($MAXCATEG - 1)) { ?>
1123 <div
class=
"description" id=
"catdivdesc<?php echo $count; ?>">
1124 <div
class=
"description_content" id=
"catdesc<?php echo $count; ?>"></div>
1127 <div
class=
"catwatermark" id=
'catwatermark<?php echo $count; ?>'>...</div>
1135 <!-- Show product -->
1139 while ($count < $MAXPRODUCT)
1142 <div
class=
"wrapper2" id=
'prodiv<?php echo $count; ?>' <?php
if ($count == ($MAXPRODUCT - 2)) {?> onclick=
"MoreProducts('less');" <?php }
if ($count == ($MAXPRODUCT - 1)) {?> onclick=
"MoreProducts('more');" <?php }
else echo
'onclick="ClickProduct('.$count.
');"'; ?>>
1144 if ($count == ($MAXPRODUCT - 2)) {
1146 print '<span class="fa fa-chevron-left centerinmiddle" style="font-size: 5em;"></span>';
1147 } elseif ($count == ($MAXPRODUCT - 1)) {
1149 print '<span class="fa fa-chevron-right centerinmiddle" style="font-size: 5em;"></span>';
1151 if ($conf->global->TAKEPOS_HIDE_PRODUCT_IMAGES) echo
'<button type="button" id="probutton'.$count.
'" class="productbutton" style="display: none;"></button>';
1153 print '<div class="" id="proprice'.$count.
'"></div>';
1154 print '<img class="imgwrapper" height="100%" title="" id="proimg'.$count.
'">';
1158 <?php
if ($count != ($MAXPRODUCT - 2) && $count != ($MAXPRODUCT - 1) && !$conf->global->TAKEPOS_HIDE_PRODUCT_IMAGES) { ?>
1159 <div
class=
"description" id=
"prodivdesc<?php echo $count; ?>">
1160 <div
class=
"description_content" id=
"prodesc<?php echo $count; ?>"></div>
1163 <div
class=
"catwatermark" id=
'prowatermark<?php echo $count; ?>'>...</div>
GETPOST($paramname, $check= 'alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
if(!empty($arrayfields['country.code_iso']['checked'])) print_liste_field_titre($arrayfields['country.code_iso']['label'] country if(!empty($arrayfields['typent.code']['checked'])) print_liste_field_titre($arrayfields['typent.code']['label'] typent code
</td >< tdcolspan="3">< spanclass="opacitymedium"></span ></td ></tr >< trclass="liste_total"> CREANCES DETTES< tdcolspan="3"class="right"></td >< tdcolspan="3"class="right"></td ></tr > CREANCES DETTES RECETTES DEPENSES trips CREANCES DETTES Y m expensereport p date_valid Y m expensereport pe datep $db idate($date_start)."' AND $column < p rowid
dol_now($mode= 'auto')
Return date for now.
top_htmlhead($head, $title= '', $disablejs=0, $disablehead=0, $arrayofjs= '', $arrayofcss= '', $disablejmobile=0, $disablenofollow=0)
Ouput html header of a page.
$conf db name
Only used if Module[ID]Name translation string is not found.
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...
Class to manage categories.
if(!GETPOST('transkey', 'alphanohtml')&&!GETPOST('transphrase', 'alphanohtml')) else
View.
restrictedArea($user, $features, $objectid=0, $tableandshare= '', $feature2= '', $dbt_keyfield= 'fk_soc', $dbt_select= 'rowid', $isdraft=0)
Check permissions of a user to show a page and an object.
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) ...
top_menu_user($hideloginname=0, $urllogout= '')
Build the tooltip on user login.
print
Draft customers invoices.
if(!empty($conf->facture->enabled)&&$user->rights->facture->lire) if((!empty($conf->fournisseur->enabled)&&empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)||!empty($conf->supplier_invoice->enabled))&&$user->rights->fournisseur->facture->lire) if(!empty($conf->don->enabled)&&$user->rights->don->lire) if(!empty($conf->tax->enabled)&&$user->rights->tax->charges->lire) if(!empty($conf->facture->enabled)&&!empty($conf->commande->enabled)&&$user->rights->commande->lire &&empty($conf->global->WORKFLOW_DISABLE_CREATE_INVOICE_FROM_ORDER)) if(!empty($conf->facture->enabled)&&$user->rights->facture->lire) if((!empty($conf->fournisseur->enabled)&&empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)||!empty($conf->supplier_invoice->enabled))&&$user->rights->fournisseur->facture->lire) $resql
Social contributions to pay.
print $_SERVER["PHP_SELF"] n
Edit parameters.
if(!defined('CSRFCHECK_WITH_TOKEN')) define('CSRFCHECK_WITH_TOKEN'
Draft customers invoices.
if(preg_match('/crypted:/i', $dolibarr_main_db_pass)||!empty($dolibarr_main_db_encrypted_pass)) $conf db type