diff --git a/htdocs/admin/receiptprinter.php b/htdocs/admin/receiptprinter.php
index 1305f812c76..2c7f58be336 100644
--- a/htdocs/admin/receiptprinter.php
+++ b/htdocs/admin/receiptprinter.php
@@ -392,11 +392,11 @@ if ($mode == 'config' && $user->admin) {
print img_picto($langs->trans("Delete"), 'delete', 'class="paddingright"');
print '';
// test icon
- print '';
+ print '';
print img_picto($langs->trans("TestPrinterDesc"), 'printer', 'class="paddingright paddingleft"').'TXT';
print '';
// test icon
- print '';
+ print '';
print img_picto($langs->trans("TestPrinterDesc2"), 'printer', 'class="paddingright paddingleft"').'IMG';
print '';
print '';
diff --git a/htdocs/takepos/admin/appearance.php b/htdocs/takepos/admin/appearance.php
index 3f58d23146b..2871f0ecf1e 100644
--- a/htdocs/takepos/admin/appearance.php
+++ b/htdocs/takepos/admin/appearance.php
@@ -63,8 +63,6 @@ if (GETPOST('action', 'alpha') == 'set') {
$db->rollback();
setEventMessages($langs->trans("Error"), null, 'errors');
}
-} elseif (GETPOST('action', 'alpha') == 'setmethod') {
- dolibarr_set_const($db, "TAKEPOS_PRINT_METHOD", GETPOST('value', 'alpha'), 'chaine', 0, '', $conf->entity);
}
diff --git a/htdocs/takepos/admin/bar.php b/htdocs/takepos/admin/bar.php
index 0c8f41fb237..4c822640e6a 100644
--- a/htdocs/takepos/admin/bar.php
+++ b/htdocs/takepos/admin/bar.php
@@ -126,13 +126,11 @@ if (getDolGlobalInt('TAKEPOS_BAR_RESTAURANT')) {
print '
'.$langs->trans("Parameters").' | '.$langs->trans("Value").' | ';
print "\n";
- //if (getDolGlobalString('TAKEPOS_PRINT_METHOD') != "browser") { // Why this ?
print '| ';
print $langs->trans("OrderPrinters").' ('.$langs->trans("Setup").')';
print ' | ';
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 ' |
';
if (getDolGlobalString('TAKEPOS_ORDER_PRINTERS')) {
@@ -141,7 +139,6 @@ if (getDolGlobalInt('TAKEPOS_BAR_RESTAURANT')) {
print '';
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 ' | ';
}
/*else {
diff --git a/htdocs/takepos/admin/setup.php b/htdocs/takepos/admin/setup.php
index e049a2e7b60..453d0115797 100644
--- a/htdocs/takepos/admin/setup.php
+++ b/htdocs/takepos/admin/setup.php
@@ -281,7 +281,7 @@ if (isModEnabled("service")) {
print '| ';
print $form->textwithpicto($langs->trans("RootCategoryForProductsToSell"), $langs->trans("RootCategoryForProductsToSellDesc"));
print ' | ';
-print img_object('', 'category', 'class="paddingright"').$form->select_all_categories(Categorie::TYPE_PRODUCT, getDolGlobalInt('TAKEPOS_ROOT_CATEGORY_ID'), 'TAKEPOS_ROOT_CATEGORY_ID', 64, 0, 0, 0, 'widthcentpercentminusx');
+print img_object('', 'category', 'class="paddingright"').$form->select_all_categories(Categorie::TYPE_PRODUCT, getDolGlobalInt('TAKEPOS_ROOT_CATEGORY_ID'), 'TAKEPOS_ROOT_CATEGORY_ID', 64, 0, 0, 0, 'maxwidth500 widthcentpercentminusx');
print ajax_combobox('TAKEPOS_ROOT_CATEGORY_ID');
print " |
\n";
@@ -361,7 +361,7 @@ if (is_array($formmail->lines_model)) {
}
//var_dump($arraydefaultmessage);
//var_dump($arrayofmessagename);
-print $form->selectarray('TAKEPOS_EMAIL_TEMPLATE_INVOICE', $arrayofmessagename, $conf->global->TAKEPOS_EMAIL_TEMPLATE_INVOICE, 'None', 1, 0, '', 0, 0, 0, '', '', 1);
+print $form->selectarray('TAKEPOS_EMAIL_TEMPLATE_INVOICE', $arrayofmessagename, getDolGlobalString('TAKEPOS_EMAIL_TEMPLATE_INVOICE'), 'None', 1, 0, '', 0, 0, 0, '', 'maxwidth500 widthcentpercentminusx', 1);
print "\n";
// Control cash box at opening pos
diff --git a/htdocs/takepos/index.php b/htdocs/takepos/index.php
index 59a667f5e90..1caaa2d6630 100644
--- a/htdocs/takepos/index.php
+++ b/htdocs/takepos/index.php
@@ -96,6 +96,8 @@ if ($conf->browser->layout == 'phone') {
$MAXCATEG = (!getDolGlobalString('TAKEPOS_NB_MAXCATEG') ? $maxcategbydefaultforthisdevice : $conf->global->TAKEPOS_NB_MAXCATEG);
$MAXPRODUCT = (!getDolGlobalString('TAKEPOS_NB_MAXPRODUCT') ? $maxproductbydefaultforthisdevice : $conf->global->TAKEPOS_NB_MAXPRODUCT);
+$term = empty($_SESSION['takeposterminal']) ? 1: $_SESSION['takeposterminal'];
+
/*
$constforcompanyid = 'CASHDESK_ID_THIRDPARTY'.$_SESSION["takeposterminal"];
$soc = new Societe($db);
@@ -1340,7 +1342,7 @@ if (getDolGlobalString('TAKEPOS_BAR_RESTAURANT')) {
} else {
$menus[$r++] = array('title'=>''.$langs->trans("Receipt").'
', 'action'=>'TakeposPrinting(placeid);');
}
- } elseif (getDolGlobalString('TAKEPOS_PRINT_METHOD') == "receiptprinter") {
+ } elseif ((isModEnabled('receiptprinter') && getDolGlobalInt('TAKEPOS_PRINTER_TO_USE'.$term) > 0) || getDolGlobalString('TAKEPOS_PRINT_METHOD') == "receiptprinter") {
$menus[$r++] = array('title'=>''.$langs->trans("Receipt").'
', 'action'=>'DolibarrTakeposPrinting(placeid);');
} else {
$menus[$r++] = array('title'=>''.$langs->trans("Receipt").'
', 'action'=>'Print(placeid);');
@@ -1357,7 +1359,7 @@ if (getDolGlobalString('TAKEPOS_BAR_RESTAURANT')) {
if (getDolGlobalString('TAKEPOS_PRINT_METHOD') == "takeposconnector") {
$menus[$r++] = array('title'=>''.$langs->trans("DOL_OPEN_DRAWER").'
', 'action'=>'OpenDrawer();');
}
-if (getDolGlobalString('TAKEPOS_PRINT_METHOD') == "receiptprinter") {
+if (getDolGlobalInt('TAKEPOS_PRINTER_TO_USE'.$term) > 0 || getDolGlobalString('TAKEPOS_PRINT_METHOD') == "receiptprinter") {
$menus[$r++] = array(
'title' => ''.$langs->trans("DOL_OPEN_DRAWER").'
',
'action' => 'DolibarrOpenDrawer();',
diff --git a/htdocs/takepos/invoice.php b/htdocs/takepos/invoice.php
index 17b22e4e750..444fc728796 100644
--- a/htdocs/takepos/invoice.php
+++ b/htdocs/takepos/invoice.php
@@ -157,6 +157,8 @@ if (isModEnabled('multicurrency') && !empty($_SESSION["takeposcustomercurrency"]
}
}
+$term = empty($_SESSION["takeposterminal"]) ? 1 : $_SESSION["takeposterminal"];
+
/*
* Actions
@@ -926,7 +928,7 @@ if (empty($reshook)) {
if ($action == "order" && $placeid != 0 && ($user->hasRight('takepos', 'run') || defined('INCLUDE_PHONEPAGE_FROM_PUBLIC_PAGE'))) {
include_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
- if (getDolGlobalString('TAKEPOS_PRINT_METHOD') == "receiptprinter" || getDolGlobalString('TAKEPOS_PRINT_METHOD') == "takeposconnector") {
+ if ((isModEnabled('receiptprinter') && getDolGlobalInt('TAKEPOS_PRINTER_TO_USE'.$term) > 0) || getDolGlobalString('TAKEPOS_PRINT_METHOD') == "receiptprinter" || getDolGlobalString('TAKEPOS_PRINT_METHOD') == "takeposconnector") {
require_once DOL_DOCUMENT_ROOT.'/core/class/dolreceiptprinter.class.php';
$printer = new dolReceiptPrinter($db);
}
@@ -971,7 +973,7 @@ if (empty($reshook)) {
$order_receipt_printer1 .= '';
}
}
- if ((getDolGlobalString('TAKEPOS_PRINT_METHOD') == "receiptprinter" || getDolGlobalString('TAKEPOS_PRINT_METHOD') == "takeposconnector") && $linestoprint > 0) {
+ if (((isModEnabled('receiptprinter') && getDolGlobalInt('TAKEPOS_PRINTER_TO_USE'.$term) > 0) || getDolGlobalString('TAKEPOS_PRINT_METHOD') == "receiptprinter" || getDolGlobalString('TAKEPOS_PRINT_METHOD') == "takeposconnector") && $linestoprint > 0) {
$invoice->fetch($placeid); //Reload object before send to printer
$printer->orderprinter = 1;
echo "