diff --git a/htdocs/core/js/lib_foot.js.php b/htdocs/core/js/lib_foot.js.php
index 265504cf3f3..14c69259b98 100644
--- a/htdocs/core/js/lib_foot.js.php
+++ b/htdocs/core/js/lib_foot.js.php
@@ -53,6 +53,7 @@ if (empty($conf->dol_no_mouse_hover))
hide: { delay: 50 },
tooltipClass: "mytooltip",
content: function () {
+ console.log("Return title for popup");
return $(this).prop(\'title\'); /* To force to get title as is */
}
});'."\n";
diff --git a/htdocs/langs/en_US/cashdesk.lang b/htdocs/langs/en_US/cashdesk.lang
index becfa8b9a65..dc6ae7dc02e 100644
--- a/htdocs/langs/en_US/cashdesk.lang
+++ b/htdocs/langs/en_US/cashdesk.lang
@@ -50,13 +50,14 @@ TheoricalAmount=Theorical amount
RealAmount=Real amount
CashFenceDone=Cash fence done for the period
NbOfInvoices=Nb of invoices
-Paymentnumpad=Payment Num Pad
+Paymentnumpad=Type of Pad to enter payment
Numberspad=Numbers Pad
-BillsCoinsPad=Bills and Coins Pad
+BillsCoinsPad=Coins and banknotes Pad
DolistorePosCategory=TakePOS modules and other POS solutions for Dolibarr
TakeposNeedsCategories=TakePOS needs product categories to work
OrderNotes=Order Notes
CashDeskBankAccountFor=Default account to use for payments in
NoPaimementModesDefined=No paiment mode defined in TakePOS configuration
TicketVatGrouped=Group VAT by rate in tickets
-AutoPrintTickets=Automatically print tickets
\ No newline at end of file
+AutoPrintTickets=Automatically print tickets
+EnableBarOrRestaurantFeatures=Enable features for Bar or Restaurant
\ No newline at end of file
diff --git a/htdocs/takepos/admin/setup.php b/htdocs/takepos/admin/setup.php
index 973c8cbd9cc..e17ea0ee036 100644
--- a/htdocs/takepos/admin/setup.php
+++ b/htdocs/takepos/admin/setup.php
@@ -64,7 +64,7 @@ if (GETPOST('action', 'alpha') == 'set')
if (GETPOST('socid', 'int') < 0) $_POST["socid"]='';
$res = dolibarr_set_const($db, "CASHDESK_ID_THIRDPARTY", (GETPOST('socid', 'int') > 0 ? GETPOST('socid', 'int') : ''), 'chaine', 0, '', $conf->entity);
-
+
$res = dolibarr_set_const($db, "CASHDESK_ID_BANKACCOUNT_CASH", (GETPOST('CASHDESK_ID_BANKACCOUNT_CASH', 'alpha') > 0 ? GETPOST('CASHDESK_ID_BANKACCOUNT_CASH', 'alpha') : ''), 'chaine', 0, '', $conf->entity);
$res = dolibarr_set_const($db, "CASHDESK_ID_BANKACCOUNT_CHEQUE", (GETPOST('CASHDESK_ID_BANKACCOUNT_CHEQUE', 'alpha') > 0 ? GETPOST('CASHDESK_ID_BANKACCOUNT_CHEQUE', 'alpha') : ''), 'chaine', 0, '', $conf->entity);
$res = dolibarr_set_const($db, "CASHDESK_ID_BANKACCOUNT_CB", (GETPOST('CASHDESK_ID_BANKACCOUNT_CB', 'alpha') > 0 ? GETPOST('CASHDESK_ID_BANKACCOUNT_CB', 'alpha') : ''), 'chaine', 0, '', $conf->entity);
@@ -177,7 +177,8 @@ if ($conf->global->TAKEPOSCONNECTOR){
// Bar Restaurant mode
print '
| ';
-print 'Bar Restaurant';
+print $langs->trans("EnableBarOrRestaurantFeatures");
+print ' | ';
print '';
print $form->selectyesno("TAKEPOS_BAR_RESTAURANT", $conf->global->TAKEPOS_BAR_RESTAURANT, 1);
print " |
\n";
@@ -276,7 +277,7 @@ if (! empty($conf->banque->enabled))
print '';
$form->select_comptes($conf->global->CASHDESK_ID_BANKACCOUNT_CB, 'CASHDESK_ID_BANKACCOUNT_CB', 0, "courant=1", 1);
print ' | ';
-
+
foreach($paiements as $modep) {
if (in_array($modep->code, array('LIQ', 'CB', 'CHQ'))) continue;
$name="CASHDESK_ID_BANKACCOUNT_".$modep->code;
diff --git a/htdocs/takepos/ajax.php b/htdocs/takepos/ajax.php
index 9586e71fd18..74f69618a0f 100644
--- a/htdocs/takepos/ajax.php
+++ b/htdocs/takepos/ajax.php
@@ -48,12 +48,11 @@ if ($action=="getProducts") {
$prods = $object->getObjectsInCateg("product");
echo json_encode($prods);
}
-
-elseif ($action=="search") {
+elseif ($action=="search" && $term != '') {
$sql = 'SELECT * FROM '.MAIN_DB_PREFIX.'product';
- $sql .= ' WHERE entity IN ('.getEntity('product').')';
- $sql .= ' AND tosell = 1';
- $sql .= natural_search(array('label','barcode'), $term);
+ $sql.= ' WHERE entity IN ('.getEntity('product').')';
+ $sql.= ' AND tosell = 1';
+ $sql.= natural_search(array('label','barcode'), $term);
$resql = $db->query($sql);
$rows = array();
while ($row = $db->fetch_array($resql)) {
diff --git a/htdocs/takepos/css/pos.css b/htdocs/takepos/css/pos.css
index 4b90f712f1d..a94e737f273 100644
--- a/htdocs/takepos/css/pos.css
+++ b/htdocs/takepos/css/pos.css
@@ -46,7 +46,7 @@ button.calcbutton3 {
text-align: center;
font-size:120%;
overflow: visible; /* removes extra width in IE */
- width:12%;
+ width:24%;
height:24%;
}
@@ -60,7 +60,7 @@ button.actionbutton {
text-align: center;
overflow: visible; /* removes extra width in IE */
width:33%;
- height:33%;
+ height:24%;
}
div.wrapper{
@@ -208,6 +208,13 @@ div.catwatermark{
padding-left: 5px;
}
+.selected {
+ font-weight: bold;
+}
+.order {
+ color: limegreen;
+}
+
.colorwhite {
color: white;
}
diff --git a/htdocs/takepos/customers.php b/htdocs/takepos/customers.php
index 6c526a97ea3..05fdf5537c9 100644
--- a/htdocs/takepos/customers.php
+++ b/htdocs/takepos/customers.php
@@ -45,7 +45,8 @@ $show_files=GETPOST('show_files', 'int');
$confirm=GETPOST('confirm', 'alpha');
$toselect = GETPOST('toselect', 'array');
$idcustomer = GETPOST('idcustomer', 'int');
-$place = (GETPOSTISSET('place')?GETPOST('place', 'int'):0);
+$place = (GETPOST('place', 'int') > 0 ? GETPOST('place', 'int') : 0); // $place is id of table for Ba or Restaurant
+$posnb = (GETPOST('posnb', 'int') > 0 ? GETPOST('posnb', 'int') : 0); // $posnb is id of POS
$_GET['optioncss'] = 'print';
@@ -60,7 +61,7 @@ if ($action=="change") {
?>
diff --git a/htdocs/takepos/floors.php b/htdocs/takepos/floors.php
index ceb8c73f211..0206fe1a8e0 100644
--- a/htdocs/takepos/floors.php
+++ b/htdocs/takepos/floors.php
@@ -25,24 +25,26 @@ if (! defined('NOREQUIREMENU')) define('NOREQUIREMENU', '1');
if (! defined('NOREQUIREHTML')) define('NOREQUIREHTML', '1');
if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX', '1');
-$_GET['theme']="md"; // Force theme. MD theme provides better look and feel to TakePOS
-
require '../main.inc.php'; // Load $user and permissions
$langs->loadLangs(array("bills","orders","commercial","cashdesk"));
-$floor=GETPOST('floor', 'alpha');
+$floor=GETPOST('floor', 'int');
if ($floor=="") $floor=1;
$id = GETPOST('id', 'int');
$action = GETPOST('action', 'alpha');
$left = GETPOST('left', 'alpha');
$top = GETPOST('top', 'alpha');
-$place = GETPOST('place', 'int');
-$newname = GETPOST('newname');
+
+$place = (GETPOST('place', 'int') > 0 ? GETPOST('place', 'int') : 0); // $place is id of table for Ba or Restaurant
+$posnb = (GETPOST('posnb', 'int') > 0 ? GETPOST('posnb', 'int') : 0); // $posnb is id of POS
+
+$newname = GETPOST('newname', 'alpha');
$mode = GETPOST('mode', 'alpha');
-if ($action=="getTables"){
- $sql="SELECT * from ".MAIN_DB_PREFIX."takepos_floor_tables where floor=".$floor;
+if ($action=="getTables")
+{
+ $sql="SELECT rowid, entity, label, leftpos, toppos, floor FROM ".MAIN_DB_PREFIX."takepos_floor_tables where floor=".$floor;
$resql = $db->query($sql);
$rows = array();
while($row = $db->fetch_array($resql)){
@@ -56,20 +58,21 @@ if ($action=="update")
{
if ($left>95) $left=95;
if ($top>95) $top=95;
- if ($left>3 or $top>4) $db->query("update ".MAIN_DB_PREFIX."takepos_floor_tables set leftpos=$left, toppos=$top where label='$place'");
- else $db->query("delete from ".MAIN_DB_PREFIX."takepos_floor_tables where label='$place'");
+ if ($left>3 or $top>4) $db->query("UPDATE ".MAIN_DB_PREFIX."takepos_floor_tables set leftpos=".$left.", toppos=".$top." WHERE rowid='".$place."'");
+ else $db->query("DELETE from ".MAIN_DB_PREFIX."takepos_floor_tables where rowid='".$place."'");
}
if ($action=="updatename")
{
$newname = preg_replace("/[^a-zA-Z0-9\s]/", "", $newname); // Only English chars
if (strlen($newname) > 3) $newname = substr($newname, 0, 3); // Only 3 chars
- $db->query("update ".MAIN_DB_PREFIX."takepos_floor_tables set label='$newname' where label='$place'");
+ $db->query("UPDATE ".MAIN_DB_PREFIX."takepos_floor_tables set label='".$db->escape($newname)."' WHERE rowid='".$place."'");
}
if ($action=="add")
{
- $asdf=$db->query("insert into ".MAIN_DB_PREFIX."takepos_floor_tables values ('', '', '', '45', '45', $floor)");
+ $sql="INSERT INTO ".MAIN_DB_PREFIX."takepos_floor_tables(entity, label, leftpos, toppos, floor) VALUES (".$conf->entity.", '', '45', '45', ".$floor.")";
+ $asdf=$db->query($sql);
$db->query("update ".MAIN_DB_PREFIX."takepos_floor_tables set label=rowid where label=''"); // No empty table names
}
@@ -101,6 +104,7 @@ height: 100%;
var DragDrop='trans("DragDrop"); ?>';
function updateplace(idplace, left, top) {
+ console.log("updateplace idplace="+idplace+" left="+left+" top="+top);
$.ajax({
type: "POST",
url: "floors.php",
@@ -110,12 +114,13 @@ function updateplace(idplace, left, top) {
});
}
-function updatename(before) {
- var after=$("#"+before).text();
+function updatename(rowid) {
+ var after=$("#tablename"+rowid).text();
+ console.log("updatename rowid="+rowid+" after="+after);
$.ajax({
type: "POST",
url: "floors.php",
- data: { action: "updatename", place: before, newname: after }
+ data: { action: "updatename", place: rowid, newname: after }
}).done(function( msg ) {
window.location.href='floors.php?mode=edit&floor=';
});
@@ -130,8 +135,8 @@ $( document ).ready(function() {
$.getJSON('./floors.php?action=getTables&floor=', function(data) {
$.each(data, function(key, val) {
- $('body').append(''+val.label+'
');
- $( "#"+val.label ).draggable(
+ $('body').append(''+val.label+'
');
+ $( "#tablename"+val.rowid ).draggable(
{
start: function() {
$("#add").html("trans("Delete"); ?>");
@@ -139,7 +144,7 @@ $( document ).ready(function() {
stop: function() {
var left=$(this).offset().left*100/$(window).width();
var top=$(this).offset().top*100/$(window).height();
- updateplace($(this).attr('id'), left, top);
+ updateplace($(this).attr('id').substr(9), left, top);
}
}
);
@@ -149,7 +154,7 @@ $( document ).ready(function() {
})
- $('body').append(''+val.label+'
');
+ $('body').append(''+val.label+'
');
});
});
@@ -171,7 +176,13 @@ $( document ).ready(function() {
-
';">trans("Floor")." ".$floor; ?>
+
+ 1) { ?>
+
';">
+
+ trans("Floor")." ".$floor; ?>
+
+