From b5abb72c5b5b1ab74cce3700b20bc2c3cf03a9dd Mon Sep 17 00:00:00 2001 From: Marc Guenneugues Date: Sat, 2 May 2020 16:36:40 +0200 Subject: [PATCH 01/13] Add / as a delimiter for replacement pattern in select_produits* --- htdocs/core/class/html.form.class.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 5eaa7d5ede8..f48ce989a7a 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -2507,7 +2507,7 @@ class Form $label = $objp->label; if (!empty($objp->label_translated)) $label = $objp->label_translated; - if (!empty($filterkey) && $filterkey != '') $label = preg_replace('/('.preg_quote($filterkey).')/i', '$1', $label, 1); + if (!empty($filterkey) && $filterkey != '') $label = preg_replace('/('.preg_quote($filterkey, '/').')/i', '$1', $label, 1); $outkey = $objp->rowid; $outref = $objp->ref; @@ -2579,7 +2579,7 @@ class Form if ($outorigin && !empty($conf->global->PRODUCT_SHOW_ORIGIN_IN_COMBO)) $opt .= ' ('.getCountry($outorigin, 1).')'; $objRef = $objp->ref; - if (!empty($filterkey) && $filterkey != '') $objRef = preg_replace('/('.preg_quote($filterkey).')/i', '$1', $objRef, 1); + if (!empty($filterkey) && $filterkey != '') $objRef = preg_replace('/('.preg_quote($filterkey, '/').')/i', '$1', $objRef, 1); $outval .= $objRef; if ($outbarcode) $outval .= ' ('.$outbarcode.')'; $outval .= ' - '.dol_trunc($label, $maxlengtharticle); @@ -2948,11 +2948,11 @@ class Form } $objRef = $objp->ref; - if ($filterkey && $filterkey != '') $objRef = preg_replace('/('.preg_quote($filterkey).')/i', '$1', $objRef, 1); + if ($filterkey && $filterkey != '') $objRef = preg_replace('/('.preg_quote($filterkey, '/').')/i', '$1', $objRef, 1); $objRefFourn = $objp->ref_fourn; - if ($filterkey && $filterkey != '') $objRefFourn = preg_replace('/('.preg_quote($filterkey).')/i', '$1', $objRefFourn, 1); + if ($filterkey && $filterkey != '') $objRefFourn = preg_replace('/('.preg_quote($filterkey, '/').')/i', '$1', $objRefFourn, 1); $label = $objp->label; - if ($filterkey && $filterkey != '') $label = preg_replace('/('.preg_quote($filterkey).')/i', '$1', $label, 1); + if ($filterkey && $filterkey != '') $label = preg_replace('/('.preg_quote($filterkey, '/').')/i', '$1', $label, 1); $optlabel = $objp->ref; if (!empty($objp->idprodfournprice) && ($objp->ref != $objp->ref_fourn)) { From 1929f9132db3c67023ce284a935943a8c47b232a Mon Sep 17 00:00:00 2001 From: proprum <51385888+proprum@users.noreply.github.com> Date: Sat, 2 May 2020 17:25:22 +0200 Subject: [PATCH 02/13] MAIN_NO_CONCAT_DESCRIPTION in contrat/card.php Idem to propal/card.php --- htdocs/contrat/card.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/contrat/card.php b/htdocs/contrat/card.php index 3c64b627a5c..111a446d9ae 100644 --- a/htdocs/contrat/card.php +++ b/htdocs/contrat/card.php @@ -521,7 +521,8 @@ if (empty($reshook)) } $desc = $prod->description; - $desc = dol_concatdesc($desc, $product_desc, '', !empty($conf->global->MAIN_CHANGE_ORDER_CONCAT_DESCRIPTION)); + if (!empty($product_desc) && !empty($conf->global->MAIN_NO_CONCAT_DESCRIPTION)) $desc = $product_desc; + else $desc = dol_concatdesc($desc, $product_desc, '', !empty($conf->global->MAIN_CHANGE_ORDER_CONCAT_DESCRIPTION)); $fk_unit = $prod->fk_unit; } else From 81c808692e13f45922f7716b8c698e1537bc2e1a Mon Sep 17 00:00:00 2001 From: "jove@bisquerra.com" Date: Sat, 2 May 2020 22:00:04 +0200 Subject: [PATCH 03/13] NEW Bar Restaurant tab and Auto order --- htdocs/core/lib/takepos.lib.php | 8 ++ htdocs/langs/en_US/cashdesk.lang | 4 +- htdocs/takepos/admin/bar.php | 178 +++++++++++++++++++++++++++++++ htdocs/takepos/admin/setup.php | 55 ---------- htdocs/takepos/ajax/ajax.php | 6 ++ htdocs/takepos/auto_order.php | 29 +++++ htdocs/takepos/genimg/qr.php | 33 ++++++ htdocs/takepos/invoice.php | 7 +- htdocs/takepos/phone.php | 31 ++++-- 9 files changed, 287 insertions(+), 64 deletions(-) create mode 100644 htdocs/takepos/admin/bar.php create mode 100644 htdocs/takepos/auto_order.php create mode 100644 htdocs/takepos/genimg/qr.php diff --git a/htdocs/core/lib/takepos.lib.php b/htdocs/core/lib/takepos.lib.php index 8a883ceef91..729952916ad 100644 --- a/htdocs/core/lib/takepos.lib.php +++ b/htdocs/core/lib/takepos.lib.php @@ -42,6 +42,14 @@ function takepos_prepare_head() $head[$h][1] = $langs->trans("Receipt"); $head[$h][2] = 'receipt'; $h++; + + if ($conf->global->TAKEPOS_BAR_RESTAURANT) + { + $head[$h][0] = DOL_URL_ROOT.'/takepos/admin/bar.php'; + $head[$h][1] = $langs->trans("BarRestaurant"); + $head[$h][2] = 'bar'; + $h++; + } $numterminals = max(1, $conf->global->TAKEPOS_NUM_TERMINALS); for ($i = 1; $i <= $numterminals; $i++) diff --git a/htdocs/langs/en_US/cashdesk.lang b/htdocs/langs/en_US/cashdesk.lang index f2bc989b953..b22a7b83166 100644 --- a/htdocs/langs/en_US/cashdesk.lang +++ b/htdocs/langs/en_US/cashdesk.lang @@ -105,4 +105,6 @@ CashReport=Cash report MainPrinterToUse=Main printer to use OrderPrinterToUse=Order printer to use MainTemplateToUse=Main template to use -OrderTemplateToUse=Order template to use \ No newline at end of file +OrderTemplateToUse=Order template to use +BarRestaurant=Bar Restaurant +AutoOrder=Customer auto order \ No newline at end of file diff --git a/htdocs/takepos/admin/bar.php b/htdocs/takepos/admin/bar.php new file mode 100644 index 00000000000..16fccf85147 --- /dev/null +++ b/htdocs/takepos/admin/bar.php @@ -0,0 +1,178 @@ + + * Copyright (C) 2011-2017 Juanjo Menent + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +/** + * \file htdocs/takepos/admin/bar.php + * \ingroup takepos + * \brief Setup page for TakePos module - Bar Restaurant features + */ + +require '../../main.inc.php'; // Load $user and permissions +require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/product/class/html.formproduct.class.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/pdf.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; +require_once DOL_DOCUMENT_ROOT."/core/lib/takepos.lib.php"; + +// Security check +if (!$user->admin) accessforbidden(); + +$langs->loadLangs(array("admin", "cashdesk", "printing")); + +global $db; + +/* + * Actions + */ + +if (GETPOST('action', 'alpha') == 'set') +{ + $db->begin(); + + dol_syslog("admin/cashdesk: level ".GETPOST('level', 'alpha')); + + if (!$res > 0) $error++; + + if (!$error) + { + $db->commit(); + setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); + } + else + { + $db->rollback(); + setEventMessages($langs->trans("Error"), null, 'errors'); + } +} + + +/* + * View + */ + +$form = new Form($db); +$formproduct = new FormProduct($db); + +llxHeader('', $langs->trans("CashDeskSetup")); + +$linkback = ''.$langs->trans("BackToModuleList").''; +print load_fiche_titre($langs->trans("CashDeskSetup").' (TakePOS)', $linkback, 'title_setup'); +$head = takepos_prepare_head(); +dol_fiche_head($head, 'bar', 'TakePOS', -1); +print '
'; + + +// Mode +print '
'; +print ''; +print ''; + +print '
'; +print ''; +print ''; +print ''; +print "\n"; + +if ($conf->global->TAKEPOS_BAR_RESTAURANT && $conf->global->TAKEPOS_PRINT_METHOD != "browser") { + print ''; + + print ''; +} + +print ''; + +print ''; + +if ($conf->global->TAKEPOS_SUPPLEMENTS) +{ + print '\n"; +} + +print ''; + + +print '
'.$langs->trans("Parameters").''.$langs->trans("Value").'
'; + print $langs->trans("OrderPrinters").' ('.$langs->trans("Setup").')'; + print ''; + print ajax_constantonoff("TAKEPOS_ORDER_PRINTERS", array(), $conf->entity, 0, 0, 1, 0); + //print $form->selectyesno("TAKEPOS_ORDER_PRINTERS", $conf->global->TAKEPOS_ORDER_PRINTERS, 1); + print '
'; + print $langs->trans("OrderNotes"); + print ''; + print ajax_constantonoff("TAKEPOS_ORDER_NOTES", array(), $conf->entity, 0, 0, 1, 0); + //print $form->selectyesno("TAKEPOS_ORDER_NOTES", $conf->global->TAKEPOS_ORDER_NOTES, 1); + print '
'; +print $langs->trans("BasicPhoneLayout"); +print ''; +//print $form->selectyesno("TAKEPOS_PHONE_BASIC_LAYOUT", $conf->global->TAKEPOS_PHONE_BASIC_LAYOUT, 1); +print ajax_constantonoff("TAKEPOS_PHONE_BASIC_LAYOUT", array(), $conf->entity, 0, 0, 1, 0); +print '
'; +print $langs->trans("ProductSupplements"); +print ''; +//print $form->selectyesno("TAKEPOS_SUPPLEMENTS", $conf->global->TAKEPOS_SUPPLEMENTS, 1); +print ajax_constantonoff("TAKEPOS_SUPPLEMENTS", array(), $conf->entity, 0, 0, 1, 0); +print '
'; + print $langs->trans("SupplementCategory"); + print ''; + print $form->select_all_categories(Categorie::TYPE_PRODUCT, $conf->global->TAKEPOS_SUPPLEMENTS_CATEGORY, 'TAKEPOS_SUPPLEMENTS_CATEGORY', 64, 0, 0); + print ajax_combobox('TAKEPOS_SUPPLEMENTS_CATEGORY'); + print "
'; +print $langs->trans("AutoOrder"); +print ''; +print ajax_constantonoff("TAKEPOS_AUTO_ORDER", array(), $conf->entity, 0, 0, 1, 0); +print '
'; + +if ($conf->global->TAKEPOS_AUTO_ORDER) +{ + print '
'; + print ''; + print ''; + print ''; + print "\n"; + + //global $dolibarr_main_url_root; + $urlwithouturlroot = preg_replace('/'.preg_quote(DOL_URL_ROOT, '/').'$/i', '', trim($dolibarr_main_url_root)); + $urlwithroot = $urlwithouturlroot.DOL_URL_ROOT; // This is to use external domain name found into config file + $sql = "SELECT rowid, entity, label, leftpos, toppos, floor FROM ".MAIN_DB_PREFIX."takepos_floor_tables"; + $resql = $db->query($sql); + $rows = array(); + while ($row = $db->fetch_array($resql)) { + print ''; + } + + print '
'.$langs->trans("Table").''.$langs->trans("URL").''.$langs->trans("QR").'
'; + print $langs->trans("Table")." ".$row['label']; + print ''; + print "".$urlwithroot."/takepos/auto_order.php?key=".dol_encode($row['rowid']).""; + print ''; + print ""; + print '
'; +} + +print '
'; + +print '
'; + +print '
'; + +print "
\n"; + +print '
'; + +llxFooter(); +$db->close(); diff --git a/htdocs/takepos/admin/setup.php b/htdocs/takepos/admin/setup.php index 3e12fdce5c9..59fe85e66ef 100644 --- a/htdocs/takepos/admin/setup.php +++ b/htdocs/takepos/admin/setup.php @@ -434,19 +434,6 @@ print "\n"; //print $form->selectarray('TAKEPOS_ADDON', $array, (empty($conf->global->TAKEPOS_ADDON) ? '0' : $conf->global->TAKEPOS_ADDON), 0); //print "\n"; -print ''; -print ''; - -print '
'; - -// Bar Restaurant mode -print '
'; -print ''; - -print ''; -print ''; -print "\n"; - print ''; @@ -455,48 +442,6 @@ print ajax_constantonoff("TAKEPOS_BAR_RESTAURANT", array(), $conf->entity, 0, 0, //print $form->selectyesno("TAKEPOS_BAR_RESTAURANT", $conf->global->TAKEPOS_BAR_RESTAURANT, 1); print "\n"; -if ($conf->global->TAKEPOS_BAR_RESTAURANT && $conf->global->TAKEPOS_PRINT_METHOD != "browser") { - print ''; - - print ''; -} - -if ($conf->global->TAKEPOS_BAR_RESTAURANT) -{ - print ''; - - print ''; - - if ($conf->global->TAKEPOS_SUPPLEMENTS) - { - print '\n"; - } -} print '
'.$langs->trans("Other").''.$langs->trans("Value").'
'; print $langs->trans("EnableBarOrRestaurantFeatures"); print '
'; - print $langs->trans("OrderPrinters").' ('.$langs->trans("Setup").')'; - print ''; - print ajax_constantonoff("TAKEPOS_ORDER_PRINTERS", array(), $conf->entity, 0, 0, 1, 0); - //print $form->selectyesno("TAKEPOS_ORDER_PRINTERS", $conf->global->TAKEPOS_ORDER_PRINTERS, 1); - print '
'; - print $langs->trans("OrderNotes"); - print ''; - print ajax_constantonoff("TAKEPOS_ORDER_NOTES", array(), $conf->entity, 0, 0, 1, 0); - //print $form->selectyesno("TAKEPOS_ORDER_NOTES", $conf->global->TAKEPOS_ORDER_NOTES, 1); - print '
'; - print $langs->trans("BasicPhoneLayout"); - print ''; - //print $form->selectyesno("TAKEPOS_PHONE_BASIC_LAYOUT", $conf->global->TAKEPOS_PHONE_BASIC_LAYOUT, 1); - print ajax_constantonoff("TAKEPOS_PHONE_BASIC_LAYOUT", array(), $conf->entity, 0, 0, 1, 0); - print '
'; - print $langs->trans("ProductSupplements"); - print ''; - //print $form->selectyesno("TAKEPOS_SUPPLEMENTS", $conf->global->TAKEPOS_SUPPLEMENTS, 1); - print ajax_constantonoff("TAKEPOS_SUPPLEMENTS", array(), $conf->entity, 0, 0, 1, 0); - print '
'; - print $langs->trans("SupplementCategory"); - print ''; - print $form->select_all_categories(Categorie::TYPE_PRODUCT, $conf->global->TAKEPOS_SUPPLEMENTS_CATEGORY, 'TAKEPOS_SUPPLEMENTS_CATEGORY', 64, 0, 0); - print ajax_combobox('TAKEPOS_SUPPLEMENTS_CATEGORY'); - print "
'; print '
'; diff --git a/htdocs/takepos/ajax/ajax.php b/htdocs/takepos/ajax/ajax.php index f3b5ba15716..d1f59325c1f 100644 --- a/htdocs/takepos/ajax/ajax.php +++ b/htdocs/takepos/ajax/ajax.php @@ -142,4 +142,10 @@ elseif ($action == 'search' && $term != '') { } echo json_encode($object); +} elseif ($action == 'thecheck') { + $place = GETPOST('place', 'alpha'); + require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; + require_once DOL_DOCUMENT_ROOT.'/core/class/dolreceiptprinter.class.php'; + $printer = new dolReceiptPrinter($db); + $printer->sendToPrinter($object, $conf->global->{'TAKEPOS_TEMPLATE_TO_USE_FOR_INVOICES'.$term}, $conf->global->{'TAKEPOS_PRINTER_TO_USE'.$term}); } diff --git a/htdocs/takepos/auto_order.php b/htdocs/takepos/auto_order.php new file mode 100644 index 00000000000..5305b4da81f --- /dev/null +++ b/htdocs/takepos/auto_order.php @@ -0,0 +1,29 @@ + + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +/** + * \file htdocs/takepos/auto_order.php + * \ingroup takepos + * \brief Public orders for customers + */ + +if (!defined("NOLOGIN")) define("NOLOGIN", '1'); // If this page is public (can be called outside logged session) +if (!defined('NOIPCHECK')) define('NOIPCHECK', '1'); // Do not check IP defined into conf $dolibarr_main_restrict_ip + +$_SESSION["basiclayout"] = 1; +$_SESSION["publicterminal"] = true; // Is a public customer +require 'phone.php'; diff --git a/htdocs/takepos/genimg/qr.php b/htdocs/takepos/genimg/qr.php new file mode 100644 index 00000000000..23b033f3da5 --- /dev/null +++ b/htdocs/takepos/genimg/qr.php @@ -0,0 +1,33 @@ + + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +if (!defined("NOLOGIN")) define("NOLOGIN", '1'); // If this page is public (can be called outside logged session) +if (!defined('NOIPCHECK')) define('NOIPCHECK', '1'); // Do not check IP defined into conf $dolibarr_main_restrict_ip +if (!defined('NOREQUIRESOC')) define('NOREQUIRESOC', '1'); +if (!defined('NOCSRFCHECK')) define('NOCSRFCHECK', '1'); +if (!defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL', '1'); +if (!defined('NOREQUIREMENU')) define('NOREQUIREMENU', '1'); +if (!defined('NOREQUIREHTML')) define('NOREQUIREHTML', '1'); +if (!defined('NOREQUIREAJAX')) define('NOREQUIREAJAX', '1'); + +require '../../main.inc.php'; // Load $user and permissions +require '../../core/modules/barcode/doc/tcpdfbarcode.modules.php'; + +$key = GETPOST('key'); + +$module = new modtcpdfbarcode($db); +$result = $module->buildBarCode("http://www.takepos.com", 'QRCODE', 'Y'); \ No newline at end of file diff --git a/htdocs/takepos/invoice.php b/htdocs/takepos/invoice.php index fa5ca2f83be..f59a3b5c97d 100644 --- a/htdocs/takepos/invoice.php +++ b/htdocs/takepos/invoice.php @@ -47,13 +47,16 @@ $idproduct = GETPOST('idproduct', 'int'); $place = (GETPOST('place', 'aZ09') ? GETPOST('place', 'aZ09') : 0); // $place is id of table for Bar or Restaurant $placeid = 0; // $placeid is ID of invoice -if (empty($user->rights->takepos->run)) { +if ($_SESSION["publicterminal"]) { + $_SESSION["takeposterminal"] = 1; // Use Terminal 1 for public customers +} +else if (empty($user->rights->takepos->run)) { accessforbidden(); } -if ($conf->global->TAKEPOS_PHONE_BASIC_LAYOUT == 1 && $conf->browser->layout == 'phone') +if (($conf->global->TAKEPOS_PHONE_BASIC_LAYOUT == 1 && $conf->browser->layout == 'phone') || $_SESSION["publicterminal"]) { // DIRECT LINK TO THIS PAGE FROM MOBILE AND NO TERMINAL SELECTED if ($_SESSION["takeposterminal"] == "") diff --git a/htdocs/takepos/phone.php b/htdocs/takepos/phone.php index b2526ef885e..224cf3dd1c3 100644 --- a/htdocs/takepos/phone.php +++ b/htdocs/takepos/phone.php @@ -37,7 +37,12 @@ require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/hookmanager.class.php'; -$place = (GETPOST('place', 'aZ09') ? GETPOST('place', 'aZ09') : 0); // $place is id of table for Ba or Restaurant +if ($_SESSION["publicterminal"]){ + // Decode place if is a order from customer phone + $key = GETPOST('key'); + $place=dol_decode($key); +} +else $place = (GETPOST('place', 'aZ09') ? GETPOST('place', 'aZ09') : 0); // $place is id of table for Ba or Restaurant $action = GETPOST('action', 'alpha'); $setterminal = GETPOST('setterminal', 'int'); @@ -48,7 +53,10 @@ if ($setterminal > 0) $langs->loadLangs(array("bills", "orders", "commercial", "cashdesk", "receiptprinter")); -if (empty($user->rights->takepos->run)) { +if ($_SESSION["publicterminal"]) { + $_SESSION["takeposterminal"] = 1; // Use Terminal 1 for public customers +} +else if (empty($user->rights->takepos->run)) { accessforbidden(); } @@ -167,6 +175,14 @@ function Exit(){ window.location.href='../user/logout.php'; } +function CheckPlease(){ + console.log("Request the check to the waiter"); + $.ajax({ + type: "GET", + url: "", + }); +} + @@ -175,10 +191,13 @@ if ($conf->global->TAKEPOS_NUM_TERMINALS != "1" && $_SESSION["takeposterminal"] ?>
- - - - + '.strtoupper(substr($langs->trans('Floors'), 0, 3)).''; + print ''; + print ''; + print ''; + if ($_SESSION["publicterminal"]) print ''; + ?>
From 35713ef0046b22f31c848fef1ea6facbb004b712 Mon Sep 17 00:00:00 2001 From: andreubisquerra Date: Sun, 3 May 2020 00:05:59 +0200 Subject: [PATCH 04/13] Fix travis --- htdocs/takepos/genimg/qr.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/takepos/genimg/qr.php b/htdocs/takepos/genimg/qr.php index 23b033f3da5..f0c3bea82b9 100644 --- a/htdocs/takepos/genimg/qr.php +++ b/htdocs/takepos/genimg/qr.php @@ -30,4 +30,4 @@ require '../../core/modules/barcode/doc/tcpdfbarcode.modules.php'; $key = GETPOST('key'); $module = new modtcpdfbarcode($db); -$result = $module->buildBarCode("http://www.takepos.com", 'QRCODE', 'Y'); \ No newline at end of file +$result = $module->buildBarCode("http://www.takepos.com", 'QRCODE', 'Y'); From ac75cf318eba8edaa0be6ed9fd7bee7f8a31f1d8 Mon Sep 17 00:00:00 2001 From: andreubisquerra Date: Sun, 3 May 2020 00:07:04 +0200 Subject: [PATCH 05/13] Fix travis --- htdocs/takepos/invoice.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/takepos/invoice.php b/htdocs/takepos/invoice.php index f59a3b5c97d..b1641072829 100644 --- a/htdocs/takepos/invoice.php +++ b/htdocs/takepos/invoice.php @@ -50,7 +50,7 @@ $placeid = 0; // $placeid is ID of invoice if ($_SESSION["publicterminal"]) { $_SESSION["takeposterminal"] = 1; // Use Terminal 1 for public customers } -else if (empty($user->rights->takepos->run)) { +elseif (empty($user->rights->takepos->run)) { accessforbidden(); } From 32923daa9decc772155f713ea5aedfa9ff7c029b Mon Sep 17 00:00:00 2001 From: andreubisquerra Date: Sun, 3 May 2020 00:07:52 +0200 Subject: [PATCH 06/13] Fix travis --- htdocs/takepos/phone.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/takepos/phone.php b/htdocs/takepos/phone.php index 224cf3dd1c3..80d67513bf2 100644 --- a/htdocs/takepos/phone.php +++ b/htdocs/takepos/phone.php @@ -56,7 +56,7 @@ $langs->loadLangs(array("bills", "orders", "commercial", "cashdesk", "receiptpri if ($_SESSION["publicterminal"]) { $_SESSION["takeposterminal"] = 1; // Use Terminal 1 for public customers } -else if (empty($user->rights->takepos->run)) { +elseif (empty($user->rights->takepos->run)) { accessforbidden(); } From 8530db6dab7d7d8a068cac0705c47541f5062fc3 Mon Sep 17 00:00:00 2001 From: andreubisquerra Date: Sun, 3 May 2020 00:09:17 +0200 Subject: [PATCH 07/13] Fix travis --- htdocs/takepos/admin/bar.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/takepos/admin/bar.php b/htdocs/takepos/admin/bar.php index 16fccf85147..672041d3bb3 100644 --- a/htdocs/takepos/admin/bar.php +++ b/htdocs/takepos/admin/bar.php @@ -138,13 +138,13 @@ print ''; print ''; if ($conf->global->TAKEPOS_AUTO_ORDER) -{ +{ print '
'; print ''; print ''; print ''; print "\n"; - + //global $dolibarr_main_url_root; $urlwithouturlroot = preg_replace('/'.preg_quote(DOL_URL_ROOT, '/').'$/i', '', trim($dolibarr_main_url_root)); $urlwithroot = $urlwithouturlroot.DOL_URL_ROOT; // This is to use external domain name found into config file From fe98e430ceaa18d98a26706c7515e3d09201b86e Mon Sep 17 00:00:00 2001 From: andreubisquerra Date: Sun, 3 May 2020 00:10:12 +0200 Subject: [PATCH 08/13] Fix travis --- htdocs/core/lib/takepos.lib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/lib/takepos.lib.php b/htdocs/core/lib/takepos.lib.php index 729952916ad..d04fa5f77ef 100644 --- a/htdocs/core/lib/takepos.lib.php +++ b/htdocs/core/lib/takepos.lib.php @@ -42,7 +42,7 @@ function takepos_prepare_head() $head[$h][1] = $langs->trans("Receipt"); $head[$h][2] = 'receipt'; $h++; - + if ($conf->global->TAKEPOS_BAR_RESTAURANT) { $head[$h][0] = DOL_URL_ROOT.'/takepos/admin/bar.php'; From f42492764d9a6e8821cf6938025c68426dadf3dc Mon Sep 17 00:00:00 2001 From: Anthony Berton Date: Sun, 3 May 2020 17:16:25 +0200 Subject: [PATCH 09/13] Update html.formproduct.class.php DEFAULT_WAREHOUSE is not select in sherch --- htdocs/product/class/html.formproduct.class.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/htdocs/product/class/html.formproduct.class.php b/htdocs/product/class/html.formproduct.class.php index efde996b927..d6ae705b651 100644 --- a/htdocs/product/class/html.formproduct.class.php +++ b/htdocs/product/class/html.formproduct.class.php @@ -253,10 +253,12 @@ class FormProduct $comboenhancement = ajax_combobox($htmlname, $events); $out .= $comboenhancement; } - - if (empty($selected) && !empty($conf->global->MAIN_DEFAULT_WAREHOUSE)) $selected = $conf->global->MAIN_DEFAULT_WAREHOUSE; - if (empty($selected) && !empty($conf->global->MAIN_DEFAULT_WAREHOUSE_USER)) $selected = $user->fk_warehouse; - + + if ($htmlname != 'search_warehouse'){ + if (empty($selected) && !empty($conf->global->MAIN_DEFAULT_WAREHOUSE)) $selected = $conf->global->MAIN_DEFAULT_WAREHOUSE; + if (empty($selected) && !empty($conf->global->MAIN_DEFAULT_WAREHOUSE_USER)) $selected = $user->fk_warehouse; + } + $out .= ''; if ($empty) $out .= ''; foreach ($this->cache_warehouses as $id => $arraytypes) From 33669b6fd8e2300c64e3a6abec008309915739a6 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 3 May 2020 21:15:23 +0200 Subject: [PATCH 11/13] Update html.formproduct.class.php --- htdocs/product/class/html.formproduct.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/product/class/html.formproduct.class.php b/htdocs/product/class/html.formproduct.class.php index 4887f749d60..0eeddd15c07 100644 --- a/htdocs/product/class/html.formproduct.class.php +++ b/htdocs/product/class/html.formproduct.class.php @@ -254,7 +254,7 @@ class FormProduct $out .= $comboenhancement; } - if ($htmlname != 'search_warehouse'){ + if (strpos($htmlname, 'search_') !== 0) { if (empty($selected) && !empty($conf->global->MAIN_DEFAULT_WAREHOUSE)) $selected = $conf->global->MAIN_DEFAULT_WAREHOUSE; if (empty($selected) && !empty($conf->global->MAIN_DEFAULT_WAREHOUSE_USER)) $selected = $user->fk_warehouse; } From 2eb027833c644a2e946f286f38bad9703c1bf642 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 3 May 2020 21:25:49 +0200 Subject: [PATCH 12/13] Update card.php --- htdocs/contrat/card.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/contrat/card.php b/htdocs/contrat/card.php index 111a446d9ae..e898ef9e8f4 100644 --- a/htdocs/contrat/card.php +++ b/htdocs/contrat/card.php @@ -523,6 +523,7 @@ if (empty($reshook)) $desc = $prod->description; if (!empty($product_desc) && !empty($conf->global->MAIN_NO_CONCAT_DESCRIPTION)) $desc = $product_desc; else $desc = dol_concatdesc($desc, $product_desc, '', !empty($conf->global->MAIN_CHANGE_ORDER_CONCAT_DESCRIPTION)); + $fk_unit = $prod->fk_unit; } else From ab20b5cb616f1e10add360171fd6e84a652072c9 Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Sun, 3 May 2020 19:26:35 +0000 Subject: [PATCH 13/13] Fixing style errors. --- htdocs/contrat/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/contrat/card.php b/htdocs/contrat/card.php index e898ef9e8f4..21d46fb2974 100644 --- a/htdocs/contrat/card.php +++ b/htdocs/contrat/card.php @@ -523,7 +523,7 @@ if (empty($reshook)) $desc = $prod->description; if (!empty($product_desc) && !empty($conf->global->MAIN_NO_CONCAT_DESCRIPTION)) $desc = $product_desc; else $desc = dol_concatdesc($desc, $product_desc, '', !empty($conf->global->MAIN_CHANGE_ORDER_CONCAT_DESCRIPTION)); - + $fk_unit = $prod->fk_unit; } else
'.$langs->trans("Table").''.$langs->trans("URL").''.$langs->trans("QR").'