From 803f8d00ded94d82dc9956bab44ad0e155ba5cd7 Mon Sep 17 00:00:00 2001 From: Geno Date: Thu, 19 Nov 2020 23:02:16 +0100 Subject: [PATCH] OrderSprinter 1.3.2 --- printserver/OrderSprinterPrintserver.exe | Bin 259072 -> 259072 bytes spider/install/installer.php | 2 +- webapp/OrderSprinterPrintserver.exe | Bin 259072 -> 259072 bytes webapp/bar.html | 6 +- webapp/bill.html | 6 +- webapp/css/productpanel.css | 2 +- webapp/css/roompanel.css | 2 +- webapp/css/tablepanel.css | 2 +- webapp/customers.html | 4 +- webapp/feedback.html | 6 +- webapp/index.html | 10 +- webapp/install.html | 2 +- webapp/install/installer.php | 35 ++++++- webapp/kitchen.html | 6 +- webapp/kitchenbar.js | 16 --- webapp/manager.html | 121 +++++++++++++++++------ webapp/paydesk.html | 8 +- webapp/php/admin.php | 94 +++++++++--------- webapp/php/bill.php | 48 --------- webapp/php/printqueue.php | 42 ++++++-- webapp/php/products.php | 27 +---- webapp/php/queuecontent.php | 66 ------------- webapp/php/roomtables.php | 10 -- webapp/preferences.html | 8 +- webapp/products.html | 8 +- webapp/rating.html | 6 +- webapp/reports.html | 9 +- webapp/reservation.html | 18 +--- webapp/supplydesk.html | 6 +- webapp/time.html | 4 +- webapp/utilities.js | 4 +- webapp/waiter.html | 16 +-- webapp/waiterdesktop.php | 2 +- 33 files changed, 264 insertions(+), 332 deletions(-) diff --git a/printserver/OrderSprinterPrintserver.exe b/printserver/OrderSprinterPrintserver.exe index 4e056802b7e8c29856f0c536fa90a519223d5974..81b27c62834c6f9bd73b6b03ea7a1874982cbcd7 100644 GIT binary patch delta 154 zcmZp8!Qb$Le?kZI1&i3m?$&O`)^4V)-OO_<8JV_gRxwY}QZaTkb#^f@w9s{Qaxv32 zaWZk!wXifc({*-oa&mPsGdFZ~blU!K33IR>qtSNL%gm=a1tc!SSY2D~@7-y3diUFO zxz*bR?lLdt14?gs&3ucAlZk2p6a8w0r)KQikx F0RZ77G+qDz delta 154 zcmZp8!Qb$Le?kZIYa#E(?$&O`)^4V)-OO_<85y^0RxwY}Qn9o!FtaeSaMN|Ma5mR9 zF>`X%wRADF)OB@nwXkq;buuz@Gui%d33IR>qv3Yb%gm=a1^S!VW*on<%WZDv+ZVmB z)xK;OxXZkl4=BCmHS;YdPDTc121W)32FC5v-!aEB0>!_+XI>7Zr_cS!Yz*XH{K%}& F1OPHPHR=EW diff --git a/spider/install/installer.php b/spider/install/installer.php index d5aa3ab..2e590b8 100644 --- a/spider/install/installer.php +++ b/spider/install/installer.php @@ -85,7 +85,7 @@ class Installer { } Database::dropTables($pdo); Database::createEmptyTables($pdo, $prefix); - Database::setVersion($pdo,$prefix,"1.3.1"); + Database::setVersion($pdo,$prefix,"1.3.2"); Database::setAccessPassword($pdo,$prefix,$adminpass); Database::setRefreshRate($pdo,$prefix,"5"); // default: 5 times per hour return array("status" => "OK","msg" => "Installation successful"); diff --git a/webapp/OrderSprinterPrintserver.exe b/webapp/OrderSprinterPrintserver.exe index 4e056802b7e8c29856f0c536fa90a519223d5974..81b27c62834c6f9bd73b6b03ea7a1874982cbcd7 100644 GIT binary patch delta 154 zcmZp8!Qb$Le?kZI1&i3m?$&O`)^4V)-OO_<8JV_gRxwY}QZaTkb#^f@w9s{Qaxv32 zaWZk!wXifc({*-oa&mPsGdFZ~blU!K33IR>qtSNL%gm=a1tc!SSY2D~@7-y3diUFO zxz*bR?lLdt14?gs&3ucAlZk2p6a8w0r)KQikx F0RZ77G+qDz delta 154 zcmZp8!Qb$Le?kZIYa#E(?$&O`)^4V)-OO_<85y^0RxwY}Qn9o!FtaeSaMN|Ma5mR9 zF>`X%wRADF)OB@nwXkq;buuz@Gui%d33IR>qv3Yb%gm=a1^S!VW*on<%WZDv+ZVmB z)xK;OxXZkl4=BCmHS;YdPDTc121W)32FC5v-!aEB0>!_+XI>7Zr_cS!Yz*XH{K%}& F1OPHPHR=EW diff --git a/webapp/bar.html b/webapp/bar.html index 0b018c6..8e70ac5 100644 --- a/webapp/bar.html +++ b/webapp/bar.html @@ -5,7 +5,7 @@ - + @@ -105,13 +105,13 @@ function initializeEverything() {
    -
  • Module
  • +
  • Hauptmenü

Bar

diff --git a/webapp/bill.html b/webapp/bill.html index 595a7a9..07700b7 100644 --- a/webapp/bill.html +++ b/webapp/bill.html @@ -5,7 +5,7 @@ - + @@ -460,13 +460,13 @@ $(document).on("pageinit", "#bill-page", function () {
    -
  • Module
  • +
  • Hauptmenü

Kassenbons

diff --git a/webapp/css/productpanel.css b/webapp/css/productpanel.css index fd3681f..1b7fe79 100644 --- a/webapp/css/productpanel.css +++ b/webapp/css/productpanel.css @@ -1 +1 @@ -.productspanel{display:-webkit-flex;display:flex;-webkit-justify-content:left;justify-content:left;-webkit-flex-wrap:row wrap;flex-flow:row wrap;background-color:lightgrey}.productitem{background-color:#ff0;width:100px;height:100px;margin:10px;border-radius:25px;border:2px solid #73ad21;padding:20px;color:black;font-weight:bold;text-align:center;box-shadow:10px 10px 5px #888;word-wrap:break-word}.prodToMoveEl{padding:8px 16px;border-bottom:1px solid #ddd;height:40px;font-size:16px;font-weight:bold}.proditemselected{background-color:#0f0}.proditemunselected{background-color:#eee} \ No newline at end of file +.productspanel{display:-webkit-flex;display:flex;-webkit-justify-content:left;justify-content:left;-webkit-flex-wrap:row wrap;flex-flow:row wrap;background-color:lightgrey}.productitem{background-color:#ff0;margin:10px;border-radius:25px;border:2px solid #73ad21;padding:20px;color:black;font-weight:bold;text-align:center;box-shadow:10px 10px 5px #888;word-wrap:break-word}.osprod-desk-0{width:100px;height:40px}.osprod-desk-1{width:100px;height:100px}.osprod-desk-2{width:120px;height:130px}.prodToMoveEl{padding:8px 16px;border-bottom:1px solid #ddd;height:40px;font-size:16px;font-weight:bold}.proditemselected{background-color:#0f0}.proditemunselected{background-color:#eee} \ No newline at end of file diff --git a/webapp/css/roompanel.css b/webapp/css/roompanel.css index bf7fbc6..a39c8c3 100644 --- a/webapp/css/roompanel.css +++ b/webapp/css/roompanel.css @@ -1 +1 @@ -.roompanel{display:-webkit-flex;display:flex;-webkit-justify-content:center;justify-content:center;-webkit-flex-wrap:row nowrap;flex-flow:row nowrap;background-color:lightgrey;width:100%;-webkit-align-items:stretch;align-items:stretch}.roomitem{background-color:#fff6b5;height:60px;padding:10px;color:black;font-weight:bold;text-align:center;border:2px solid #aaa;-webkit-flex:1;flex:10;box-shadow:10px 10px 5px #888;word-wrap:break-word}.roomitemselected{background-color:#eee6b5;height:65px;padding:10px;color:black;font-weight:bold;text-align:center;border:2px solid red;-webkit-flex:1;flex:15;box-shadow:10px 10px 5px #888}.roomtogo{display:-webkit-flex;display:flex;-webkit-justify-content:center;justify-content:center;-webkit-flex-wrap:row wrap;flex-flow:row wrap}.roomname{width:100%}.roomtogoaccounted{background:white;color:black;-webkit-flex:1;flex:1;order:2;font-weight:normal}.roomchangeitem{padding:8px 16px;border-bottom:1px solid #ddd;background-color:#dd0;height:40px;font-size:16px;font-weight:bold} \ No newline at end of file +.roompanel{display:-webkit-flex;display:flex;-webkit-justify-content:center;justify-content:center;-webkit-flex-wrap:row nowrap;flex-flow:row nowrap;background-color:lightgrey;width:100%;-webkit-align-items:stretch;align-items:stretch}.roomitem{background-color:#fff6b5;padding:10px;color:black;font-weight:bold;text-align:center;border:2px solid #aaa;-webkit-flex:1;flex:10;box-shadow:10px 10px 5px #888;word-wrap:break-word}.roomitemselected{background-color:#eee6b5;height:65px;padding:10px;color:black;font-weight:bold;text-align:center;border:2px solid red;-webkit-flex:1;flex:15;box-shadow:10px 10px 5px #888}.roomtogo{display:-webkit-flex;display:flex;-webkit-justify-content:center;justify-content:center;-webkit-flex-wrap:row wrap;flex-flow:row wrap}.osroom-desk-0{height:40px}.osroom-desk-1{height:60px}.osroom-desk-2{height:80px}.osroom-desk-sel-0{height:45px}.osroom-desk-sel-1{height:65px}.osroom-desk-sel-2{height:85px}.roomname{width:100%}.roomtogoaccounted{background:white;color:black;-webkit-flex:1;flex:1;order:2;font-weight:normal}.roomchangeitem{padding:8px 16px;border-bottom:1px solid #ddd;background-color:#dd0;height:40px;font-size:16px;font-weight:bold} \ No newline at end of file diff --git a/webapp/css/tablepanel.css b/webapp/css/tablepanel.css index 362816c..0d79cc9 100644 --- a/webapp/css/tablepanel.css +++ b/webapp/css/tablepanel.css @@ -1 +1 @@ -.tablepanel{display:-webkit-flex;display:flex;-webkit-flex-flow:row wrap;flex-flow:row wrap;text-align:center;color:white}.tablepanel>*{padding:10px;-webkit-flex-wrap:wrap;flex-flow:wrap}.tablepanelcontent{display:-webkit-flex;display:flex;-webkit-flex-flow:row wrap;flex-flow:row wrap;text-align:center;color:white;-webkit-justify-content:center;justify-content:center}.tablepanelheader{background:black;flex:100%}.tableelement{display:-webkit-flex;display:flex;-webkit-flex-flow:row wrap;flex-flow:row wrap;font-weight:bold;text-align:center;width:100px;height:40px;padding:5px;box-shadow:10px 10px 5px #888}.tableelement>*{flex:1 100%}.tableitem{background-color:LightGreen;color:black;margin:5px;border-radius:15px;border:2px solid #73ad21;font-weight:bold;text-align:center}.tableitemselected{background-color:LightGreen;color:black;border-radius:15px;border:4px solid red;font-weight:bold;text-align:center}.tablename{order:1;padding:0;width:100%}.tableopen{background:white;color:black;-webkit-flex:1;flex:1;order:2;font-weight:normal}.tableready{background:white;color:black;-webkit-flex:1;flex:1;order:3}.tablechangeitem{padding:8px 16px;border-bottom:1px solid #ddd;background-color:#ff0;height:40px;font-size:16px;font-weight:bold} \ No newline at end of file +.tablepanel{display:-webkit-flex;display:flex;-webkit-flex-flow:row wrap;flex-flow:row wrap;text-align:center;color:white}.tablepanel>*{padding:10px;-webkit-flex-wrap:wrap;flex-flow:wrap}.tablepanelcontent{display:-webkit-flex;display:flex;-webkit-flex-flow:row wrap;flex-flow:row wrap;text-align:center;color:white;-webkit-justify-content:center;justify-content:center}.tablepanelheader{background:black;flex:100%}.tableelement{display:-webkit-flex;display:flex;-webkit-flex-flow:row wrap;flex-flow:row wrap;font-weight:bold;text-align:center;width:100px;padding:5px;box-shadow:10px 10px 5px #888}.tableelement>*{flex:1 100%}.tableitem{background-color:LightGreen;color:black;margin:5px;border-radius:15px;border:2px solid #73ad21;font-weight:bold;text-align:center}.tableitemselected{background-color:LightGreen;color:black;border-radius:15px;border:4px solid red;font-weight:bold;text-align:center}.ostable-desk-0{height:30px}.ostable-desk-1{height:50px}.ostable-desk-2{height:70px}.tablename{order:1;padding:0;width:100%}.tableopen{background:white;color:black;-webkit-flex:1;flex:1;order:2;font-weight:normal}.tableready{background:white;color:black;-webkit-flex:1;flex:1;order:3}.tablechangeitem{padding:8px 16px;border-bottom:1px solid #ddd;background-color:#ff0;height:40px;font-size:16px;font-weight:bold} \ No newline at end of file diff --git a/webapp/customers.html b/webapp/customers.html index 2052fb7..1ab4f8e 100644 --- a/webapp/customers.html +++ b/webapp/customers.html @@ -114,13 +114,13 @@ $(document).on("pageinit", "#info-page", function () {
    -
  • Module
  • +
  • Hauptmenü

Gäste

diff --git a/webapp/feedback.html b/webapp/feedback.html index b85139c..e3346bf 100644 --- a/webapp/feedback.html +++ b/webapp/feedback.html @@ -4,7 +4,7 @@ - + @@ -216,13 +216,13 @@ $(document).on("pageinit", "#feedback-page", function () {
    -
  • Module
  • +
  • Hauptmenü

Feedback

diff --git a/webapp/index.html b/webapp/index.html index f84201b..154fdb4 100644 --- a/webapp/index.html +++ b/webapp/index.html @@ -9,8 +9,8 @@ - - + + @@ -203,7 +203,7 @@ function handleResultOfInstallCheck(is_installed) { if (is_installed == "Yes") { useInstallation(); } else { - setTimeout(function(){document.location.href = "install.html?v=1.3.1"},500); + setTimeout(function(){document.location.href = "install.html?v=1.3.2"},500); } } @@ -224,13 +224,13 @@ $(document).on("pageinit", "#index-page", function () {
    -
  • Module
  • +
  • Hauptmenü

OrderSprinter

diff --git a/webapp/install.html b/webapp/install.html index dfa7d81..cbbe255 100644 --- a/webapp/install.html +++ b/webapp/install.html @@ -679,7 +679,7 @@ $(document).ready(function() {   - +   diff --git a/webapp/install/installer.php b/webapp/install/installer.php index 534a3ce..3afc783 100644 --- a/webapp/install/installer.php +++ b/webapp/install/installer.php @@ -1799,7 +1799,6 @@ $sql = "INSERT INTO `%config%` (`id` , `name`, `setting`) VALUES (NULL,?,?)"; $stmt = $pdo->prepare($this->basedb->resolveTablenamesInSqlString($sql)); $stmt->execute(array('cancelguestcode','')); - $this->updateVersion($pdo, '1.3.1'); return true; } catch (PDOException $e) { @@ -1808,6 +1807,31 @@ return false; } } +function updateUserTable1301_1302($prefix, $version, $dbname) { +$pdo = $this->pdo; +try { +if ($version != "1.3.1") { +$ret = $this->updateUserTable1300_1301($prefix, $version, $dbname); +if (!$ret) { +echo "Version update v1.3.0 to 1.3.1 not successful."; +return false; +} +} + +DbUtils::overrulePrefix($prefix); + +$sql = "INSERT INTO `%config%` (`id` , `name`, `setting`) VALUES (NULL,?,?)"; +$stmt = $pdo->prepare($this->basedb->resolveTablenamesInSqlString($sql)); +$stmt->execute(array('returntoorder','1')); + +$this->updateVersion($pdo, '1.3.2'); +return true; +} catch (PDOException $e) { +echo "Error in v1.3.1 to 1.3.2: $e"; +return false; +} +} + function setVersion($prefix,$theVersion) { $pdo = $this->pdo; @@ -1934,7 +1958,7 @@ $this->basedb->doSQL($pdo,"INSERT INTO `%config%` (`id` , `name`, `setting`) VAL $this->basedb->doSQL($pdo,"INSERT INTO `%config%` (`id` , `name`, `setting`) VALUES (NULL , 'billlanguage', $billlanguage)"); $this->basedb->doSQL($pdo,"INSERT INTO `%config%` (`id` , `name`, `setting`) VALUES (NULL , 'currency', '$currency')"); $this->basedb->doSQL($pdo,"INSERT INTO `%config%` (`id` , `name`, `setting`) VALUES (NULL , 'receiptfontsize', '12')"); -$this->basedb->doSQL($pdo,"INSERT INTO `%config%` (`id` , `name`, `setting`) VALUES (NULL , 'version', '1.3.1')"); +$this->basedb->doSQL($pdo,"INSERT INTO `%config%` (`id` , `name`, `setting`) VALUES (NULL , 'version', '1.3.2')"); $this->basedb->doSQL($pdo,"INSERT INTO `%config%` (`id` , `name`, `setting`) VALUES (NULL , 'paymentconfig', '0')"); $this->basedb->doSQL($pdo,"INSERT INTO `%config%` (`id` , `name`, `setting`) VALUES (NULL , 'remoteaccesscode', null)"); $this->basedb->doSQL($pdo,"INSERT INTO `%config%` (`id` , `name`, `setting`) VALUES (NULL , 'decpoint', '$decpoint')"); @@ -1978,6 +2002,7 @@ $this->basedb->doSQL($pdo,"INSERT INTO `%config%` (`id` , `name`, `setting`) VAL $this->basedb->doSQL($pdo,"INSERT INTO `%config%` (`id` , `name`, `setting`) VALUES (NULL , 'hs3refresh', '60')"); $this->basedb->doSQL($pdo,"INSERT INTO `%config%` (`id` , `name`, `setting`) VALUES (NULL , 'memorylimit', '256')"); $this->basedb->doSQL($pdo,"INSERT INTO `%config%` (`id` , `name`, `setting`) VALUES (NULL , 'restaurantmode', '1')"); +$this->basedb->doSQL($pdo,"INSERT INTO `%config%` (`id` , `name`, `setting`) VALUES (NULL , 'returntoorder', '1')"); // prepare for later inconsistency check if version is obsolete date_default_timezone_set($timezone); @@ -2315,7 +2340,7 @@ $zones[] = $timezone_identifiers[$i]; } echo json_encode($zones); } else if ($command == 'update') { -$installerVersion = "1.3.1"; +$installerVersion = "1.3.2"; $admin = new InstallAdmin(); $pdo = $admin->openDbAndReturnPdo($_POST['host'],$_POST['db'],$_POST['user'],$_POST['password']); @@ -2346,7 +2371,7 @@ $supportedVersions = array("1.0.22","1.0.23","1.0.24","1.0.25","1.0.26","1.0.27" "1.1.0","1.1.1","1.1.2","1.1.3","1.1.4","1.1.5","1.1.6","1.1.7","1.1.8", "1.1.9","1.1.10","1.1.11","1.1.12","1.1.13","1.1.14","1.1.15","1.1.16","1.1.17", "1.1.18","1.1.19","1.1.20","1.1.21","1.1.22","1.1.23","1.1.24","1.1.25","1.1.26","1.1.27","1.1.28","1.1.29","1.1.30", "1.2.0","1.2.1","1.2.2", "1.2.3", "1.2.4","1.2.5","1.2.6","1.2.7","1.2.8","1.2.9","1.2.10","1.2.11","1.2.12","1.2.13","1.2.14","1.2.15","1.2.16","1.2.17", -"1.2.18","1.2.19","1.2.20","1.2.21","1.2.22","1.3.0" +"1.2.18","1.2.19","1.2.20","1.2.21","1.2.22","1.3.0","1.3.1" ); if (!in_array($version, $supportedVersions)) { @@ -2354,7 +2379,7 @@ echo json_encode("Quellversion nicht unterstützt"); return; } -$ret = $admin->updateUserTable1300_1301($_POST['prefix'], $version, $_POST['db']); +$ret = $admin->updateUserTable1301_1302($_POST['prefix'], $version, $_POST['db']); if(session_id() == '') { session_start(); diff --git a/webapp/kitchen.html b/webapp/kitchen.html index f343220..4c6ddd1 100644 --- a/webapp/kitchen.html +++ b/webapp/kitchen.html @@ -5,7 +5,7 @@ - + @@ -107,13 +107,13 @@ function initializeEverything() {
    -
  • Module
  • +
  • Hauptmenü

Küche

diff --git a/webapp/kitchenbar.js b/webapp/kitchenbar.js index 7123164..4c789af 100644 --- a/webapp/kitchenbar.js +++ b/webapp/kitchenbar.js @@ -4,7 +4,6 @@ var KB_TO_MAKE = ["Herzustellen","To prepare","Para preparar"]; var KB_TO_FINISHED = ["Fertig","Ready to serve","Completo"]; var KB_TABLE = ["Tisch","Table","Mesa"]; -// user has rights (default: no) var isInitialized = false; var displayWorkToDo = false; @@ -15,7 +14,6 @@ var cookedEntries = null; var entriesToCook = null; var user = ""; -// increase performance by calling AJAX a bit later as a thread function declareProductBeCookingOrCooked(queueid,action) { window.setTimeout(function(){declareProductBeCookingOrCooked_orig(queueid,action)},100); } @@ -48,14 +46,12 @@ function removeOrRedeclareAnIdFromPrepared(theId,doRemove) { var aList = table.queueitems; var tablename = table.table; - // now remove this from the list or change entry! var i=0; var found = false; for (i=0;i'; aList += '
  • ' + tablename + ' (' + KB_MAX_WAIT[lang] + maxWaitTime + ' min)
  • '; @@ -297,7 +290,6 @@ function fillTableWithCookedEntriesCore() { } else { - // remove also headline of list, if list is empty $("#listWithCookedEntries").html(""); } } @@ -346,7 +338,6 @@ function insertGeneralConfigItems(configResult) { getAndDisplayAllEntries(); } else { setTimeout(function(){document.location.href = "index.html"},250); // not logged in - //alert("Fehler beim Aufruf der Seite: " + configResult.msg); } } @@ -363,7 +354,6 @@ function setWorkMode(urlsuffix) { */ function setHeadlines() { if (!displayHeaderFooter) { - // then replace by individual footer (embedded in iframe) if (displayWorkToDo) { $("#moduleheadline").html(KB_TO_MAKE[lang]); } else if (displayFinished) { @@ -403,14 +393,11 @@ function groupMadeItems(theSet) { var joinedNeedle = name + "-" + option + "-" + "-" + table + "_" + extras; var index = grouped.joinedvals.indexOf(joinedNeedle); if (index >= 0) { - // element is already in group grouped.counts[index] = grouped.counts[index] + 1; var queueidsarr = grouped.queueids[index]; - // append the current queueid queueidsarr[queueidsarr.length] = queueid; grouped.queueids[index] = queueidsarr; } else { - // new element to be inserted in grouped var gLength = grouped.counts.length; grouped.counts[gLength] = 1; grouped.joinedvals[gLength] = joinedNeedle; @@ -453,14 +440,11 @@ function groupItemToMake(theSet) { var joinedNeedle = name + "-" + option + "-" + waiticon + "-" + cooking; var index = grouped.joinedvals.indexOf(joinedNeedle); if (index >= 0) { - // element is already in group grouped.counts[index] = grouped.counts[index] + 1; var queueidsarr = grouped.queueids[index]; - // append the current queueid queueidsarr[queueidsarr.length] = queueid; grouped.queueids[index] = queueidsarr; } else { - // new element to be inserted in grouped var gLength = grouped.counts.length; grouped.counts[gLength] = 1; grouped.joinedvals[gLength] = joinedNeedle; diff --git a/webapp/manager.html b/webapp/manager.html index 265aa50..35c0807 100644 --- a/webapp/manager.html +++ b/webapp/manager.html @@ -5,7 +5,7 @@ - + @@ -129,7 +129,7 @@ var MAN_MAX_NO_OF_TABLES = ["Max. Anzahl Tische pro Raum: ","Max. number of tabl var MAN_CHANGE_ROOM_SIZE = ["Raumgröße ändern","Change room size","Cambiar dimensión de espacio"]; var MAN_ROOM_LABEL = ["Räume","Rooms","Espacios"]; var MAN_TABLE_LABEL = ["Tische","Tables","Mesas"]; - +var MAN_TABLE_TXT = ["Tisch","Table","Mesa"]; var MAN_LANG_OF_RECEIPT = ["Bonsprache","Receipt language","Idioma de tique"]; var MAN_PRINT_CONCEPT = ["Druckkonzept","Print concept","Concepto de impresión"]; var MAN_PAYMENT_CONFIG = ["Menü Zahlungsweg","Menu Payment Type","Selección tipo de pagar"]; @@ -156,6 +156,9 @@ var MAN_PRINT_AND_QUEUE_HINT = ["Wird dieser Wert auf 'ja' gesetzt, so werden di var MAN_CASH_HINT = ["Die Kassen kann mit dieser Einstellung übergangen werden (Einstellung: nein). Jede Bestellung wird dann sofort mit der Übermittlung an den Server als als bar bezahlt deklariert.", "The cash function can be skipped ('no'). In this case every order will be declared as paid by cash automatically.", "Si configurado a 'no', cada ordern va a ser declarada pagada."]; +var MAN_RETURN_TO_ORDER_HINT = ["Wird der Wert auf 'ja' gesetzt, so wechselt die Desktopansicht automatisch wieder in den Bestellmodus über, nachdem ein ausgewählter Tisch komplett abgerechnet oder im Kassenmodus auf einen leeren Tisch geklickt wurde.", + "If this value is set to 'true' the mode of the desktop view automatically returns to the ordering after all products of the selected table are marked paid or an empty table was selected.", + "Si es 'si' el modus vuelve a ordenar despues de declarar todos los productos de la mesa estado pagado o si el usario ha seleccionado una mesa vacia."]; var MAN_WAITER_GOPAY_DESCR = ["Im Arbeitsablauf 'nur Arbeitsbons' bestimmt diese Einstellung, ob bei Druck auf den Button 'Kasse' Arbeitsbons gedruckt werden sollen.", "In the 'only work receipts' workflow this setting specifies if after pressing the 'paydesk' button in the waiter's view work receipts shall be printed.", "En el modus 'solo tiques de trabajar' este boton especifica se debe imprimido el tique de trabajar despues el click en el boton 'caja' en la vista de camarero."]; @@ -311,8 +314,10 @@ var MAN_CONFIRM_GO_LIVE = ["Die Umsatz- und Logdaten wurden gelöscht und nur di "La configuración esta re-creado. Entonces es necesario registrar de nuevo."]; var MAN_GENSECTION_TXT = ["Allgemeine Einstellungen:","General settings:","Configuración general:"]; var MAN_MOBILSECTION_TXT = ["Einstellungen für die Mobilansicht:","Settings for the mobil view:","Configuración para la vista mobil:"]; +var MAN_DESKTOP_SECTION_TXT = ["Einstellungen für die Desktop-Ansicht:","Settings for the desktop view","Configuración para la vista de PC"]; var MAN_PRINT_AND_QUEUE = ["Drucke Jobs und zeige sie auch in der Küchen-/Baransicht an","Print jobs and show them also in the kitchen/bar view","Imprimir orders y también inserta en la vista de cocina/bar"]; var MAN_CASH = ["Kassenfunktion aktiviert","Enabled cash function","Caja activada"]; +var MAN_RETURNTOORDER = ["Rücksprung Bestellung","Go back to order","Volver a ordenar"]; var MAN_BEEP_COOKED = ["Signalton, wenn neues Produkt serviert werden kann (experimentell)","Audio signal if new product can be served (experimental)","Señal audio si un producto nuevo esta cocinado"]; var MAN_RESTAURANT_MODE = ["Restaurantmodus","Restaurant mode","Usar para restaurantes"]; var MAN_REST_MODE_HINT = ["Hinweis: Wird der Restaurantmodus auf Nein gesetzt, wird in der Desktopansicht die Tischauswahl deaktiviert. Alle Produkte werden als Außer-Haus-Verkauf gebucht.","Hint: If the restautant mode is set to no in the desktop view the table selection is deactivated and all products are ordered as to-go","Nota: Si el modus del restaurante es configurado a no en la vista de Desktop la selección de las mesas es deactivada y todos los productos son ordenados como to-go"]; @@ -323,9 +328,11 @@ var MAN_HOTELINTERFACE = ["Anbindung Hotelsoftware","Interface hotel software"," var MAN_HSINFILE = ["HS/3 Datei HS3CASH.IN","HS/3 file HS3CASH.IN","HS/3 file HS3CASH.IN"]; var MAN_HSOUTFILE = ["HS/3 Datei HS3CASH.OUT","HS/3 file HS3CASH.OUT","HS/3 file HS3CASH.OUT"]; var MAN_HSCURRENCY = ["HS/3 Währungsangabe","HS/3 Currency","HS/3 Moneda"]; +var MAN_DEL_HINT = ["Zum Löschen anklicken","Click to delete","Click para removar"]; +var MAN_FONTSIZE_HINT = ["Die Schriftgröße hat nur Einfluss, wenn kein eigenes Layout festgelegt wurde.","The font size only effects receipts if they do not use a specified layout.","El valor sólo funciona si no se usa un layout individual."]; var lang = 0; -var generalVals = [12,2,0,3,0,1,1,0,0,1, 0,50,20,10,1,0,0,0,1,0,1,0,0,1]; +var generalVals = [12,2,0,3,0,1,1,0,0,1, 0,50,20,10,1,0,0,0,1,0,1,0,0,1,1]; var numberOfClosings = 0; @@ -366,6 +373,7 @@ var generalValuesSettings = [ ["cashenabled",MAN_CASH[lang],"s",20], ["beepcooked",MAN_BEEP_COOKED[lang],"s",21], ["restaurantmode",MAN_RESTAURANT_MODE[lang],"s",23], + ["returntoorder",MAN_CASH[lang],"s",24], ["addreceipttoprinter",MAN_ADD_RECPRINTER[lang],"s",16], ["workflowconfig",MAN_WORKFLOW[lang],"s",4], ["receiptfontsize",MAN_RECEIPT_FONTSIZE[lang],"s",0], @@ -374,14 +382,12 @@ var generalValuesSettings = [ ["remoteaccesscode",MAN_REMOTE_ACCESS[lang],"i",0,""], ["cancelunpaidcode",MAN_CANCEL_UNPAID_CODE[lang],"i",0,""], ["cancelguestcode",MAN_CANCEL_GUEST_CODE[lang],"i",0,""], - // REM SMTP settings ["smtphost",MAN_SMTPHOST[lang],"i",0,""], ["smtpauth",MAN_SMTPAUTH[lang],"s",5], ["smtpuser",MAN_SMTPUSER[lang],"i",0,""], ["smtppass",MAN_SMTPPASS[lang],"i",0,""], ["smtpsecure",MAN_SMTPSECURE[lang],"s",6], ["smtpport",MAN_SMTPPORT[lang],"i",0,""], -// // REM Web setting ["webimpressum",MAN_WEBIMPRESSUM[lang],"i",0,""], ["paydeskid",MAN_PAYDESKID[lang],"i",0,""], @@ -505,14 +511,17 @@ function setLanguage(l) { $("#digiprinthint").html(MAN_DIGI_PRINTWORK_HINT[l]); $("#generalsectiontxt").html(MAN_GENSECTION_TXT[l]); $("#mobilviewsectiontxt").html(MAN_MOBILSECTION_TXT[l]); + $("#desktopviewsectiontxt").html(MAN_DESKTOP_SECTION_TXT[l]); $("#specialsettingssectiontxt").html(MAN_SPECIAL_SETTINGS_TXT[l]); $("#printandqueuehint").html(MAN_PRINT_AND_QUEUE_HINT[l]); $("#cashhint").html(MAN_CASH_HINT[l]); + $("#returntoorderhint").html(MAN_RETURN_TO_ORDER_HINT[l]); $("#hsinfiletxt").html(MAN_HSINFILE[l]); $("#hsoutfiletxt").html(MAN_HSOUTFILE[l]); $("#hscurrencytxt").html(MAN_HSCURRENCY[l]); $("#restmodehint").html(MAN_REST_MODE_HINT[l]); + $("#workfontsizehint").html(MAN_FONTSIZE_HINT[l]); } function createMonthSelection(label) { @@ -616,6 +625,7 @@ function insertGeneralConfigItems(configResult) { $("#partOfDigiprintwork").html(createDigiprintwork(values.digiprintwork)); $("#partOfPrintAndQueueJobs").html(createPrintAndQueueJobs(values.printandqueuejobs)); $("#partOfCash").html(createCash(values.cashenabled)); + $("#partOfReturntoorder").html(createReturntoorder(values.returntoorder)); $("#partOfBeepCooked").html(createBeepCooked(values.beepcooked)); $("#partOfRestaurantmode").html(createRestaurantmode(values.restaurantmode)); @@ -666,6 +676,7 @@ function insertGeneralConfigItems(configResult) { generalVals[21] = values.beepcooked; generalVals[22] = values.hotelinterface; generalVals[23] = values.restaurantmode; + generalVals[24] = values.returntoorder; $("#smtphost").val(values.smtphost); $("#partOfSmtpauth").html(createSMTPAuth(values.smtpauth)); @@ -818,6 +829,9 @@ function createPrintAndQueueJobs(theValue) { function createCash(theValue) { return createYesNo("cashenabled",MAN_CASH, theValue); } +function createReturntoorder(theValue) { + return createYesNo("returntoorder",MAN_RETURNTOORDER, theValue); +} function createBeepCooked(theValue) { return createYesNo("beepcooked",MAN_BEEP_COOKED, theValue); } @@ -1180,7 +1194,6 @@ function binding() { $( "#nochangeddata" ).popup( "open", {transition: 'flip'} ); } else { areYouSure(MAN_CHANGE_CONFIG_HEAD[lang], MAN_CHANGE_CONFIG_CONTENT[lang] + changeInfoText, MAN_YES[lang], function() { - // test for validity var isValid = true; for (i=0;i' + MAN_CSV_EXP_ALL[lang] + ''; - // email buttons var receiverEmail = $("#receiveremail").val(); closingPart += '
    '; closingPart += '
    '; @@ -2136,9 +2145,6 @@ function setMonthYearSelection() { $("#select-year-export-end").selectmenu("refresh", true); } -// -// Functions for room plans -// function tablelist(no,rowId) { var i=0; @@ -2287,7 +2293,6 @@ function roomfield_apply() { n = parseInt(n); m = parseInt(m); if ((n>0) && (n<30) && (m>0) && (m<30)) { - // collect data now! var room_index, table_index, r_id, t_id; var rooms = []; for (room_index = 0; room_index < n; room_index++) { @@ -2318,13 +2323,54 @@ function roomfield_apply() { rooms.push(roominfo); } } - // setRoomInfo doAjax("POST","php/contenthandler.php?module=roomtables&command=setRoomInfo",{rooms:rooms},askForCurrentRoomField,"Raumplan nicht änderbar"); } } catch(e) {} } +function createSpooledPrintJobButton(id,text) { + var txt = ''; + return txt; +} + +function createSpooledRecPrintButtons(jobs) { + var currency = $("#admin-page").data("currency"); + var decpoint = $("#admin-page").data("decpoint"); + txt = ''; + for (var i=0;i 0) { + txt += "(" + MAN_DEL_HINT[lang] + ")"; + } + return txt; +} + +function createSpooledWorkPrintButtons(jobs) { + txt = ''; + for (var i=0;i 0) { + txt += "(" + MAN_DEL_HINT[lang] + ")"; + } + return txt; +} + +function bindSpooledPrintJob() { + $(".spooledprintjob").off("click").on("click", function (e) { + e.stopImmediatePropagation(); + e.preventDefault(); + var id = this.id.split("_")[1]; + doAjax("POST","php/contenthandler.php?module=printqueue&command=deleteSpooledPrintJob",{id:id},getSpooledPrintJobs,"Problem Printjob löschen"); + }); +} + function insertPrintQueue(queue) { if (queue.status == "OK") { var jobs = queue.msg; @@ -2332,7 +2378,7 @@ function insertPrintQueue(queue) { for (var i=0;i'; li += '
  • ' + printertxt + '
  • '; - li += '
  • ' + number + " " + MAN_PRINT_JOBS_COUNT[lang] + '
  • '; + li += '
  • ' + number + " " + MAN_PRINT_JOBS_COUNT[lang]; + if (printer < 7) { + li += createSpooledRecPrintButtons(jobs[i].jobs); + } else { + li += createSpooledWorkPrintButtons(jobs[i].jobs); + } + li += '
  • '; li += ''; } $("#printjobsarea").html(li); $("#printjobsarea").trigger("create"); + bindSpooledPrintJob(); } } @@ -2376,7 +2429,7 @@ $(document).on("pageinit", "#admin-page", function () { $("#userfile").val(''); - doAjax("GET","php/contenthandler.php?module=printqueue&command=getPrintJobOverview",null,insertPrintQueue,null); + getSpooledPrintJobs(); }); @@ -2385,14 +2438,14 @@ $(document).on("pageinit", "#admin-page", function () {
      -
    • Module
    • +
    • Hauptmenü

    Administration

    @@ -2624,7 +2677,10 @@ $(document).on("pageinit", "#admin-page", function () {
    -
    +
    +
    + Hinweis: Nicht für eigene Layouts +
    @@ -2698,6 +2754,13 @@ $(document).on("pageinit", "#admin-page", function () {
    +
    DESKTOPANSICHT

    + +
    +
    + Hinweis: siehe Anleitung +
    +
    Spezialeinstellungen

    @@ -2709,7 +2772,7 @@ $(document).on("pageinit", "#admin-page", function () {
    Hinweis: siehe Anleitung
    - +

      diff --git a/webapp/paydesk.html b/webapp/paydesk.html index 585321c..c9cf8f2 100644 --- a/webapp/paydesk.html +++ b/webapp/paydesk.html @@ -5,7 +5,7 @@ - + @@ -14,7 +14,7 @@ +var CALC_TIP=0;var CALC_TOTAL=1;var lang=0;var receiptfontsize=12;var paymentconfig=0;var decpoint=".";var currency="";var osroombtnsize=0;var ostablebtnsize=0;var osprodbtnsize=0;var hasRooms=true;var cameFromOrdering=0;var billbrutto=0;var billnetto=0;var prodsToPayList=[];var prodsToPayListGrouping=[];var payTable="";var prodsOnReceiptList=[];var prodsOnReceiptListGrouping=[];var calcmodus=CALC_TOTAL;var workflowconfig=0;var digigopaysetready=1;var onlyReceiptShown=0;var prodsToPayList=null;function initializeMainMenu(a){$.ajax({type:"GET",dataType:"json",url:"php/contenthandler.php?module=admin&command=getJsonMenuItemsAndVersion",async:false,success:function(c){$("#versioninfo").html(c.version+" ");if(c.loggedin==1){$("#loggedinuser").html(" "+c.user);var b='

  • Hauptmenü
  • ';$.each(c.menu,function(g,f){var e=f.name;var h=f.link;if((e!="Abmelden")&&(e!="Log out")&&(e!="Adios")){b+='
  • '+e+"
  • "}else{b+='
  • '+e+"
  • "}});$(a).empty().append(b).promise().done(function(){$(a).listview("refresh")});$("#menuswitch").show()}else{$("#menuswitch").hide()}},error:function(b){alert("Kommunikationsproblem zum Server bei Modulabfrage!")}});$(".modulebutton").off("click").on("click",function(c){var b=$(this).attr("href");doAjax("POST","php/contenthandler.php?module=admin&command=setLastModuleOfUser",{view:b},null,"Problem Benutzerdatenpflege")});intervalGetPrinterStatus(5)}function intervalGetPrinterStatus(b){doAjax("GET","php/contenthandler.php?module=admin&command=isPrinterServerActive",null,setPrinterStatus,null,true);var a=setInterval(function(){doAjax("GET","php/contenthandler.php?module=admin&command=isPrinterServerActive",null,setPrinterStatus,null,true)},b*1000)}function setPrinterStatus(a){if(a.status==="OK"){if(a.msg===0){$(".printerstatus").show();return}}$(".printerstatus").hide()}function hideMenu(){$("#modulepanel").panel("close");$("#menuswitch").off("click").on("click",function(a){$("#menuswitch").trigger("mouseout");a.stopImmediatePropagation();a.preventDefault();$("#modulepanel").panel("open")})}function refreshList(a){if($(a).hasClass("ui-listview")){$(a).listview("refresh")}else{$(a).trigger("create")}}function doAjax(a,b,f,e,c,g){if(typeof g==="undefined"){g=false}$.ajax({type:a,url:b,dataType:"json",data:f,async:g,success:function(h){if(e!=null){e(h)}},error:function(l,h,i){if(c!=null){var k=c+", Status: "+h+", Error:"+i+", Msg: "+l.responseText+" ("+b+")";alert("Kommunikationsfehler zum Server: "+k)}}})}function doAjaxAsync(a,b,e,c){$.ajax({type:a,url:b,dataType:"json",data:e,async:true,success:function(f){if(c!=null){c(f)}},error:function(h,f,g){}})}function doAjaxTransmitData(a,b,g,f,e,c){$.ajax({type:a,url:b,dataType:"json",data:g,async:false,success:function(h){if(f!=null){f(h,c)}},error:function(l,h,i){if(e!=null){var k=e+", Status: "+h+", Error:"+i+", Msg: "+l.responseText+" ("+b+")";alert("Kommunikationsfehler zum Server: "+k)}}})}function doAjaxSuppressError(a,b,f,e,c){$.ajax({type:a,url:b,dataType:"json",data:f,async:false,success:function(g){if(e!=null){e(g)}},error:function(g){e("ERROR")}})}function doAjaxNonJsonNonCall(a,b,c){$.ajax({type:a,data:c,url:b,async:false,error:function(e){alert("Kommunikationsproblem zum Server")}})}function toHtml(a){if(typeof a==="string"){return(a.replace(/"/g,""").replace(//g,">"))}else{return a}}function createExtraParagraph(b){if((b==null)||(b=="")){return""}var c="";for(var a=0;a+ "+toHtml(b[a])+"

    "}return c}function checkForLogIn(){doAjax("GET","php/contenthandler.php?module=admin&command=isUserAlreadyLoggedIn",null,handleTestForLoggedIn,null)}function handleTestForLoggedIn(a){if(a!="YES"){setTimeout(function(){document.location.href="index.html"},250)}}function isInt(a){if(Math.floor(a)==a&&$.isNumeric(a)){return true}else{return false}}var P_SUM=["Summe:","Sum:","Todo:"];var P_TOTAL=["Total","Total","Total"];var P_MWST=["MwSt","Tax","IVA"];var P_NETTO=["Netto","Net","Neto"];var P_BRUTTO=["Brutto","Gross","Bruto"];var P_ID=["Id:","Id:","Id:"];var P_TABLE=["Tisch:","Table:","Mesa:"];var P_WAITER=["Es bediente Sie:","Waiter:","Camarero:"];var P_NO=["Anz.","No.","Nú."];var P_DESCR=["Beschreibung","Description","Descripción"];var P_PRICE=["Preis","Price","Precio"];function createReceiptFooterFromDbTaxes(c,a,h,k,m){var b='style="border: solid black 0px;padding: 3px;text-align:right;vertical-align:bottom;"';var n='style="text-align:center;vertical-align:bottom;"';var f=" ";var l=f;l+=""+P_MWST[c]+"% "+P_MWST[c]+""+P_NETTO[c]+""+P_BRUTTO[c]+"";for(var g=0;g"+e.tax;l+=""+e.mwst.replace(".",m);l+=""+e.netto.replace(".",m);l+=""+e.brutto.replace(".",m);l+=""}l+=f;l+="   "+P_SUM[c]+'"+h.toFixed(2).replace(".",m)+"";l+=f;l+="
     
    ";l+=toHtml(a).replace(/(?:\r\n|\r|\n)/g,"
    ");l+="
    ";return l}function generateProdPart(k,b){var i=0;tablecontent="";for(i=0;i";return h}var tminfo=null;function insertTMInfo(a){tminfo=a}function Tablemap(b,a,c){this.tables=a;this.roomid=b;this.elem=c;this.selectedTableId=-1;if((a!=null)&&(a.length>0)){this.selectedTableId=a[0].id}}Tablemap.prototype.renderContent=function(){doAjaxTransmitData("GET","php/tablemap.php?command=getTableMap&roomid="+this.roomid,null,this.renderTableList,null,this);d=new Date();$("#mapimgpart").attr("src","php/tablemap.php?command=getTableMapImgAsPng&roomid="+this.roomid+"&tableid="+this.selectedTableId+"&"+d.getTime())};Tablemap.prototype.renderTableList=function(b,a){a.tables=b;var c=a.createList(b,"table_","tablebtn","c",a);$(a.elem).html(c);tmRefreshList(a.elem);a.binding(a)};Tablemap.prototype.createList=function(n,a,g,h,p){var m='
    ';for(var l=0;l'}m+="
    ";return m};Tablemap.prototype.binding=function(a){$(".tablebtn").off("click").on("click",function(b){b.stopImmediatePropagation();b.preventDefault();a.selectedTableId=this.id.split("_")[1];a.renderContent(a.elem)});$("#tmimgbtn").off("click").on("click",function(b){b.stopImmediatePropagation();b.preventDefault();a.uploadImg(a)});$("#mapimgpart").off("click").on("click",function(k){k.stopImmediatePropagation();k.preventDefault();var c=$("#mapimgpart").width();var b=$("#mapimgpart").height();var l=$(this).offset().top-$(window).scrollTop();var g=$(this).offset().left-$(window).scrollLeft();var i=Math.round((k.clientX-g));var h=Math.round((k.clientY-l));var f={tableid:a.selectedTableId,x:(100*i)/c,y:(100*h)/b};doAjaxTransmitData("POST","php/tablemap.php?command=setPosition",f,a.renderIfOk,null,a)})};Tablemap.prototype.createOverlay=function(y,h,o,v,f,k,u,n){if(typeof n==="undefined"){n=null}var q=[];var g="";if(u==0){g="overlaysize-0"}else{if(u==1){g="overlaysize-1"}else{if(u==2){g="overlaysize-2"}}}for(var x=0;x'+z;if(w!=0){r=''+z;if(o!=""){r+="
    ("+o+": "+l+")"}else{r+="
    ("+l+")"}}r+="
    ";q[q.length]=r}}return q};Tablemap.prototype.bindingForOverlaySelection=function(a,c,b,e){if(e!=null){$("#tablemapcontent:not(.overlaytxt)").off("click").on("click",function(f){f.stopImmediatePropagation();f.preventDefault();e()})}$("#tablemapcontent .overlaytxt").off("click").on("click",function(m){m.stopImmediatePropagation();m.preventDefault();var g=this.id.split("_")[1];var h="?";for(var f=0;f0)){var u=a[0].id;var n=a[0].name;var t=(100*100)+(100*100);for(var k=0;k'}k+="
    ";return k};Tablemap.prototype.uploadImg=function(a){var b=new FormData($("#tablemapimgform")[0]);b.append("roomid",a.roomid);$.ajax({url:"php/tablemap.php?command=uploadimg",type:"POST",dataType:"json",xhr:function(){var c=$.ajaxSettings.xhr();if(c.upload){}return c},success:function(c){if(c.status!="OK"){a.imgNotUploaded(c)}else{a.imgUploaded(c,a)}},error:function(c){a.imgNotUploaded(c)},data:b,cache:false,contentType:false,processData:false})};Tablemap.prototype.imgUploaded=function(b,a){a.renderContent()};Tablemap.prototype.imgNotUploaded=function(a){alert("Bild konnte nicht hochgeladen werden. Ist es zu groß (> 1 MB)? Oder wurde der Dateiname nicht angegeben?")};function shallDisplayRoom(c){var a=tminfo;if(tminfo==null){return{show:false}}for(var b=0;b";b.src="data:text/html;charset=utf-8,"+encodeURI(a);document.body.appendChild(b)}function Grouping(b,a){this.set=b;this.sortedset=[];this.group=function(){this.sortedset=[];for(var g=0;g Bestellansicht","-> Order view","-> Vista de Orden"];var P_TO_PAY=["Zu zahlen: ","To pay: ","Pagar total: "];var P_PAY_RETURN=["Zurück: ","Return: ","Torna: "];var P_CALC_PAYBACK=["Berechne","Calculate","Calcular"];var P_HAS_PAID=["Bezahlt: ","Paid: ","Pagado: "];var P_TOGO=["Außer-Haus-Verkauf","Sale with Tax No 2","Venta IVA 2"];var P_TIP=["nur Trinkg.: ","Only tip: ","Solo prop.: "];var P_TOTAL_INCL_TIP=["Zielbetrag:","Target pay:","Quiere pagar:"];var CALC_TIP_TXT=["Angabe extra Trinkg.","Do Tip separate","Propina individual"];var CALC_TOTAL_TXT=["Angabe inkl.Trinkg.","Do Tip incl.","Propina incl."];var P_GUESTS=["Gäste","Guests","Habitaciones"];var showHostTemplate=false;var guests=[];var internalguests=[];var hotelinterface=0;var PAYMENT_HS3=7;var PAYMENT_GUEST=8;var currentPaymentId=7;function getGeneralConfigItems(){doAjax("GET","php/contenthandler.php?module=admin&command=getGeneralConfigItems",null,insertGeneralConfigItems,"Fehler Konfigurationsdaten")}function getPayments(a){doAjax("GET","php/contenthandler.php?module=admin&command=getPayments",null,a,"Fehler Zahlungswege")}function insertGeneralConfigItems(b){if(b.status=="OK"){var a=b.msg;decpoint=a.decpoint;$("#info-page").data("decpoint",a.decpoint);currency=a.currency;var e=a.tax;var c=e.replace(".",decpoint);$("#info-page").data("usstGerVal",c);$("#info-page").data("usst",e);e=a.togotax;c=e.replace(".",decpoint);$("#info-page").data("togoTaxGerVal",c);$("#info-page").data("togotax",e);$("#info-page").data("companyinfo",a.companyinfo);$("#info-page").data("payPrintType",a.payprinttype);$("#info-page").data("currency",a.currency);$("#info-page").data("billlanguage",a.billlanguage);$("#info-page").data("userlanguage",a.userlanguage);receiptfontsize=parseInt(a.receiptfontsize);$("#receiptpart").css("font-size",receiptfontsize+"px");paymentconfig=a.paymentconfig;$("#curtopay2").html(" "+a.currency);workflowconfig=a.workflowconfig;digigopaysetready=a.digigopaysetready;setLanguage(a.userlanguage)}else{$("#contentpart").hide();setTimeout(function(){document.location.href="index.html"},250)}}function addEntryOrIncreaseCount(a,f){var c=0;var g=false;var e=f.prodid+"-"+f.extras.join("_")+f.price+"-"+f.pricelevelname+"#"+f.tax+"_"+f.togo;for(c=0;cID:"+e+"";g+=' ";g+=""+c+"";g+=" ";if(l!=""){g+="Gast: "+toHtml(l)+"";g+=" "}g+=""+P_NO[b]+""+P_DESCR[b]+""+P_PRICE[b]+""+P_TOTAL[b]+"";return g}function genCreateReceiptFooterNoSum(c,e,b,a){return genCreateReceiptFooter(c,e,b,"","","",a)}function genCreateReceiptFooter(a,f,b,k,e,m,n){var c='style="border: solid black 0px;padding: 3px;text-align:right;vertical-align:bottom;"';var p='style="text-align:center;vertical-align:bottom;"';var h=" ";var o=h;o+=""+P_MWST[f]+"% "+P_MWST[f]+""+P_NETTO[f]+""+P_BRUTTO[f]+"";for(var l=0;l"+k+'"+e+'"+m+""}o+=h;o+="   "+P_SUM[f]+'"+m+"";o+=h;o+="
     
    ";o+=toHtml(b).replace(/(?:\r\n|\r|\n)/g,"
    ");o+="
    ";return o}function generateOneProdLine(k,g,i,a,n,f){var b='style="border: solid black 0px;padding: 3px;text-align:right;vertical-align:bottom;"';var h='style="border: solid black 0px;padding: 3px;text-align:center;vertical-align:bottom;"';var c=(parseFloat(i)).toFixed(2).replace(".",n);if(a!="A"){g+=" ("+a+")"}if(f==1){g="To-Go: "+g}var m=k*i;var l="";var e='style="white-space: nowrap;overflow: hidden;text-overflow:ellipsis;width: 60%;"';l+="'+k+""+g;l=l+""+c;l+=""+m.toFixed(2).replace(".",n)+"";return l}function generateProdPartByDbContent(f,e){var c=0;tablecontent="";for(c=0;c=0);var m=(p.toLowerCase().indexOf(g)>=0);if(l||m){i++;h=toHtml(k+" - "+p);if(!c){c=true;f+='"}else{f+='"}}});if(i===1){$("#hotelroomfoundguest").html(h);$("#hotelroomselection").html(f)}else{$("#hotelroomselection").html(f)}if(b){$("#hotelroomselection").selectmenu("refresh")}}function setLanguage(b){$("#roomsel").html(P_ROOMSEL[b]);$("#oben").listview("refresh");lang=b;var a='
  • '+P_PAYDESK_ACTIONS[lang]+'
  • '+P_BAR_INPUT[lang]+'
  • '+P_BAR_GET[lang]+'
  • '+P_BAR_SUM[lang]+"
  • ";$("#cashactions").html(a);$("#cashactions").listview("refresh");$("#navtitle").html(P_NAV[lang]);$("#nav2order").html(P_ORDER_ACTION[lang]);$("#navactions").listview("refresh");$("#paydesktitle").html(P_TITLE[lang]);$("#OnlyPayTxt").html(P_ONLY_PAY[lang]);$("#payprinttxt").html(P_PAY_PRINT[lang]);$("#payway").html(P_CHANGE_CALC[lang]);$("#choosepayway").html(P_CHOOSE_PAYWAY[lang]);$("#canceltxt").html(P_CANCEL[lang]);$("#cancelroomselectiontxt").html(P_CANCEL[lang]);$("#cashtakeouttxt").html(P_CASHTAKEOUT[lang]);$("#amounttxt").html(P_AMOUNT[lang]);$("#amounttxt2").html(P_AMOUNT[lang]);$("#cashtakeintxt").html(P_CASHTAKIN[lang]);$("#cashoverviewtxt").html(P_OVERVIEW[lang]);$("#putinact").html(P_PUT_IN[lang]);$("#takeoutact").html(P_TAKE_OUT[lang]);$("#overviewdetails").html(P_OVERV_DETAILS[lang]);$("#cashsum").html(P_CASH_SUM[lang]);$("#includeowncash").html(P_INCLUDE_OWN[lang]);$("#noelementstxt").html(P_NO_ELEM[lang]);$("#noelementsdetailstxt").html(P_NO_ELEM_DETAILS[lang]);$("#topaytxt").html(P_TO_PAY[lang]);$("#rettxt").html(P_PAY_RETURN[lang]);$("#calcreturn").html(P_CALC_PAYBACK[lang]);$("#haspaidtxt").html(P_HAS_PAID[lang]);$("#tableselimmaptxt").html(P_TABLE_SEL[lang]);setCalcModusBtn()}function getButtonSizes(){doAjax("GET","php/contenthandler.php?module=admin&command=getButtonSizes",null,fillButtonSizes,"Keine Buttongroesseninformation")}function fillButtonSizes(a){osroombtnsize=a.roombtnsize;ostablebtnsize=a.tablebtnsize;osprodbtnsize=a.prodbtnsize}function getProdSizeClass(){if(osprodbtnsize==1){return("osprod-1")}else{if(osprodbtnsize==2){return("osprod-2")}else{return""}}}function getTableSizeClass(){if(ostablebtnsize==1){return("ostable-1")}else{if(ostablebtnsize==2){return("ostable-2")}else{return""}}}function getRoomSizeClass(){if(osroombtnsize==1){return("osroom-1")}else{if(osroombtnsize==2){return("osroom-2")}else{return""}}}function insertPayments(f){var e=f.payments;hotelinterface=f.hotelinterface;guests=f.guests;internalguests=f.internalguests;var c="";var a=20;if(paymentconfig==1){a=2}var b=false;$.each(e,function(h,g){if(h'+g.name+"";if(!b){c+="


    ";b=true}}});c+=''+P_CANCEL[lang]+"";$("#paymentlist").html(c)}function hideReceiptPart(){$("#payWithoutPrint").hide();$("#payWithPrint").hide();$("#hostbutton").hide();$("#unten").hide()}function showReceiptPart(){$("#payWithoutPrint").show();$("#payWithPrint").show();$("#hostbutton").show();$("#unten").show();$("#tablemapcontent").hide();$("#togoarea").hide()}function getTableMapPreferences(){doAjax("GET","php/tablemap.php?command=getTableMapPreferences",null,insertTMInfoAndStartDisplayProc,"Keine TM-Information")}function insertTMInfoAndStartDisplayProc(a){tminfo=a;startDisplayProcess()}function handleClickInTablemap(a){checkForLogIn();$("#info-page").data("roomid",null);$("#info-page").data("tableviewactive",0);$("#info-page").data("tid",a.tableid);$("#info-page").data("tablename",a.tablename);$("#oben").show();getProdsToPayForTable(a.tableid,a.tablename)}function displayAllRooms(){checkForLogIn();$("#moneyToInsert").val("");$("#moneyToTakeOut").val("");$("#cashactions").show();$("#navactions").show();$("#remarkin").val("");$("#remarkout").val();hideReceiptPart();var a=$("#info-page").data("billlanguage");$("#prodlistinreceipt").empty().append(''+P_NO[a]+""+P_DESCR[a]+''+P_PRICE[a]+''+P_TOTAL[a]);$.getJSON("php/contenthandler.php?module=roomtables&command=getRooms",function(f){var g=f.roomstables;var c=f.takeawayprice;var h=g.length;if(h==1){$("#info-page").data("roomid",g[0]["id"]);displayTablesOfRoom(g[0],false);if(cameFromOrdering==1){$("#startpaypage").show()}else{$("#startpaypage").hide()}}else{var b="";var e=getRoomSizeClass();$.each(g,function(l,k){b+='
  • '+k.name+"
  • "});if(c!="0.00"){b+='
  • '+P_TOGO[a]+" ("+c+" "+currency+")
  • "}$("#startpaypage").hide();$("#oben").append(b).promise().done(function(){bindTogoOrdering();$(this).off("click").on("click","a",function(k){k.stopImmediatePropagation();k.preventDefault();var i=g[this.id];$("#info-page").data("roomid",i.id);$("#startpaypage").show();displayTablesOfRoom(i,true)});refreshList(this)})}})}function bindTogoOrdering(){$(".togoorder").off("click").on("click",function(a){a.stopImmediatePropagation();a.preventDefault();$("#info-page").data("roomid",null);$("#info-page").data("tableviewactive",0);$("#info-page").data("tid",0);$("#info-page").data("tablename",P_TOGO[lang]);$("#oben").show();getProdsToPayForTable(0,"")})}function displayTablesOfRoom(a,b){checkForLogIn();hasRooms=b;var c=$("#info-page").data("roomid");hideReceiptPart();displayUnpaidTables("Tischinfo nicht erhalten!")}$(document).ready(function(){checkForLogIn();var a=setInterval(function(){var b=$("#info-page").data("roomid");if(b!=null){displayUnpaidTables(null)}},10000);$.ajaxSetup({cache:false})});function displayUnpaidTables(a){doAjax("GET","php/contenthandler.php?module=roomtables&command=getUnpaidTables",{roomid:$("#info-page").data("roomid")},displayTables,a)}function displayTables(f){var i=f.tables;var e=f.takeawayprice;$("#info-page").data("tableviewactive",1);var a=$("#info-page").data("roomid");var g=shallDisplayRoom(a);if(g.show){$("#oben").hide();$("#tablemapcontent").show();$("#togoarea").show();d=new Date();$("#mapimgpart").attr("src","php/tablemap.php?command=getUnpaidTablesMapImgAsPng&showBubbles=0&roomid="+a+"&"+d.getTime());var b=new Tablemap(a,null,"");var c=b.createOverlay("#mapimgpart",g.pos,"",decpoint,currency,i,ostablebtnsize);$("#tableoverlay").html(c);b.bindingForOverlaySelection(handleClickInTablemap.bind(this),a,i,null);if(!hasRooms){if(e!="0.00"){var h='
  • '+P_TOGO[lang]+"
  • ";$("#tables-list-togo").html(h);$("#togoarea").show()}refreshList("#tables-list-togo");bindTogoOrdering()}}else{$("#oben").show();$("#tablemapcontent").hide();$("#togoarea").hide();var h='
  • '+P_TABLE_SEL[lang]+"
  • ";var k=getTableSizeClass();$.each(i,function(m,o){var n=o.pricesum.replace(".",decpoint);var l=o.name+"    ("+n+" "+currency+")";h+='
  • '+l+"
  • "});if(!hasRooms){if(e!="0.00"){h+='
  • '+P_TOGO[lang]+"
  • "}}$("#oben").empty().append(h).promise().done(function(){bindTogoOrdering();$(this).off("click").on("click",".info-go",function(n){n.stopImmediatePropagation();n.preventDefault();$("#info-page").data("roomid",null);$("#info-page").data("tableviewactive",0);var l=i[this.id]["id"];var m=i[this.id]["name"];$("#info-page").data("tid",l);$("#info-page").data("tablename",m);getProdsToPayForTable(l,m)});refreshList(this)})}}function getProdsToPayForTable(a,b){$("#startpaypage").show();if(a==0){b=P_TOGO[lang];$("#info-page").data("taxtype","togo")}else{$("#info-page").data("taxtype","normal")}$("#cashactions").hide();$("#navactions").hide();$.ajax({type:"GET",dataType:"json",data:{tableid:a},url:"php/contenthandler.php?module=queue&command=getJsonProductsOfTableToPay",async:false,success:function(e){var c=e.status;var f=e.msg;if(c!="ERROR"){showReceiptPart();prodsToPayList=f;$("#info-page").data("tableprods",f);bindPayButton(f,a,b);initiatePayableView(f,b)}else{alert("Fehler: "+f)}},error:function(c){alert("Sorry, there was a problem getting the products to pay for table!")}})}function initiatePayableView(a,b){$("#tableinreceipt").html(b+"
     ");clearUntenAndReceipt();createAllEntriesInReceipt();calcSum();prodsToPayList=a;payTable=b;displayProdsToPayForTable();bindingPressReceipt()}function bindingPressReceipt(){$(".receipttable").off("click").on("click",function(a){a.stopImmediatePropagation();a.preventDefault();if(onlyReceiptShown===1){$("#oben").show();$("#unten").show();$("#paybuttongroup").show();$("#hostbuttongroup").show();$(".receipttable").css("width","70%")}else{$("#oben").hide();$("#unten").hide();$("#paybuttongroup").hide();$("#hostbuttongroup").hide();$(".receipttable").css("width","100%")}onlyReceiptShown=1-onlyReceiptShown})}function displayProdsToPayForTable(){prodsToPayListGrouping=new Grouping(prodsToPayList,createHashOfPayableItem);prodsToPayListGrouping.group();var b=getProdSizeClass();var a='
  • '+P_NOT_PAID[lang]+payTable+"
  • ";a+='
  • '+P_ALL[lang]+"
  • ";var c=a+prodsToPayListGrouping.outputList(createPayableItemListElement);$("#oben").html(c);refreshList("#oben");$(".payable").off("click").on("click",function(h){h.stopImmediatePropagation();h.preventDefault();var g=$(this).closest("li");var i=$("#oben li").index(g)-2;var f=prodsToPayListGrouping.popSortedEntry(i);prodsOnReceiptList[prodsOnReceiptList.length]=f;displayProdsToPayForTable();displayProdsOnReceipt()});$("#payall").off("click").on("click",function(g){g.stopImmediatePropagation();g.preventDefault();for(var f=0;f0,00 '+currency+"

    ";var c=a+prodsOnReceiptListGrouping.outputList(createOnReceiptItemListElement);$("#unten").html(c);refreshList("#unten");createAllEntriesInReceipt();$(".onreceipt").off("click").on("click",function(h){h.stopImmediatePropagation();h.preventDefault();var g=$(this).closest("li");var i=$("#unten li").index(g)-1;var f=prodsOnReceiptListGrouping.popSortedEntry(i);prodsToPayList[prodsToPayList.length]=f;displayProdsToPayForTable();displayProdsOnReceipt()})}function generateListItem(g,c,h,e,f){var b=getProdSizeClass();var a='
  • ';a+=''+e+"
  • ";return a}function createHashOfPayableItem(b){var a=b.longname;if(b.pricelevelname!="A"){a+=" ("+b.pricelevelname+")"}a+=" - "+(parseFloat(b.price).toFixed(2).replace(".",decpoint));if(b.togo==1){a="To-Go: "+a}var c=createExtraParagraph(b.extras);return toHtml(a)+c}function createPayableItemListElement(b){var a="";if("count" in b){if(b.count>1){a=b.count+"x "}}var c=generateListItem("c","plus","payable_"+b.id,a+createHashOfPayableItem(b),"payable");return c}function createOnReceiptItemListElement(b){var a="";if("count" in b){if(b.count>1){a=b.count+"x "}}var c=generateListItem("c","plus","payable_"+b.id,a+createHashOfPayableItem(b),"onreceipt");return c}function clearUntenAndReceipt(){var a='
  • ';a+=P_CONTENT_RECEIPT[lang]+':

    0,00 '+currency+"

  • ";$("#unten").empty().append(a).promise().done(function(){refreshList("#unten")});$("#prodlistinreceipt tr").each(function(){$(this).remove()});$("#thedate").html("

     
    ")}function createAllEntriesInReceipt(){var a=new Array();for(var e=0;e'+$("#receiptpart").html()+"";var q=$("#info-page").data("payPrintType");if(q=="s"){printBill(billid)}else{$("#oben").hide();var u=""+$(".receipttable").html()+"
    ";printContent(u)}}prodsOnReceiptList=[];getProdsToPayForTable(b,k);var i=$("#oben li").size()-2;if(i>0){}else{if(cameFromOrdering==1){goToUrl("waiter.html")}else{goToUrl("paydesk.html")}}}}else{alert("Fehler: "+s)}},error:function(i){alert("Sorry, there was a problem! "+i)}})}function goToUrl(a){setTimeout(function(){document.location.href=a},500)}function cashactions(){$(".cashaction").off("click").on("click",function(a){var b=$(this).attr("id");if(b=="cashtakeout"){startCashTakeOutProcess()}else{if(b=="cashinsert"){startCashInsertProcess()}else{if(b=="cashoverview"){startCashOverviewProcess()}}}})}function startCashInsertProcess(){$("#cashinsertdialog .sure-do").off("click").on("click",function(){$.mobile.changePage("#info-page");var a=$("#moneyToInsert").val().replace($("#info-page").data("decpoint"),".");var b=$("#remarkin").val();if(isNaN(a)){alert("Keine Zahl!")}else{if((parseFloat(a)>=0)&&(parseFloat(a)<=10000)){doCashInsert(a,b)}else{alert("Betrag muss positiv und kleiner als 10000 sein!")}}});$.mobile.changePage("#cashinsertdialog");removeInputValsCashIn()}function removeInputValsCashOut(){setTimeout(function(){$("#moneyToTakeOut").val("");$("#remarkout").val("")},1000)}function removeInputValsCashIn(){setTimeout(function(){$("#moneyToInsert").val("");$("#remarkin").val("")},1000)}function startCashTakeOutProcess(){$("#cashtakeoutdialog .sure-do").off("click").on("click",function(){$.mobile.changePage("#info-page");var a=$("#moneyToTakeOut").val().replace(decpoint,".");var b=$("#remarkout").val();if(isNaN(a)){alert("Keine Zahl!")}else{if((parseFloat(a)>=0)&&(parseFloat(a)<=10000)){doCashTakeOut(a,b)}else{alert("Betrag muss positiv und kleiner als 10000 sein!")}}});$.mobile.changePage("#cashtakeoutdialog");removeInputValsCashOut()}function doCashInsert(a,b){doAjax("POST","php/contenthandler.php?module=bill&command=doCashAction",{money:a,remark:b},handleCashActionResult,"Fehler Kassenaktion")}function doCashTakeOut(a,b){a=0-parseFloat(a);doAjax("POST","php/contenthandler.php?module=bill&command=doCashAction",{money:a,remark:b},handleCashActionResult,"Fehler Kassenaktion")}function startCashOverviewProcess(){doAjax("POST","php/contenthandler.php?module=bill&command=getCashOverviewOfUser",null,showCashOverview,"Fehler Kassenaktion")}function handleCashActionResult(a){if(a.status=="ERROR"){alert("Fehler "+a.code+": "+a.msg)}else{if(a.status=="OK"){alert(P_CASHACTION_OK[lang])}}}function showCashOverview(a){$("#cashbyguests").html((parseFloat(a.guestmoney).toFixed(2)).replace(".",decpoint));$("#cashtotal").html((parseFloat(a.total).toFixed(2)).replace(".",decpoint));$.mobile.changePage("#cashoverviewinfo")}function startDisplayProcess(){var b=location.search;if(b.indexOf("t=")<0){displayAllRooms()}else{var e="";var g=b.split(/&|\?/);for(var a=0;a @@ -38,13 +38,13 @@ var CALC_TIP=0;var CALC_TOTAL=1;var lang=0;var receiptfontsize=12;var paymentcon
      -
    • Module
    • +
    • Hauptmenü

    Kasse

    diff --git a/webapp/php/admin.php b/webapp/php/admin.php index 573d05a..a4a84ff 100644 --- a/webapp/php/admin.php +++ b/webapp/php/admin.php @@ -287,7 +287,6 @@ class Admin { echo json_encode("Yes"); } } else { - // not defined -> it must be version 1.0.3 or lower --> since this is file of 1.0.4: not installed... echo json_encode("No"); } } @@ -349,7 +348,6 @@ class Admin { session_start(); } if (!isset($_SESSION['angemeldet']) || !$_SESSION['angemeldet']) { - // no user logged in echo json_encode("NO"); } else { echo json_encode("YES"); @@ -378,7 +376,6 @@ class Admin { } } - // for the login mask - if user is authenticated then the first page works different function tryAuthenticate($userid,$password,$modus,$day,$month,$year,$hour,$minute,$unixtime) { $pdo = DbUtils::openDbAndReturnPdoStatic(); @@ -430,7 +427,6 @@ class Admin { $_SESSION['angemeldet'] = true; - // now read the rights of the user $_SESSION['userid'] = $zeile['id']; $_SESSION['currentuser'] = $username; @@ -721,7 +717,7 @@ class Admin { return; } - $configItems = join(",",array("'decpoint'","'version'","'cancelunpaidcode'","'tax'","'togotax'","'taxaustrianormal'","'taxaustriaerm1'","'taxaustriaerm2'","'taxaustriaspecial'","'currency'","'workflowconfig'","'prominentsearch'","'discount1'","'discount2'","'discount3'","'waitergopayprint'","'cashenabled'","'restaurantmode'")); + $configItems = join(",",array("'decpoint'","'version'","'cancelunpaidcode'","'tax'","'togotax'","'taxaustrianormal'","'taxaustriaerm1'","'taxaustriaerm2'","'taxaustriaspecial'","'currency'","'workflowconfig'","'prominentsearch'","'discount1'","'discount2'","'discount3'","'waitergopayprint'","'cashenabled'","'returntoorder'","'restaurantmode'")); $sql = "select name,setting FROM %config% WHERE name in ($configItems)"; $stmt = $pdo->prepare(DbUtils::substTableAlias($sql)); $stmt->execute(); @@ -813,6 +809,7 @@ class Admin { $addreceipttoprinter = CommonUtils::getConfigValue($pdo,"addreceipttoprinter",""); $printandqueuejobs = CommonUtils::getConfigValue($pdo,"printandqueuejobs",0); $cashenabled = CommonUtils::getConfigValue($pdo,"cashenabled",1); + $returntoorder = CommonUtils::getConfigValue($pdo,"returntoorder",1); $beepcooked = CommonUtils::getConfigValue($pdo,"beepcooked",0); $restaurantmode = CommonUtils::getConfigValue($pdo,"restaurantmode",1); @@ -868,7 +865,7 @@ class Admin { "austria" => $austria, "digigopaysetready" => $digigopaysetready, "waitergopayprint" => $waitergopayprint, "oneprodworkreceipts" => $oneprodworkreceipts, "digiprintwork" => $digiprintwork, "memorylimit" => $memorylimit, "hs3refresh" => $hs3refresh, "paydeskid" => $paydeskid, "aeskey" => $aeskey, "certificatesn" => $certificatesn, "addreceipttoprinter" => $addreceipttoprinter, - "printandqueuejobs" => $printandqueuejobs, "cashenabled" => $cashenabled, "beepcooked" => $beepcooked,"restaurantmode" => $restaurantmode + "printandqueuejobs" => $printandqueuejobs, "cashenabled" => $cashenabled, "returntoorder" => $returntoorder, "beepcooked" => $beepcooked,"restaurantmode" => $restaurantmode ); if ($forHtml) { @@ -897,7 +894,6 @@ class Admin { $right_rating = $_SESSION['right_rating']; if (self::isOnlyRatingUser($rights, $right_rating, true)) { - // rating user always goes into that view - important setting after creation of user echo json_encode("rating.html"); return; } @@ -928,7 +924,6 @@ class Admin { } } - // test if user has still the right to go into that view $mapping = array ( "waiter.html" => 'right_waiter', "kitchen.html" => 'right_kitchen', @@ -946,7 +941,6 @@ class Admin { $valid = false; if (($view == 'preferences.html') || ($view == 'feedback.html')) { - // always ok $valid = true; } else if ($view == 'manager.html') { if (($_SESSION['is_admin'] == 1) || ($_SESSION['right_manager'] == 1) || ($_SESSION['right_closing'] == 1)) { @@ -961,11 +955,10 @@ class Admin { $view = "preferences.html"; } - echo json_encode($view . "?v=1.3.1"); + echo json_encode($view . "?v=1.3.2"); } } - // for client request function isLoggedinUserAdmin() { if ($this->isCurrentUserAdmin()) { echo json_encode(YES); @@ -1028,14 +1021,12 @@ class Admin { session_start(); } if (!isset($_SESSION['angemeldet']) || !$_SESSION['angemeldet']) { - // no user logged in return false; } else { return ($_SESSION[$whichRight]); } } - // for internal request function isCurrentUserAdmin() { return $this->hasCurrentUserRight('is_admin'); } @@ -1101,7 +1092,6 @@ class Admin { private function fillSampleContent() { $pdo = DbUtils::openDbAndReturnPdoStatic(); - // first remove previous content, then fill the SQL file $sql = "DELETE FROM `%queue%`"; $stmt = $pdo->prepare(DbUtils::substTableAlias($sql)); $stmt->execute(); @@ -1139,7 +1129,6 @@ class Admin { $waiterMessage = ""; $loggedIn = true; if (!isset($_SESSION['angemeldet']) || !$_SESSION['angemeldet']) { - // no user logged in $mainMenu[] = array("name" => "Startseite", "link" => "index.html"); $loggedIn = false; } else { @@ -1168,25 +1157,25 @@ class Admin { if (!self::isOnlyRatingUser($rights, $right_rating, true)) { if ($_SESSION['modus'] == 0) { - if ($_SESSION['right_waiter']) { $mainMenu[] = array("name" => $waitertxt[$lang], "link" => "waiter.html?v=1.3.1"); }; + if ($_SESSION['right_waiter']) { $mainMenu[] = array("name" => $waitertxt[$lang], "link" => "waiter.html?v=1.3.2"); }; } else { - if ($_SESSION['right_waiter']) { $mainMenu[] = array("name" => $waiterdesktxt[$lang], "link" => "waiterdesktop.php?v=1.3.1"); }; + if ($_SESSION['right_waiter']) { $mainMenu[] = array("name" => $waiterdesktxt[$lang], "link" => "waiterdesktop.php?v=1.3.2"); }; } - if ($_SESSION['right_kitchen']) { $mainMenu[] = array("name" => $kitchentxt[$lang], "link" => "kitchen.html?v=1.3.1"); }; - if ($_SESSION['right_bar']) { $mainMenu[] = array("name" => "Bar", "link" => "bar.html?v=1.3.1"); }; - if ($_SESSION['right_supply']) { $mainMenu[] = array("name" => $supplytxt[$lang], "link" => "supplydesk.html?v=1.3.1"); }; + if ($_SESSION['right_kitchen']) { $mainMenu[] = array("name" => $kitchentxt[$lang], "link" => "kitchen.html?v=1.3.2"); }; + if ($_SESSION['right_bar']) { $mainMenu[] = array("name" => "Bar", "link" => "bar.html?v=1.3.2"); }; + if ($_SESSION['right_supply']) { $mainMenu[] = array("name" => $supplytxt[$lang], "link" => "supplydesk.html?v=1.3.2"); }; if ($_SESSION['modus'] == 0) { - if ($_SESSION['right_paydesk']) { $mainMenu[] = array("name" => $paydesktxt[$lang], "link" => "paydesk.html?v=1.3.1"); }; + if ($_SESSION['right_paydesk']) { $mainMenu[] = array("name" => $paydesktxt[$lang], "link" => "paydesk.html?v=1.3.2"); }; } - if ($_SESSION['right_statistics']) { $mainMenu[] = array("name" => $stattxt[$lang], "link" => "reports.html?v=1.3.1"); }; - if ($_SESSION['right_bill']) { $mainMenu[] = array("name" => $bontxt[$lang], "link" => "bill.html?v=1.3.1"); }; - if ($_SESSION['right_products']) { $mainMenu[] = array("name" => $prodtxt[$lang], "link" => "products.html?v=1.3.1"); }; - if ($_SESSION['right_reservation']) { $mainMenu[] = array("name" => $restxt[$lang], "link" => "reservation.html?v=1.3.1"); }; - if ($_SESSION['right_rating']) { $mainMenu[] = array("name" => $ratingtxt[$lang], "link" => "rating.html?v=1.3.1"); }; - if ($_SESSION['right_customers']) { $mainMenu[] = array("name" => $customerstxt[$lang], "link" => "customers.html?v=1.3.1"); }; - if ($_SESSION['right_manager'] || $_SESSION['is_admin'] || $_SESSION['right_closing']) { $mainMenu[] = array("name" => $admintxt[$lang], "link" => "manager.html?v=1.3.1"); }; - $mainMenu[] = array("name" => $settingtxt[$lang], "link" => "preferences.html?v=1.3.1"); - $mainMenu[] = array("name" => "Feedback", "link" => "feedback.html?v=1.3.1"); + if ($_SESSION['right_statistics']) { $mainMenu[] = array("name" => $stattxt[$lang], "link" => "reports.html?v=1.3.2"); }; + if ($_SESSION['right_bill']) { $mainMenu[] = array("name" => $bontxt[$lang], "link" => "bill.html?v=1.3.2"); }; + if ($_SESSION['right_products']) { $mainMenu[] = array("name" => $prodtxt[$lang], "link" => "products.html?v=1.3.2"); }; + if ($_SESSION['right_reservation']) { $mainMenu[] = array("name" => $restxt[$lang], "link" => "reservation.html?v=1.3.2"); }; + if ($_SESSION['right_rating']) { $mainMenu[] = array("name" => $ratingtxt[$lang], "link" => "rating.html?v=1.3.2"); }; + if ($_SESSION['right_customers']) { $mainMenu[] = array("name" => $customerstxt[$lang], "link" => "customers.html?v=1.3.2"); }; + if ($_SESSION['right_manager'] || $_SESSION['is_admin'] || $_SESSION['right_closing']) { $mainMenu[] = array("name" => $admintxt[$lang], "link" => "manager.html?v=1.3.2"); }; + $mainMenu[] = array("name" => $settingtxt[$lang], "link" => "preferences.html?v=1.3.2"); + $mainMenu[] = array("name" => "Feedback", "link" => "feedback.html?v=1.3.2"); } $mainMenu[] = array("name" => $logout[$lang], "link" => "logout.php"); @@ -1194,8 +1183,7 @@ class Admin { $waiterMessage = $this->getMessage(null, "waitermessage"); } - // CAUTION: change version also in config.txt!!! - $mainMenuAndVersion = array ("version" => "OrderSprinter 1.3.1", + $mainMenuAndVersion = array ("version" => "OrderSprinter 1.3.2", "user" => $currentUser, "menu" => $mainMenu, "waitermessage" => $waiterMessage, @@ -1289,7 +1277,6 @@ class Admin { echo json_encode(array("status" => "ERROR", "code" => ERROR_NAME_EXISTS_ALREADY, "msg" => ERROR_NAME_EXISTS_ALREADY_MSG)); return; } else { - // create the new user if(session_id() == '') { session_start(); @@ -1300,7 +1287,6 @@ class Admin { echo json_encode(array("status" => "ERROR", "code" => ERROR_COMMAND_NOT_ADMIN, "msg" => ERROR_COMMAND_NOT_ADMIN_MSG)); return; } else { - // instead if password_hash (PHP > 5.5) use MD5... $password_hash = md5($password); $keys = array('id','userpassword','language'); @@ -1331,7 +1317,6 @@ class Admin { } } - // now this has to be logged in the history tables... HistFiller::createUserInHist($pdo,$lastId); } @@ -1473,6 +1458,7 @@ class Admin { "cancelguestcode" => array("dbcol" => "cancelguestcode","checknum" => 0), "printandqueuejobs" => array("dbcol" => "printandqueuejobs","checknum" => 0), "cashenabled" => array("dbcol" => "cashenabled","checknum" => 0), + "returntoorder" => array("dbcol" => "returntoorder","checknum" => 0), "beepcooked" => array("dbcol" => "beepcooked","checknum" => 0), "restaurantmode" => array("dbcol" => "restaurantmode","checknum" => 0), "smtphost" => array("dbcol" => "smtphost","checknum" => 0), @@ -1495,7 +1481,6 @@ class Admin { $aVal = $aChangeSet['value']; if ($name == "payprinttype") { - // special care: 1->l 2->s if (((string)$aVal) == "1") { $aVal = "l"; } @@ -1567,7 +1552,6 @@ class Admin { } function changeOneConfigDbItem($pdo,$theItem,$theValue,$table,$doHist) { - // is the value already there, or has it to be created? $sql = "SELECT setting from $table WHERE name=?"; $stmt = $pdo->prepare(DbUtils::substTableAlias($sql)); @@ -1585,7 +1569,6 @@ class Admin { } if ($doHist) { - // now this has to be logged in the history tables... $this->histfiller->updateConfigInHist($pdo,$theItem, $theValue); } } @@ -1600,7 +1583,6 @@ class Admin { } function updateUser() { - // get the name of the user $pdo = DbUtils::openDbAndReturnPdoStatic(); $theUserId = $_POST['userid']; @@ -1675,7 +1657,6 @@ class Admin { function getCurrentUser() { if (!isset($_SESSION['angemeldet']) || !$_SESSION['angemeldet']) { - // no user logged in echo json_encode("Nobody"); } else { echo json_encode($_SESSION['currentuser']); @@ -1796,7 +1777,6 @@ class Admin { } if ($ok) { - // allowed to change password $newp_hash = md5($newpassword); $sql = "UPDATE %user% set userpassword=? WHERE active='1' AND username=?"; $stmt = $pdo->prepare(DbUtils::substTableAlias($sql)); @@ -2077,13 +2057,40 @@ class Admin { $version = $genInfo["version"]; $timezone = DbUtils::getTimeZone(); + + $dbContent = json_decode($content,true); + + foreach($dbContent as $table) { + if ($table['table'] == 'config') { + + $foundConfigItem = null; + foreach($table['content'] as $aConfigItem) { + foreach($aConfigItem as $aConfigDbPart) { + if (($aConfigDbPart['fieldname'] == 'name') && ($aConfigDbPart['value'] == 'version')) { + $foundConfigItem = $aConfigItem; + break; + } + } + } + if (!is_null($foundConfigItem)) { + foreach($foundConfigItem as $aConfigDbPart) { + if ($aConfigDbPart['fieldname'] == 'setting') { + $bakVersion = base64_decode($aConfigDbPart['value']); + if ($bakVersion != $version) { + header("Location: ../infopage.html?e=manager.html=Backup_hat_die_falsche_Version:_$bakVersion."); + exit(); + } + } + } + } + + } + } $basedb->dropTables($pdo); $basedb->createEmptyTables($pdo); - $dbContent = json_decode($content,true); - $typeIsOnlyConfig = true; foreach($dbContent as $table) { @@ -2153,7 +2160,6 @@ class Admin { } $pdo->commit(); - // logout (by the restore other user or rights may have been applied) if(session_id() == '') { session_start(); } diff --git a/webapp/php/bill.php b/webapp/php/bill.php index f07e10a..f99e84c 100644 --- a/webapp/php/bill.php +++ b/webapp/php/bill.php @@ -36,7 +36,6 @@ class Bill { function handleCommand($command) { if ($command == 'exportCsv') { if ($this->hasCurrentUserAdminOrManagerRights()) { - // yes, we can export the data $this->exportCsv($_GET['startMonth'],$_GET['startYear'],$_GET['endMonth'],$_GET['endYear'],DO_CSV); } else { echo json_encode(array("status" => "ERROR", "code" => ERROR_BILL_NOT_AUTHOTRIZED, "msg" => ERROR_BILL_NOT_AUTHOTRIZED_MSG)); @@ -45,7 +44,6 @@ class Bill { } if ($command == 'exportXlsx') { if ($this->hasCurrentUserAdminOrManagerRights()) { - // yes, we can export the data $this->exportCsv($_GET['startMonth'],$_GET['startYear'],$_GET['endMonth'],$_GET['endYear'],DO_EXCEL); } else { echo json_encode(array("status" => "ERROR", "code" => ERROR_BILL_NOT_AUTHOTRIZED, "msg" => ERROR_BILL_NOT_AUTHOTRIZED_MSG)); @@ -75,7 +73,6 @@ class Bill { if ($command == 'exportCsvOfClosing') { if ($this->hasCurrentUserAdminOrManagerRights()) { - // yes, we can export the data $this->exportCsvOfClosing($_GET['closingid'],DO_CSV); } else { echo json_encode(array("status" => "ERROR", "code" => ERROR_MANAGER_NOT_AUTHOTRIZED, "msg" => ERROR_MANAGER_NOT_AUTHOTRIZED_MSG)); @@ -84,7 +81,6 @@ class Bill { } if ($command == 'exportXlsxOfClosing') { if ($this->hasCurrentUserAdminOrManagerRights()) { - // yes, we can export the data $this->exportCsvOfClosing($_GET['closingid'],DO_EXCEL); } else { echo json_encode(array("status" => "ERROR", "code" => ERROR_MANAGER_NOT_AUTHOTRIZED, "msg" => ERROR_MANAGER_NOT_AUTHOTRIZED_MSG)); @@ -133,11 +129,9 @@ class Bill { } } - // for internal request private function hasCurrentUserBillRights() { session_start(); if (!isset($_SESSION['angemeldet']) || !$_SESSION['angemeldet']) { - // no user logged in return false; } else { return ($_SESSION['right_bill']); @@ -147,18 +141,15 @@ class Bill { private function hasCurrentUserPaydeskRights() { session_start(); if (!isset($_SESSION['angemeldet']) || !$_SESSION['angemeldet']) { - // no user logged in return false; } else { return ($_SESSION['right_paydesk']); } } - // for internal request private function hasCurrentUserAdminOrManagerRights() { session_start(); if (!isset($_SESSION['angemeldet']) || !$_SESSION['angemeldet']) { - // no user logged in return false; } else { return ($_SESSION['right_manager'] || $_SESSION['is_admin']); @@ -186,7 +177,6 @@ class Bill { function getBillWithId($pdo,$billid,$language,$printer,$includeGuestInfo = false) { set_time_limit(120); - // is bill correct with signature? $commonUtils = new CommonUtils(); $correct = $commonUtils->verifyBill($pdo, $billid); if (!$correct) { @@ -194,9 +184,7 @@ class Bill { return; } - // first: get the bill overall data - // is the bill for a table or togo $sql = "SELECT tableid FROM %bill% WHERE id=?"; $stmt = $pdo->prepare(DbUtils::substTableAlias($sql)); $stmt->execute(array($billid)); @@ -210,14 +198,12 @@ class Bill { $tableid = $row->tableid; if ($qrow->countid == 0) { if ($tableid == 0) { - // togo $sql = "SELECT DISTINCT billdate,brutto,netto,'-' as tablename,username,host,IFNULL(%bill%.status,'') as status,guestinfo FROM %bill%,%user% WHERE %bill%.id=? AND userid=%user%.id AND tableid='0' "; } else { $sql = "SELECT DISTINCT billdate,brutto,netto,tableno as tablename,username,host,IFNULL(%bill%.status,'') as status,guestinfo FROM %bill%,%user%,%resttables% WHERE %bill%.id=? AND userid=%user%.id AND tableid=%resttables%.id "; } } else { if ($tableid == 0) { - // togo $sql = "SELECT DISTINCT billdate,brutto,netto,'-' as tablename,username,host,IFNULL(%bill%.status,'') as status,guestinfo FROM %bill%,%user%,%queue% WHERE %bill%.id=? AND %bill%.id=%queue%.billid AND userid=%user%.id AND tableid='0' AND paidtime is not null "; } else { $sql = "SELECT DISTINCT billdate,brutto,netto,tableno as tablename,username,host,IFNULL(%bill%.status,'') as status,guestinfo FROM %bill%,%user%,%resttables%,%queue% WHERE %bill%.id=? AND %bill%.id=%queue%.billid AND userid=%user%.id AND tableid=%resttables%.id AND paidtime is not null "; @@ -245,7 +231,6 @@ class Bill { } if ($row == null) { - // no rows found -> deliver no content echo json_encode(array("billoverallinfo" => array())); return; } else { @@ -305,7 +290,6 @@ class Bill { ); } - // now get all products of this bill $sql = "select productname,price,%pricelevel%.name as pricelevelname,togo,count(%queue%.productname) as count,%prodtype%.kind as kind from %queue%,%pricelevel%,%billproducts%,%prodtype%,%products% where %billproducts%.billid=? AND %billproducts%.queueid=%queue%.id AND %queue%.pricelevel = %pricelevel%.id AND %queue%.productid = %products%.id AND %products%.category = %prodtype%.id group by kind, productname,price,pricelevelname,togo"; $stmt = $pdo->prepare($this->dbutils->resolveTablenamesInSqlString($sql)); $stmt->execute(array($billid)); @@ -346,7 +330,6 @@ class Bill { * insert or take out cash money. The direction done by sign of $money value */ private function doCashAction($money,$remark) { - // current time date_default_timezone_set(DbUtils::getTimeZone()); $currentTime = date('Y-m-d H:i:s'); @@ -361,12 +344,10 @@ class Bill { if ($row != null) { $sum = $row->bruttosum; if (is_null($sum)) { - // no transaction after last closing $sum = 0.0; } if (($sum + floatval($money)) >= 0.0) { - // Test if it is allowed to insert new bill as storno bill or if manipulation has happened $nextbillid = $this->testForNewBillIdAndUpdateWorkTable($pdo); if ($nextbillid < 0) { echo json_encode(array("status" => "ERROR", "code" => ERROR_INCONSISTENT_DB, "msg" => ERROR_INCONSISTENT_DB_MSG)); @@ -374,7 +355,6 @@ class Bill { } $userId = $this->getUserId(); - // now calculate the signature for the bill entry $commonUtils = new CommonUtils(); if (trim($money) == '') { $money = '0.00'; @@ -418,7 +398,6 @@ class Bill { function getCashOverviewOfUser() { $userId = $this->getUserId(); - // without cash insert and cash takeout $onlyCashByGuests = 0.0; $pdo = $this->dbutils->openDbAndReturnPdo(); $sql = "SELECT sum(brutto) as sumtotal FROM %bill% WHERE closingid is null AND status is null AND paymentid=1 AND userid='$userId'"; @@ -431,7 +410,6 @@ class Bill { } } - // with cash $cashByGuestsAndInsertTakeOut = 0.0; $sql = "SELECT sum(brutto) as sumtotal FROM %bill% WHERE closingid is null AND paymentid='1' AND userid='$userId' AND (status is null OR status ='c')"; $stmt = $pdo->prepare($this->dbutils->resolveTablenamesInSqlString($sql)); @@ -453,7 +431,6 @@ class Bill { $whenClause = " (billdate >= ? AND billdate <= ?)"; - // search for the bill language $pdo = $this->dbutils->openDbAndReturnPdo(); $admin = new Admin(); $genValues = $admin->getGeneralConfigItems(false, $pdo); @@ -495,7 +472,6 @@ class Bill { $resultarray[] = $arr; } - // insert also the host-html just in case it is needed $hosthtml = file_get_contents("../customer/bon-bewirtungsvorlage.html"); ob_start(); @@ -525,7 +501,6 @@ class Bill { if (!$commonUtils->verifyLastBillId($pdo, $nextbillid)) { return (-1); } else { - // ok - then increment that last id in the work table $commonUtils->setLastBillIdInWorkTable($pdo, $nextbillid); return $nextbillid; } @@ -579,13 +554,11 @@ class Bill { $userid = $this->getUserId(); - // current time date_default_timezone_set(DbUtils::getTimeZone()); $currentTime = date('Y-m-d H:i:s'); $billid = (-1); - // find highest bill id $sql = "SELECT id from %bill% ORDER BY id DESC"; $stmt = $pdo->prepare(DbUtils::substTableAlias($sql)); $stmt->execute(); @@ -599,7 +572,6 @@ class Bill { $tableid = 0; } - // now calculate the signature for the bill entry $signature = $commonUtils->calcSignatureForBill($pdo,$currentTime, $brutto, $netto, '0.00', $userid); $billInsertSql = "INSERT INTO `%bill%` (`id` , `billdate`,`brutto`,`netto`,`tableid`,`paymentid`,`userid`,`ref`,`tax`,`host`,`reservationid`,`guestinfo`,`intguestid`,`intguestpaid`,`signature`) VALUES (?,?,?,?,?,?,?,NULL,NULL,?,?,?,?,?,?)"; @@ -607,7 +579,6 @@ class Bill { $stmt->execute(array($billid,$currentTime,$brutto,$netto,$tableid,$paymentId,$userid,$host,$reservationid,$guestinfo,$intguestid,$intguestpaid,$signature)); $newBillId = $pdo->lastInsertId(); - // now declare them all to be paid: for ($i=0;$i "ERROR", "code" => ERROR_BILL_NOT_STORNO_CODE, "msg" => ERROR_BILL_NOT_STORNO_CODE_MSG)); } @@ -652,19 +620,16 @@ class Bill { } if (!is_numeric($billid)) { - // this may be an attack... if ($doEcho) { echo json_encode(array("status" => "ERROR", "code" => ERROR_BILL_WRONG_NUMERIC_VALUE, "msg" => ERROR_BILL_WRONG_NUMERIC_VALUE_MSG)); } return false; } - // Do transactional cancel if ($doOwnTransaction) { $pdo->beginTransaction(); } - // is the bill already closed? In this case no cancel is allowed! $sql = "SELECT brutto,netto,tax,tableid,closingid,status,paymentid,reservationid,guestinfo,intguestid,intguestpaid FROM %bill% WHERE id=?"; $stmt = $pdo->prepare($this->dbutils->resolveTablenamesInSqlString($sql)); $stmt->execute(array($billid)); @@ -673,7 +638,6 @@ class Bill { if ($row != null) { $closingId = $row->closingid; - // save the next data for a copy! $brutto = $row->brutto; $netto = $row->netto; $tax = $row->tax; @@ -709,7 +673,6 @@ class Bill { return false; } - // is bill correct with signature? $commonUtils = new CommonUtils(); $correct = $commonUtils->verifyBill($pdo, $billid); if (!$correct) { @@ -722,7 +685,6 @@ class Bill { return false; } - // Test if it is allowed to insert new bill as storno bill or if manipulation has happened $nextbillid = $this->testForNewBillIdAndUpdateWorkTable($pdo); if ($nextbillid < 0) { if ($doEcho) { @@ -734,7 +696,6 @@ class Bill { return false; } - // 0. find the queueitems that are related to that bill $sql = "SELECT id FROM %queue% WHERE billid=?"; $stmt = $pdo->prepare($this->dbutils->resolveTablenamesInSqlString($sql)); $stmt->execute(array($billid)); @@ -745,7 +706,6 @@ class Bill { $queueIdArray[] = $row['id']; } - // 1. clear connection between queue item and bill if ($removeproducts == 0) { $sql = "UPDATE %queue% SET paidtime=null,billid=null WHERE billid=?"; } else { @@ -754,7 +714,6 @@ class Bill { $stmt = $pdo->prepare($this->dbutils->resolveTablenamesInSqlString($sql)); $stmt->execute(array($billid)); - // 2. copy bill with negativ brutto as part of storno $userIdOfStornoUser = $this->getUserId(); $stornval = 0.0 - floatval($brutto); $stornonettoval = 0.0 - floatval($netto); @@ -775,7 +734,6 @@ class Bill { $stmt = $pdo->prepare(DbUtils::substTableAlias($sql)); $stmt->execute(array($row->brutto + $row->prevbrutto + $stornval,$row->netto + $row->prevnetto + $stornonettoval,$refIdOfStornoEntry)); - // 3. mark bill as part of storno $sql = "UPDATE %bill% SET status='x', closingid=null, ref=?, intguestid=?,intguestpaid=? WHERE id=?"; $stmt = $pdo->prepare($this->dbutils->resolveTablenamesInSqlString($sql)); $stmt->execute(array($refIdOfStornoEntry,null,null,$billid)); @@ -786,7 +744,6 @@ class Bill { $stmt->execute(array($reason,$billid)); } - // 4. now put the queue items into the billproducts so that later storno is evaluable foreach ($queueIdArray as $aQueueid) { $billProdsSql = "INSERT INTO `%billproducts%` (`queueid` , `billid`) VALUES ( ?,?)"; $stmt = $pdo->prepare($this->dbutils->resolveTablenamesInSqlString($billProdsSql)); @@ -798,7 +755,6 @@ class Bill { if ($doOwnTransaction) { $pdo->commit(); } - // end of transactional cancel if ($doEcho) { echo json_encode(array("status" => "OK", "code" => OK)); @@ -892,7 +848,6 @@ class Bill { $endMonth = "0" . $endMonth; } $startDate = $startYear . "-" . $startMonth . "-01 00:00:00"; - // now find last day of month of end date! $endDate = $endYear . "-" . $endMonth . "-01"; $lastdayOfMonth = date("t", strtotime($endDate)); $endDate = $endYear . "-" . $endMonth . "-" . $lastdayOfMonth . " 23:59:59"; @@ -942,7 +897,6 @@ class Bill { $firstRow[] = $this->t['PayWay'][$l]; $firstRow[] = $this->t['ClosRemark'][$l]; } else { - // closing id is know - do not output unnecessary info $firstRow[] = $this->t['PayWay'][$l]; } @@ -960,10 +914,8 @@ class Bill { $sql .= "WHERE closingid is not null AND %bill%.closingid=%closing%.id "; $sql .= " AND %bill%.paymentid=%payment%.id "; if ($onlyClosingId == null) { - // search for time span $sql .= " AND %bill%.billdate BETWEEN ? AND ? "; } else { - // search for a special closing id $sql .= " AND closingid=? "; } $sql .= " AND %bill%.userid = %user%.id "; diff --git a/webapp/php/printqueue.php b/webapp/php/printqueue.php index 81c525d..88e507b 100644 --- a/webapp/php/printqueue.php +++ b/webapp/php/printqueue.php @@ -71,6 +71,8 @@ class PrintQueue { $this->batchReceiptPrintJob($_POST['start'],$_POST['end']); } else if ($command == 'getLastLog') { $this->getLastLog($_POST['pass']); + } else if ($command == 'deleteSpooledPrintJob') { + $this->deleteSpooledPrintJob($_POST['id']); } else { echo "Kommando nicht erkannt!"; } @@ -139,21 +141,27 @@ class PrintQueue { $jobs = array(); for ($printer=1;$printer<7;$printer++) { - $sql = "SELECT count(id) as count FROM %printjobs% WHERE printer=? AND type != '1' AND type != '2'"; - $stmt = $pdo->prepare(DbUtils::substTableAlias($sql)); - $stmt->execute(array($printer)); - $result = $stmt->fetchObject(); - $jobs[] = array("printer" => $printer, "jobs" => $result->count); + $sql = "SELECT %printjobs%.id as id,%bill%.id as billid,billdate,brutto,%resttables%.tableno as tablename FROM %printjobs%,%bill%,%resttables% WHERE printer=? AND type != '1' AND type != '2' AND content=%bill%.id AND %bill%.tableid=%resttables%.id"; + $result = CommonUtils::fetchSqlAll($pdo, $sql, array($printer)); + $jobs[] = array("printer" => $printer, "count" => count($result),"jobs" => $result); } - $sql = "SELECT count(id) as count FROM %printjobs% WHERE type=?"; + $sql = "SELECT %printjobs%.id as id,content FROM %printjobs% WHERE type=?"; $stmt = $pdo->prepare(DbUtils::substTableAlias($sql)); $stmt->execute(array(1)); - $result = $stmt->fetchObject(); - $jobs[] = array("printer" => 7, "jobs" => $result->count); + $result = $stmt->fetchAll(); + $works = array(); + foreach($result as $r) { + $works[] = array("id" => $r['id'],"content" => json_decode($r['content'])); + } + $jobs[] = array("printer" => 7, "count" => count($result),"jobs" => $works); $stmt->execute(array(2)); - $result = $stmt->fetchObject(); - $jobs[] = array("printer" => 8, "jobs" => $result->count); + $result = $stmt->fetchAll(); + $works = array(); + foreach($result as $r) { + $works[] = array("id" => $r['id'],"content" => json_decode($r['content'])); + } + $jobs[] = array("printer" => 8, "count" => count($result),"jobs" => $works); echo json_encode(array("status" => "OK", "msg" => $jobs)); } @@ -208,6 +216,20 @@ class PrintQueue { } } + function deleteSpooledPrintJob($printjobid) { + if (!($this->userrights->hasCurrentUserRight('right_manager')) && + !($this->userrights->hasCurrentUserRight('is_admin')) + ) { + echo "Benutzerrechte nicht ausreichend!"; + return false; + } + + $pdo = DbUtils::openDbAndReturnPdoStatic(); + $sql = "DELETE FROM %printjobs% WHERE id=?"; + CommonUtils::execSql($pdo, $sql, array($printjobid)); + echo json_encode(array("status" => "OK")); + } + function queueReceiptPrintJob($billid,$useaddrecprinter) { // waiter, or manager, bill, admin rights required if (!($this->userrights->hasCurrentUserRight('right_paydesk')) && diff --git a/webapp/php/products.php b/webapp/php/products.php index f221e9e..c30ff02 100644 --- a/webapp/php/products.php +++ b/webapp/php/products.php @@ -217,7 +217,7 @@ class Products { } $sql = "SELECT DISTINCT %extras%.id AS extraid,%extras%.name AS name FROM %extras%,%extrasprods% - WHERE %extrasprods%.prodid=? AND %extras%.id=%extrasprods%.extraid AND %extras%.removed is null"; + WHERE %extrasprods%.prodid=? AND %extras%.id=%extrasprods%.extraid AND %extras%.removed is null ORDER BY name"; $stmt = $pdo->prepare($this->dbutils->resolveTablenamesInSqlString($sql)); $stmt->execute(array($row['id'])); @@ -356,7 +356,6 @@ class Products { } private function getMenuLevelUp($ref) { - // from which type does the current type reference to? $pdo = $this->dbutils->openDbAndReturnPdo(); $sql = "SELECT reference from %prodtype% where removed is null AND id=?"; $stmt = $pdo->prepare($this->dbutils->resolveTablenamesInSqlString($sql)); @@ -511,7 +510,6 @@ class Products { $itemsql = $aProdDef["histget"]; if ($item != "") { if ($itemsql == 'tax') { - // IF(tax is not null, tax, '-') as tax $value = ($zeile['tax']); if ($value == null) { $value = '-'; @@ -569,7 +567,6 @@ class Products { $pdo = $this->dbutils->openDbAndReturnPdo(); $pdo->beginTransaction(); - // getSortingOfProduct $this->sorter->resortAfterProduct($pdo, $prodid); $sql = "UPDATE %products% SET category=? WHERE id=?"; @@ -578,7 +575,6 @@ class Products { $affectedRows = $stmt->rowCount(); $pdo->commit(); if ($affectedRows == 1) { - // now declare as set to end to list $this->sorter->setMaxSortingForProdId($pdo, $prodid); echo json_encode(array("status" => "OK")); } else { @@ -621,7 +617,6 @@ class Products { return $ids; } - // to be called by manager-readSpeisekarte public static function createExtraCore($pdo,$name,$price,$assignedProdIds) { if (is_null($pdo)) { $pdo = DbUtils::openDbAndReturnPdoStatic(); @@ -731,10 +726,8 @@ class Products { $pdo = $this->dbutils->openDbAndReturnPdo(); $pdo->beginTransaction(); - // what is the max sort number because it shall be added afterwards $maxSorting = $this->getMaxSortOfGenComment($pdo); - // insert the comment $sql = "INSERT INTO `%comments%` (`id`,`comment`,`prodid`,`active`,`sorting`) VALUES(NULL,?,NULL,1,?)"; $stmt = $pdo->prepare($this->dbutils->resolveTablenamesInSqlString($sql)); $stmt->execute(array($comment,$maxSorting+1)); @@ -799,7 +792,6 @@ class Products { try { $pdo = $this->dbutils->openDbAndReturnPdo(); $pdo->beginTransaction(); - // which sorting has the comment to delete? $sorting = $this->getSortingOfComment($pdo, $id); if ($sorting < 0) { @@ -807,12 +799,10 @@ class Products { return; } - // delete the comment $sql = "DELETE FROM %comments% WHERE id=? AND prodid is null"; $stmt = $pdo->prepare($this->dbutils->resolveTablenamesInSqlString($sql)); $stmt->execute(array($id)); - // subtract all sortings by one higher then the deleted sorting index $sql = "SELECT id,sorting FROM %comments% WHERE sorting>? AND prodid is null"; $stmt = $pdo->prepare($this->dbutils->resolveTablenamesInSqlString($sql)); $stmt->execute(array($sorting)); @@ -840,7 +830,6 @@ class Products { $pdo = $this->dbutils->openDbAndReturnPdo(); $pdo->beginTransaction(); - // which sorting has the comment to delete? $sorting = $this->getSortingOfComment($pdo, $id); if ($sorting < 0) { @@ -848,20 +837,17 @@ class Products { return; } if ($sorting == 1) { - // finished $pdo->commit(); echo json_encode(array("status" => "OK")); return; } - // get comment before $sql = "SELECT id FROM %comments% WHERE sorting=? AND prodid is null"; $stmt = $pdo->prepare($this->dbutils->resolveTablenamesInSqlString($sql)); $stmt->execute(array($sorting - 1)); $row = $stmt->fetchObject(); $previousId = $row->id; - // change these two comments in its ordering $sql = "UPDATE %comments% SET sorting=? WHERE id=?"; $stmt = $pdo->prepare($this->dbutils->resolveTablenamesInSqlString($sql)); $stmt->execute(array($sorting,$previousId)); @@ -883,7 +869,6 @@ class Products { $pdo = $this->dbutils->openDbAndReturnPdo(); $pdo->beginTransaction(); - // which sorting has the comment to delete? $sorting = $this->getSortingOfComment($pdo, $id); if ($sorting < 0) { @@ -891,23 +876,19 @@ class Products { return; } - // is it at end of list? $maxSorting = $this->getMaxSortOfGenComment($pdo); if (($maxSorting == 0) || ($maxSorting == $sorting)) { - // finished $pdo->commit(); echo json_encode(array("status" => "OK")); return; } - // get comment afterwards $sql = "SELECT id FROM %comments% WHERE sorting=? AND prodid is null"; $stmt = $pdo->prepare($this->dbutils->resolveTablenamesInSqlString($sql)); $stmt->execute(array($sorting + 1)); $row = $stmt->fetchObject(); $nextId = $row->id; - // change these two comments in its ordering $sql = "UPDATE %comments% SET sorting=? WHERE id=?"; $stmt = $pdo->prepare($this->dbutils->resolveTablenamesInSqlString($sql)); $stmt->execute(array($sorting,$nextId)); @@ -963,7 +944,6 @@ class Products { if ($changeExtras == 1) { $this->changeExtraAssignment($pdo, $id, $extras); } - // now this has to be logged in the history tables... HistFiller::updateProdInHist($pdo,$id); } else { @@ -1025,7 +1005,6 @@ class Products { $pdo = $this->dbutils->openDbAndReturnPdo(); $pdo->beginTransaction(); - // which kind is the referenced type? $sql = "SELECT kind FROM %prodtype% WHERE id=?"; $stmt = $pdo->prepare($this->dbutils->resolveTablenamesInSqlString($sql)); $stmt->execute(array($id)); @@ -1067,7 +1046,6 @@ class Products { return; } - // now this has to be logged in the history tables... HistFiller::createProdInHist($pdo, $newProdId); echo json_encode("OK: sql"); @@ -1146,7 +1124,6 @@ class Products { return $allProdsAndTypesInThisLevel; } - // return in text format private function readDbProductsWithRef_json_version($pdo,$ref,$depth) { $decpoint = $this->getDecPoint($pdo); $text = ""; @@ -1157,7 +1134,6 @@ class Products { for ($index_prod=0;$index_prodreadDbProducts($pdo); diff --git a/webapp/php/queuecontent.php b/webapp/php/queuecontent.php index c2043ef..6b995ca 100644 --- a/webapp/php/queuecontent.php +++ b/webapp/php/queuecontent.php @@ -172,14 +172,12 @@ class QueueContent { * $kind=0 -> return only food elements, =1 -> return drinks */ private function getJsonAllQueueItemsToMake($kind) { - // current time date_default_timezone_set(DbUtils::getTimeZone()); $currentTime = date('Y-m-d H:i:s'); $pdo = $this->dbutils->openDbAndReturnPdo(); - // first sort all non-ready products ordered by ordertime if ($this->areBillExisting($pdo)) { $sql = "SELECT DISTINCT %queue%.id as id,%resttables%.id as tableid,tablenr,longname,anoption,tableno,date_format(ordertime,'%Y-%m-%d %H:%i:00') as ordertime,cooking,TIMESTAMPDIFF(MINUTE,ordertime,?) AS waittime FROM %queue%,%products%,%prodtype%,%resttables%,%bill% "; @@ -196,7 +194,6 @@ class QueueContent { $sql .= "%queue%.workprinted='0') "; if ($this->areBillExisting($pdo)) { - // now remove closed items $sql .= "AND (%queue%.billid is null OR ("; $sql .= "%queue%.billid=%bill%.id AND %bill%.closingid is null)) "; } @@ -256,7 +253,6 @@ class QueueContent { for ($queue_index=0;$queue_index < count($resultarray);$queue_index++) { $aTable = $resultarray[$queue_index]['tablenr']; if (($table <> $aTable) && !in_array($aTable,$insertedTables)) { - // sort all entries for this table $table = $aTable; $tableid = $resultarray[$queue_index]['tableid']; $maxWaitTime = $resultarray[$queue_index]['waittime']; @@ -265,9 +261,6 @@ class QueueContent { if ($resultarray[$i]['tablenr'] == $table) { $foundItem = $resultarray[$i]; $waittimeofentry = intval($foundItem['waittime']); - // icons of waittime - // 1-20 in 1 min steps - // 25,30,40,50,60min $waitIconMinStep = 1; if ($waittimeofentry <= 1) { $waitIconMinStep = 1; @@ -299,7 +292,6 @@ class QueueContent { $tableArr[] = $anEntryForThisTable; } } - // Now fit max wait time of table to entry wait time steps: if (($maxWaitTime > 20) && ($maxWaitTime < 60)) { if ($maxWaitTime >= 50) { $maxWaitTime = "> 50"; @@ -377,7 +369,6 @@ class QueueContent { $jobs = array(); foreach($queueItems as $aQueueItem) { - // is the job for that printer? $thePrinter = $aQueueItem["printer"]; $queueid = $aQueueItem["id"]; @@ -412,7 +403,6 @@ class QueueContent { } if ($groupworkitems) { - // now put the count number into the longname foreach($jobs as &$aJob) { $cnt = $aJob["count"]; $aJob["longname"] = $cnt . "x " . $aJob["longname"]; @@ -459,7 +449,6 @@ class QueueContent { } private function doWorkPrintCore($pdo,$theTableid,$insertedQueueIds,$username,$payPrintType,$lang,$declareReadyDelivered = true) { - // is it server or local print? $foodJobsPrinter1 = $this->getJobsToPrint($pdo, 0, 1, $insertedQueueIds); $foodJobsPrinter2 = $this->getJobsToPrint($pdo, 0, 2, $insertedQueueIds); @@ -536,7 +525,6 @@ class QueueContent { private function getJsonLastMadeItems($kind) { $pdo = DbUtils::openDbAndReturnPdoStatic(); - // first sort all non-ready products ordered by ordertime if ($this->areBillExisting($pdo)) { $sql = "SELECT DISTINCT %queue%.id as id,tablenr,longname,anoption,tableno,readytime,%products%.id as prodid FROM %queue%,%products%,%prodtype%,%resttables%,%bill% "; } else { @@ -553,7 +541,6 @@ class QueueContent { $sql .= "%queue%.workprinted='0') "; if ($this->areBillExisting($pdo)) { - // now remove closed items $sql .= "AND (%queue%.billid is null OR ("; $sql .= "%queue%.billid=%bill%.id AND %bill%.closingid is null)) "; } @@ -580,7 +567,6 @@ class QueueContent { $sql .= "%queue%.workprinted='0') "; if ($this->areBillExisting($pdo)) { - // now remove closed items $sql .= "AND (%queue%.billid is null OR ("; $sql .= "%queue%.billid=%bill%.id AND %bill%.closingid is null)) "; } @@ -599,7 +585,6 @@ class QueueContent { $productid = $zeile['prodid']; $useConditions = $this->getUseKitchenAndSupplyForProd($pdo,$productid); if ($useConditions["usekitchen"] == 1) { - // yes, display it in kitchen view as cooked $arr = array("id" => $zeile['id'], "tablename" => $zeile['tableno'], "longname" => $zeile['longname'], @@ -611,11 +596,6 @@ class QueueContent { } } - // now look for items that are made and auto-delivered - // They must appear if: - // a) in category autosupply yes - // b) they have the right kind - // c) they shall appear in bar/kitchen module at all $resultarray = $this->appendProdsForBarKitchenAndAutoDelivery($pdo,$kind, $resultarray); echo json_encode($resultarray); @@ -632,7 +612,6 @@ class QueueContent { $sql .= "(%queue%.productid = %products%.id AND %products%.category = %prodtype%.id AND %prodtype%.kind=? AND %prodtype%.usesupplydesk='0' AND %prodtype%.usekitchen='1') AND "; $sql .= "%queue%.workprinted='0') "; - // now remove closed items $sql .= "AND (%queue%.billid is null OR ("; $sql .= "%queue%.billid=%bill%.id AND %bill%.closingid is null)) "; @@ -671,7 +650,6 @@ class QueueContent { $pdo = $this->dbutils->openDbAndReturnPdo(); $pdo->beginTransaction(); - // is product already cooking or will it be set to cooking? $sql = "SELECT cooking,productid FROM %queue% WHERE id=?"; $row = CommonUtils::getRowSqlObject($pdo, $sql, array($queueid)); if ($row != null) { @@ -679,16 +657,13 @@ class QueueContent { $productid = $row->productid; if ($action == 'r') { - // product shall be declared ready if (is_null($cooking)) { - // a product must be cooking before it can be ready! $pdo->rollBack(); echo json_encode(array("status" => "ERROR", "code" => ERROR_DB_PAR_ACCESS, "msg" => ERROR_DB_PAR_ACCESS_MSG)); } else { $this->reallyDeclareAsCooked($pdo,$queueid); $useConditions = $this->getUseKitchenAndSupplyForProd($pdo,$productid); if ($useConditions["usesupply"] == 0) { - // can bypass the supplydesk $this->declareProductBeDeliveredWithGivenPdo($pdo,$queueid); } else { self::setNewProductsToServe($pdo, 1); @@ -707,9 +682,7 @@ class QueueContent { echo json_encode(array("status" => "OK")); } } else if ($action == 'c') { - // product shall be declared as cooking (in progress) if (!is_null($cooking)) { - // a product must not be cooking before it can becomes cooking $pdo->rollBack(); echo json_encode(array("status" => "ERROR", "code" => ERROR_DB_PAR_ACCESS, "msg" => ERROR_DB_PAR_ACCESS_MSG)); } else { @@ -745,7 +718,6 @@ class QueueContent { $pdo = $this->dbutils->openDbAndReturnPdo(); $pdo->beginTransaction(); - // first: is the product still declared as delivered? $sql = "SELECT id FROM %queue% WHERE id=? AND readytime IS NOT NULL"; $row = CommonUtils::getRowSqlObject($pdo, $sql, array($queueid)); if ($row != null) { @@ -830,7 +802,6 @@ class QueueContent { $workflowconfig = CommonUtils::getExistingConfigValue($pdo, 'workflowconfig'); $austria = CommonUtils::getExistingConfigValue($pdo, 'austria'); - // get current pricelevel $currentPriceLevel = $this->commonUtils->getCurrentPriceLevel($pdo); $currentPriceLevelId = $currentPriceLevel["id"]; @@ -844,7 +815,6 @@ class QueueContent { $theChangedPrice = $aProd["changedPrice"]; $theChangedPrice = str_replace(',','.',$theChangedPrice); - // now get the price for this pricelevel $getPriceSql = "SELECT priceA,priceB,priceC,longname,tax,taxaustria,amount FROM %products% where id=?"; $row = CommonUtils::getRowSqlObject($pdo, $getPriceSql, array($productid)); if ($row == null) { @@ -875,7 +845,6 @@ class QueueContent { $price = $theChangedPrice; } - // now check if the product is a togo article that might have been booked on a table $togo = $aProd["togo"]; $tax = $normaltax; @@ -930,7 +899,6 @@ class QueueContent { } if (is_null($theTableid) || (is_numeric($theTableid) && is_numeric($productid))) { - // first get category of product $useConditions = $this->getUseKitchenAndSupplyForProdWithPdo($pdo,$productid); $insertSql = "INSERT INTO `%queue%` ( @@ -958,13 +926,9 @@ class QueueContent { $this->declareProductBeDeliveredWithGivenPdo($pdo,$queueid); } else { if ($useConditions["usekitchen"] == 0) { - // no - can bypass the kitchen $this->reallyDeclareAsCooked($pdo,$queueid); - // then also look for supplydesk, since kitchen action won't do this! if ($useConditions["usesupply"] == 0) { - // can bypass the supplydesk $this->declareProductBeDeliveredWithGivenPdo($pdo,$queueid); - // THIS autop declares as "prepared" (cooked)!!! } } else { $insertedQueueIds[] = $queueid; @@ -1029,7 +993,6 @@ class QueueContent { } else { $sql .= " AND (readytime IS NULL or readytime is null) "; } - // and not in a closing: if ($hasBills) { $sql .= " AND (billid is null OR ("; $sql .= " billid = %bill%.id AND %bill%.closingid is null)) "; @@ -1261,8 +1224,6 @@ class QueueContent { echo json_encode(array("status" => "OK", "msg" => $prodsToPay)); } - // This function gets the items to pay and creates a table, in which these items - // are listed up. It can be used as a receipt to print later function displayBill($billtableitems,$totalPrice) { $currency = $this->commonUtils->getCurrency(); $numberOfItemsToPay = count($billtableitems); @@ -1280,9 +1241,6 @@ class QueueContent { echo ""; } - // ********************************** - // * Bereitstellung * - // ********************************** function declareProductBeDeliveredWithGivenPdo($pdo,$queueid) { @@ -1294,7 +1252,6 @@ class QueueContent { $stmt = $pdo->prepare($this->dbutils->resolveTablenamesInSqlString($updateSql)); $stmt->execute(array($delivertime,$queueid)); - // then it was probably already prepared $updateSql = "UPDATE %queue% SET readytime=? WHERE id=?"; $stmt = $pdo->prepare($this->dbutils->resolveTablenamesInSqlString($updateSql)); $stmt->execute(array($delivertime,$queueid)); @@ -1351,14 +1308,12 @@ class QueueContent { $sql .= "AND toremove <> '1') "; if ($this->areBillExisting($pdo)) { - // now remove closed items $sql .= "AND (%queue%.billid is null OR ("; $sql .= "%queue%.billid=%bill%.id AND %bill%.closingid is null)) "; } $sql .= " ORDER BY tableno"; } else { - // togo $sql = "SELECT DISTINCT %queue%.id as id,'' as tableno,longname,anoption,readytime "; if ($this->areBillExisting($pdo)) { $sql .= "FROM %queue%,%products%,%resttables%,%bill% "; @@ -1383,7 +1338,6 @@ class QueueContent { $stmt->execute(); $dbresult = $stmt->fetchAll(); - // create a table that is optimal (sqrt-like size) $numberOfIcons = count($dbresult); $arrayOfProdsForTable = array(); $idsProdsOfTable = ''; // this is a hack! All queueids of a table redundant for "Deliver all" @@ -1410,12 +1364,9 @@ class QueueContent { return array("prods" => $arrayOfProdsForTable, "ids" => $idsProdsOfTable); } - // total number of products for table - // can later be used for color indication if products can be delivered completly for a table public function numberOfProductsForTableNotDelivered($pdo,$tableid) { $sql = "SELECT DISTINCT %queue%.id as id "; if (!is_null($tableid)) { - // not togo $sql .= "FROM %queue%,%resttables% "; } else { $sql .= "FROM %queue% "; @@ -1426,7 +1377,6 @@ class QueueContent { $sql .= "AND workprinted='0' "; $sql .= "AND toremove <> '1' "; if (!is_null($tableid)) { - // not togo $sql .= "AND %queue%.tablenr=%resttables%.id "; $sql .= "AND %resttables%.id=" . $tableid; } else { @@ -1444,7 +1394,6 @@ class QueueContent { function getJsonAllPreparedProducts() { $pdo = DbUtils::openDbAndReturnPdoStatic(); - // find out the tables that are relevant $sql = "SELECT DISTINCT tablenr "; if ($this->areBillExisting($pdo)) { $sql .= "FROM %queue%,%resttables%,%bill% "; @@ -1459,7 +1408,6 @@ class QueueContent { $sql .= "%queue%.workprinted='0') "; if ($this->areBillExisting($pdo)) { - // now remove closed items $sql .= "AND (%queue%.billid is null OR ("; $sql .= "%queue%.billid=%bill%.id AND %bill%.closingid is null)) "; } @@ -1499,7 +1447,6 @@ class QueueContent { $tablesToServe[] = $zeile['tablenr']; } - // to sort complete prepared tables use two arrays: $preparedProds_incomplete_tables = array(); $preparedProds = array(); @@ -1545,7 +1492,6 @@ class QueueContent { */ function getJsonLastDeliveredProducts() { $pdo = DbUtils::openDbAndReturnPdoStatic(); - // 1. no togo products $sql = "SELECT DISTINCT %queue%.id as id,tableno,longname,delivertime,anoption,%products%.id as prodid "; if ($this->areBillExisting($pdo)) { $sql .= "FROM %queue%,%resttables%,%products%,%bill% "; @@ -1561,7 +1507,6 @@ class QueueContent { $sql .= "%queue%.workprinted='0') "; if ($this->areBillExisting($pdo)) { - // now remove closed items $sql .= "AND (%queue%.billid is null OR ("; $sql .= "%queue%.billid=%bill%.id AND %bill%.closingid is null)) "; } @@ -1572,7 +1517,6 @@ class QueueContent { $stmt->execute(); $result1 = $stmt->fetchAll(); - // 2.togo products $sql = "SELECT DISTINCT %queue%.id as id,'' as tableno,longname,delivertime,anoption,%products%.id as prodid "; if ($this->areBillExisting($pdo)) { $sql .= "FROM %queue%,%resttables%,%products%,%bill% "; @@ -1603,7 +1547,6 @@ class QueueContent { $productid = $zeile['prodid']; $useConditions = $this->getUseKitchenAndSupplyForProd($pdo,$productid); if ($useConditions["usesupply"] == 1) { - // yes, display it in supplydesk view as cooked $extras = $this->getExtrasOfQueueItem(null,$zeile['id']); @@ -1621,9 +1564,6 @@ class QueueContent { } - // ********************************** - // * Kasse * - // ********************************** /* * Test if all queue items with the given ids are not paid @@ -1660,7 +1600,6 @@ class QueueContent { $pdo->beginTransaction(); } - // check if all items are not paid yet! Also get rid of empty entries $allNotPaid = true; for ($i=0;$icommonUtils->verifyLastBillId($pdo, $billid)) { if (!$calledInternally) { echo json_encode(array("status" => "ERROR", "code" => ERROR_INCONSISTENT_DB, "msg" => ERROR_INCONSISTENT_DB_MSG)); @@ -1720,7 +1657,6 @@ class QueueContent { } return; } else { - // ok - then increment that last id in the work table $this->commonUtils->setLastBillIdInWorkTable($pdo, $billid); } @@ -1734,14 +1670,12 @@ class QueueContent { $brutto = $row->brutto; $netto = $row->netto; - // now calculate the signature for the bill entry $signature = $this->commonUtils->calcSignatureForBill($pdo,$currentTime, $brutto, $netto, '0.00', $userid); $billInsertSql = "INSERT INTO `%bill%` (`id` , `billdate`,`brutto`,`netto`,`prevbrutto`,`prevnetto`,`tableid`,`paymentid`,`userid`,`ref`,`tax`,`host`,`reservationid`,`guestinfo`,`intguestid`,`signature`) VALUES (?,?,?,?,?,?,?,?,?,NULL,NULL,?,?,?,?,?)"; $stmt = $pdo->prepare($this->dbutils->resolveTablenamesInSqlString($billInsertSql)); $stmt->execute(array($billid,$currentTime,$brutto,$netto,$newprevbrutto,$newprevnetto,$tableid,$paymentId,$userid,$host,$reservationid,$guestinfo,$intguestid,$signature)); - // now declare them all to be paid: for ($i=0;$i "ERROR", "code" => ERROR_NOT_AUTHOTRIZED, "msg" => ERROR_NOT_AUTHOTRIZED_MSG)); } } @@ -47,7 +46,6 @@ class Roomtables { session_start(); } if (!isset($_SESSION['angemeldet']) || !$_SESSION['angemeldet']) { - // no user logged in return false; } else { return ($_SESSION['is_admin']); @@ -61,7 +59,6 @@ class Roomtables { } public static function getUnpaidTablesCore($pdo,$roomid) { - // first get all tables of that rooms $tablesSql = "SELECT id,tableno FROM %resttables% WHERE %resttables%.roomid =? AND removed is null"; $stmt = $pdo->prepare(DbUtils::substTableAlias($tablesSql)); @@ -126,7 +123,6 @@ class Roomtables { } function hasTableUnpaidItems($tableid) { - // sql copied from getJsonProductsOfTableToPay $sql = "SELECT %queue%.id as id,longname,%queue%.price as price,%pricelevel%.name as pricelevelname,%products%.id as prodid FROM %queue% INNER JOIN %products% ON %queue%.productid = %products%.id @@ -176,7 +172,6 @@ class Roomtables { return $row->pricesum; } - // Part of chain to choose a product , here we start with chosing a room private function getAllTablesAndRooms($pdo) { $queue = new QueueContent(); @@ -190,7 +185,6 @@ class Roomtables { foreach($dbresult as $zeile) { $roomid = $zeile['id']; - // now find the tables that are in that room $tablesArray = array(); $sql = "SELECT %resttables%.id as id,%resttables%.tableno as name,IFNULL(SUM(IF(%queue%.ordertime is not null AND %queue%.paidtime is null AND %queue%.isclosed is null,%queue%.price,0.00)),0.00) as pricesum FROM %resttables% "; @@ -253,17 +247,14 @@ class Roomtables { $pdo = $this->dbutils->openDbAndReturnPdo(); $pdo->beginTransaction(); - // clear room table $sql = "UPDATE %room% SET removed=?"; $stmt = $pdo->prepare($this->dbutils->resolveTablenamesInSqlString($sql)); $stmt->execute(array('1')); - // clear resttables table $sql = "UPDATE %resttables% SET removed=?"; $stmt = $pdo->prepare($this->dbutils->resolveTablenamesInSqlString($sql)); $stmt->execute(array('1')); - // clear table positions and maps $sql = "DELETE FROM %tablepos%"; $stmt = $pdo->prepare(DbUtils::substTableAlias($sql)); $stmt->execute(); @@ -322,7 +313,6 @@ class Roomtables { $abbreviation = $row['abbreviation']; $printer = $row['printer']; - // now get the tables of this room $sql = "SELECT id,tableno FROM %resttables% WHERE roomid=? AND removed is null ORDER BY 'sorting'"; $stmt = $pdo->prepare($this->dbutils->resolveTablenamesInSqlString($sql)); $stmt->execute(array($row['id'])); diff --git a/webapp/preferences.html b/webapp/preferences.html index e8f0f93..69e0c63 100644 --- a/webapp/preferences.html +++ b/webapp/preferences.html @@ -5,7 +5,7 @@ - + @@ -85,7 +85,6 @@ function insertGeneralConfigItems(configResult) { setLanguage(values.userlanguage); } else { setTimeout(function(){document.location.href = "index.html"},250); // not logged in - //alert("Fehler beim Aufruf der Seite: " + configResult.msg); } } @@ -309,7 +308,6 @@ function handleGeneralAnswer(json) { } function binding() { - // Help buttons $("#changepasswordbutton").off("click").on("click", function (e) { e.stopImmediatePropagation(); e.preventDefault(); @@ -406,14 +404,14 @@ $(document).on("pageinit", "#pref-page", function () {
      -
    • Module
    • +
    • Hauptmenü
    diff --git a/webapp/products.html b/webapp/products.html index 001a292..5fc0391 100644 --- a/webapp/products.html +++ b/webapp/products.html @@ -7,7 +7,7 @@ - + @@ -463,7 +463,6 @@ function setLanguage(language) { var assignedExtras = null; if (origAssignedExtras != null) { - // the button to assign extras was pressed var assignedExtras = $("#prodextra_" + prodid).data("assignedextras"); var doChangeExtras = 0; @@ -618,7 +617,6 @@ function setLanguage(language) { } } - // reload, also for Chrome working function reloadPageWithTimeout(result) { if (result.status != "OK") { alert("Fehler aufgetreten - bitte Aktion wiederholen!"); @@ -923,13 +921,13 @@ function setLanguage(language) {
      -
    • Module
    • +
    • Hauptmenü

    Angebot

    diff --git a/webapp/rating.html b/webapp/rating.html index 59f59c1..ef75d36 100644 --- a/webapp/rating.html +++ b/webapp/rating.html @@ -7,7 +7,7 @@ - + @@ -132,13 +132,13 @@ function setLanguage(language) {
      -
    • Module
    • +
    • Hauptmenü

    Bewertung

    diff --git a/webapp/reports.html b/webapp/reports.html index 1ba10c1..585f557 100644 --- a/webapp/reports.html +++ b/webapp/reports.html @@ -7,7 +7,7 @@ - + @@ -82,7 +82,6 @@ function setLanguage(language) { REP_YEST_TXT[lang], "center",10,10,80); - // thismonth var htmlThisMonth = fillOnePart(jsonText.thismonthname,jsonText.thismonth,REP_DAY[lang], REP_THIS_MONTH_TXT[lang], "center",10,10,80); @@ -161,7 +160,6 @@ function setLanguage(language) { var contentValues = values.content; var decpoint = $("#info-page").data("decpoint"); - // fill content $.each(contentValues, function (i, aStatValue) { var hourOrDay = aStatValue.iter; @@ -205,7 +203,6 @@ function setLanguage(language) { getStats(); } else { setTimeout(function(){document.location.href = "index.html"},250); // not logged in - //alert("Fehler beim Aufruf der Seite: " + configResult.msg); } } @@ -220,13 +217,13 @@ function setLanguage(language) {
      -
    • Module
    • +
    • Hauptmenü

    Statistik

    diff --git a/webapp/reservation.html b/webapp/reservation.html index ac41387..6ffc9e3 100644 --- a/webapp/reservation.html +++ b/webapp/reservation.html @@ -5,7 +5,7 @@ - + @@ -88,7 +88,6 @@ var reservationnote = ""; var companyinfo = ""; var emailIsPossible = false; var emailTemplate = ""; -// REM* ther list of customers that are filtered by the server when the user types in the name in the search field var filteredCustomers = []; function setLanguage(language) { @@ -176,7 +175,6 @@ function insertGenConfigStartRest(configResult) { } else { setTimeout(function(){document.location.href = "index.html"},250); // not logged in $("#fullcontent").hide(); - //alert("Fehler beim Aufruf der Seite: " + configResult.msg); } } @@ -226,7 +224,6 @@ function bindNewReservationBtn() { remark: remark }; - // prepare next page for email var emailtext = emailTemplate; emailtext = emailtext.replace(/DATUM/g,date.getDate() + "." + (date.getMonth() + 1) + "." + date.getFullYear()); emailtext = emailtext.replace(/ANZAHL/g,persons); @@ -320,12 +317,10 @@ function insertReservations(answer) { var hour = 0; var residx = 0; for (hour=0;hour<24;hour++) { - // collect reservations for hour var resofhour = []; times[hour] = resofhour; } - // now every hour has its (empty) array... var maxCol = 0; var hasTotalRes = false; @@ -348,7 +343,6 @@ function insertReservations(answer) { } } - // now times table is filled. Create html if (!hasTotalRes) { html += " " + RES_NORES[lang] + ""; @@ -387,7 +381,6 @@ function insertReservations(answer) { function fitsInCol(times,maxCol,start,end) { var col = 0; for (col=0;col<=(maxCol+1);col++) { - // does it fit in this col? var h = 0; var fits = true; for (h=start;h<=end;h++) { @@ -400,7 +393,6 @@ function fitsInCol(times,maxCol,start,end) { return col; } } - // should never be come to this point return maxCol+1; } @@ -464,17 +456,14 @@ function bindCusElem() { e.stopImmediatePropagation(); e.preventDefault(); - // REM* find customer in filteredCustomers var cusid = this.id.split("_")[1]; for (var i=0;i copy customer values into the fields $("#guestname").val(aCus.name); $("#email").val(aCus.email); $("#telno").val(aCus.phone); - // REM* now clean the search stuff $("#customer").val(""); $("#customerlist").html(''); } @@ -603,7 +592,6 @@ $(document).on("pageinit", "#res-page", function () { $(document).on("pagebeforeshow", "#changeres-page", function () { if (lang < 0) { - // user has refreshed change page - that does not work! setTimeout(function(){document.location.href = "reservation.html?"},500); } else { $("#ctimefieldse").selectmenu('refresh', true); @@ -617,13 +605,13 @@ $(document).on("pagebeforeshow", "#changeres-page", function () {
      -
    • Module
    • +
    • Hauptmenü

    Reservierung

    diff --git a/webapp/supplydesk.html b/webapp/supplydesk.html index 5943232..7f0251e 100644 --- a/webapp/supplydesk.html +++ b/webapp/supplydesk.html @@ -5,7 +5,7 @@ - + @@ -281,13 +281,13 @@ function initializeEverything() {
      -
    • Module
    • +
    • Hauptmenü

    Bereitstellung

    diff --git a/webapp/time.html b/webapp/time.html index 1c1240a..5a3436a 100644 --- a/webapp/time.html +++ b/webapp/time.html @@ -111,13 +111,13 @@ $(document).on("pageinit", "#index-page", function () {
      -
    • Module
    • +
    • Hauptmenü

    Zeitabgleich

    diff --git a/webapp/utilities.js b/webapp/utilities.js index 1bb60ea..bc68b91 100644 --- a/webapp/utilities.js +++ b/webapp/utilities.js @@ -8,8 +8,8 @@ function initializeMainMenu(menuid) { $("#versioninfo").html(moduleEntries.version + " "); if (moduleEntries.loggedin == 1) { $("#loggedinuser").html(" " + moduleEntries.user); - var li='
  • Module
  • '; - $.each(moduleEntries.menu, function (i, module) { + var li='
  • Hauptmenü
  • '; + $.each(moduleEntries.menu, function (i, module) { var name = module.name; var link = module.link; if ((name != "Abmelden") && (name != "Log out") && (name != "Adios")) { diff --git a/webapp/waiter.html b/webapp/waiter.html index 1fa5624..6bede63 100644 --- a/webapp/waiter.html +++ b/webapp/waiter.html @@ -4,7 +4,7 @@ - + @@ -32,19 +32,19 @@ +var W_TABLES=["Tische","Tables","Mesas"];var W_ATABLE=["Tisch","Table","Mesa"];var W_ROOMS=["Räume","Rooms","Espacios"];var W_SELECTION=["Auswahl","Selection","Selección"];var W_LAST_SELECTED=["zuletzt","last","seleccionado"];var W_FAVS=["Favoriten","Favorites","Favoritos"];var W_NEW_ORDER=["Neue Order","New Orders","Ordenes nuevas"];var W_KIT_BAR=["nicht serviert/unbezahlt","unserved/unpaid","no servido/impagado"];var W_OTHER_PROD=["Auswahl Produktkategorie","Select product categroy","Categoría diferente"];var W_WORK_TICKET=["Arbeitsbon","Work ticket","Tique de trabajar"];var W_NOTE=["Bemerkung","Comment","Comentario"];var W_SEND_ORDERS=["Bestellung senden","Send orders","Enviar Ordenes"];var W_TO_PAYDESK=["-> Kasse","-> Paydesk","-> Caja"];var W_TABLECHANGE=["Tischwechsel","Change table","Cambiar mesa"];var W_ROOMTABLE=["Raum-Tisch","Room-Table","Espacio-Mesa"];var W_TABLE_SEL=["Tischauswahl","Select table","Qué mesa?"];var W_UNDELIV_INFO=["Liste enthält die Produkte die noch in der Küchen-/Baransicht sind, sowie unbezahlte Produkte, die die Bereitstellungsansicht nicht durchlaufen.","List contains the products which are still in kitchen or bar view, as well as unpaid products that do not pass the supplydesk view.","La lista contiene los productos que estan todavía en modulo de cocina/bar, también productos impagados que no pasan vista de productos preparados."];var W_REMOVE_ERROR=["Ansicht nicht mehr aktuell - Liste wird neu geladen.","View is obsolete - List will be reloaded.","Vista no esta actual - vamos a actualisar la lista."];var W_FOOD_FOR=["Speisen für","Food for","Comidas para"];var W_DRINKS_FOR=["Getränke für","Beverage for","Bebidas para"];var W_ACT_NEW_ORD_EL=["Aktion auswählen","Select action","Que acción?"];var W_ACT_CHANGE=["Ändern","Modify","Modificar"];var W_ACT_CHANGE_ALL=["Alle Ändern","Modify all","Modificar todo"];var W_ACT_CHANGE_ONE=["Einen Artikel ändern","Modify one item","Modificar un artículo"];var W_APPLY=["Anwenden","Apply","Aplicar"];var W_CANCEL=["Abbrechen","Cancel","Cancelar"];var W_STILL_UNSENT_ORDERS=["Es sind noch ungesendete Orders vorhanden!","There are unsent orders in the list","Hay elementos in la liste que no han enviados"];var W_EXTRAS=["Extras/Optionen","Add-ons/Options","Opciones"];var W_OPEN_PANEL=["Extras-Auswahl noch offen","Add-ons selection still open","Selección de opciones todavía abierta"];var W_DEL=["Löschen","Delete","Removar"];var W_MSG=["Nachricht","Message","Mensaje"];var W_CHANGE_PRICE=["Neuer Preis: ","New price: ","Cambiar precio: "];var W_PRICE=["Preis","Price","Precio"];var W_WRONG_FORMAT=["Falsches Zahlenformat","Wrong number format","Formato de precio incorecto"];var W_TOGO=["Außer-Haus-Verkauf","Sale with Tax No 2","Venta IVA 2"];var W_YES=["Ja","Yes","Si"];var W_NO=["Nein","No","No"];var W_DISCARD_NO_ASK=["Es sind noch ungesendete Orders vorhanden! Sollen diese verworfen werden?","There are still unsent orders. Do you want to discard them?","Hay todavía ordenes non-enviados. Removarlos?"];var W_DISCARD_HEADER=["Neue Orders verwerfen?","Discard new orders?","Removar ordenes nuevos?"];var W_SEARCH=["Produktsuche","Product search","Buscar producto"];var W_SEARCHRESULTS=["Suchergebnis","Search Result","Encontrado"];var W_WRONG_PIN=["Falscher Stornocode","Wrong cancel code","Codigo falso"];var W_NO_ORDERS=["Keine gebuchten Orders vorhanden!","No orders available!","No hay ningún orden!"];var W_TO_PAY=["offen","to pay","a pagar"];var W_MOVE_PRODS=["Produkte verschieben","Move products","Productos a otra mesa"];var W_NO_PRODS_SELECTED=["Es wurden keine Produkte ausgewählt!","You have not chosen any products!","No ha seleccionado ningún producto!"];var W_MAX_PRICE_EXCEEDED=["Der Maximalwert für den Preis wurde überschritten!","The max. value for the price is exceeded!","El valor del precio es más que el maximum!"];var W_REORDER=["Nachbestellen","Reorder","Order una vez mas"];var W_REMOVE=["Entfernen","Remove","Removar"];var W_SELALL=["Alles auswählen","Select all","Elegir todo"];var W_UNSELALL=["Alles abwählen","Unselect all","No elegir nada"];var W_ONLY=["noch","only","sólo"];var W_DEL_ALL_UNDELIVERED=["Entferne alles","Remove all","Borrar todo"];var W_DEL_ALL_ASSIGNED_PRODS=["Alle Produkte löschen?","Delete all products?","Removar todos los productos?"];var CHANGE_ALL=0;var CHANGE_ONE=1;var WORKFLOW_DIGI_WORK=0;var WORKFLOW_DIGI=1;var WORKFLOW_WORK=2;var WORKFLOW_WORK_SEND=3;function Grouping(b,a){this.set=b;this.sortedset=[];this.group=function(){this.sortedset=[];for(var g=0;g/g,">"))}function setLanguage(h){lang=h;$("#roomtableheader2").html(W_ROOMTABLE[lang]);$("#tableselection").html(W_TABLE_SEL[lang]);$("#actiontxt").html(W_ACT_NEW_ORD_EL[lang]);$("#actdeltxt").html(W_DEL[lang]);$("#discard_new_orders_yes").html(W_YES[lang]);$("#discard_new_orders_no").html(W_NO[lang]);$("#discardnewordersask").html(W_DISCARD_NO_ASK[lang]);$("#discardnoheader").html(W_DISCARD_HEADER[lang]);$("#moveprods").html(W_MOVE_PRODS[lang]);var f="";if(prominentsearch==0){f+='
    '}else{f+='
    '}f+="
    ";var e='
    ';if(prominentsearch==0){$("#searchposition-normal").html(f)}else{$("#searchposition-prominent").html(f)}var b=e;if((workflowconfig==WORKFLOW_DIGI_WORK)||(workflowconfig==WORKFLOW_DIGI)||(workflowconfig==WORKFLOW_WORK_SEND)){b+=''+W_SEND_ORDERS[lang]+""}if((workflowconfig==WORKFLOW_DIGI_WORK)||(workflowconfig==WORKFLOW_WORK)||(workflowconfig==WORKFLOW_WORK_SEND)){b+=''+W_WORK_TICKET[lang]+""}if(cashenabled==1){b+=''+W_TO_PAYDESK[lang]+""}b+='';$("#commandbuttons").html(b);$("#waiterui").trigger("create");var c='
    ';$("#actremark").html(c);if(rightchangeprice==1){var a='';$("#actchangepricesection").html(a);var g='";$("#actdiscount").html(g)}$("#actionneworderconfirm_all").html(W_ACT_CHANGE_ALL[lang]);$("#actionneworderconfirm_one").html(W_ACT_CHANGE_ONE[lang]);$("#actionnewordercancel").html(W_CANCEL[lang]);$("#select-comment").off("click").on("click",function(k){k.stopImmediatePropagation();k.preventDefault();var i=$("#select-comment").find(":selected").val();$("#optionfield").val(i)});$("#act-select-comment").off("click").on("click",function(k){k.stopImmediatePropagation();k.preventDefault();var i=$("#act-select-comment").find(":selected").val();$("#act-optionfield").val(i)});$("#discard_new_orders_no").off("click").on("click",function(i){i.stopImmediatePropagation();i.preventDefault();parent.history.back()});$("#discard_new_orders_no").off("click").on("click",function(i){i.stopImmediatePropagation();i.preventDefault();parent.history.back()});$("#discard_new_orders_yes").off("click").on("click",function(i){i.stopImmediatePropagation();i.preventDefault();neworders=[];gotoOtherPage($("#discardnewordersdlg").data("link"))});$("#prodbackbtn").off("click").on("click",function(i){if(neworders.length!=0){i.stopImmediatePropagation();i.preventDefault();hideMenuProd();$("#discardnewordersdlg").data("link","back_table");$.mobile.changePage("#discardnewordersdlg")}else{parent.history.back()}});$("#searchField").off("keyup").on("keyup",function(i){generateSearchResults()})}function generateSearchResults(){var e=$("#searchField").val().trim().toLowerCase();if(e.length<3){$("#searchResult").html("")}else{var c=getProdSizeClass();var b='";$("#searchResult").html(b);$("#searchResult").trigger("create");$(".srinfo").off("click").on("click",function(i){i.stopImmediatePropagation();i.preventDefault();var f=this.id.split("_")[1];var h=getProdEntry(f);var g=h.price;alert(W_PRICE[lang]+": "+g+" "+currency)});$(".srplus").off("click").on("click",function(h){h.stopImmediatePropagation();h.preventDefault();var g=this.id.split("_")[1];var f=getSearchProdCount(g);$("#srprodcount_"+g).html(f+1)});$(".srminus").off("click").on("click",function(h){h.stopImmediatePropagation();h.preventDefault();var g=this.id.split("_")[1];var f=getSearchProdCount(g);if(f==2){$("#srprodcount_"+g).html("");selectedProdCount=1}else{if(f>2){$("#srprodcount_"+g).html(f-1)}}});$(".searchresult").off("click").on("click",function(g){g.stopImmediatePropagation();g.preventDefault();favOrSearchWasClicked=true;var f=this.id.split("_")[1];selectedProdCount=getSearchProdCount(f);clearSearchAndGoToHigherTypeIfExtrasOpen();levelOneType=0;handleClickOnProd(f)})}}function fillGenCommentsList(f){if(f.status!="OK"){alert("Fehler "+f.code+": "+f.msg);return}var b='';var e=f.msg;var c=0;for(c=0;c'+a+""}htmlComments=b;predefinedComments=b;$("#select-comment").html(b);$("#select-comment").selectmenu("refresh")}function initializeMainMenu(a,h,e,i,g){$("#"+e).html(" "+a.user);$("#"+i).html(a.version+" ");var k='
  • Module
  • ';$.each(a.menu,function(n,m){var l=m.name;var o=m.link;if(g){k+='
  • '+l+"
  • "}else{k+='
  • '+l+"
  • "}});$(h).empty().append(k).promise().done(function(){refreshList(h)});if(h=="#modulemenu-room"){var c=a.waitermessage;if(c!=""){$("#waitermessage").show();var b='
  • '+W_MSG[lang]+"
  • ";var f='
  • '+toHtml(c)+"
  • ";$("#waitermessage").html(b+f);refreshList("#waitermessage")}else{$("#waitermessage").hide()}}$(".modulebutton").off("click").on("click",function(m){var l=$(this).attr("href");doJsonAjaxAsync("POST","php/contenthandler.php?module=admin&command=setLastModuleOfUser",{view:l},null,"Problem Benutzerdatenpflege",false)})}function refreshList(a){if($(a).hasClass("ui-listview")){$(a).listview("refresh")}else{$(a).trigger("create")}}function gotoOtherPage(a){var b=a.split("_");if(b[0]=="menu"){doJsonAjax("POST","php/contenthandler.php?module=admin&command=setLastModuleOfUser",{view:b[1]},null,null);setTimeout(function(){document.location.href=b[1]},250)}else{if(b[0]=="back"){$("#discardnewordersdlg").dialog("close");parent.history.back()}}}function moduleForward(a){if(neworders.length==0){gotoOtherPage(a)}else{hideMenuProd();$("#discardnewordersdlg").data("link",a);$.mobile.changePage("#discardnewordersdlg")}}function getPayPrintType(){doJsonAjax("GET","php/contenthandler.php?module=admin&command=getPayPrintType",null,insertPayPrintType,"Fehler Druckkonfiguration")}function insertPayPrintType(a){$("#workprintarea").data("payPrintType",a)}function getUserHasRightForPaydesk(){doJsonAjax("GET","php/contenthandler.php?module=admin&command=hasUserPaydeskRight",null,hasUserPaydeskRight,"Fehler Kassenberechtigung")}function hasUserPaydeskRight(a){$("#gopaydesk_btn").data("allowed",a)}function hideMenuRoom(){$("#modulepanel-room").panel("close");$("#menuswitch").off("click").on("click",function(a){a.stopImmediatePropagation();a.preventDefault();$("#modulepanel-room").panel("open")})}function hideMenuTable(){$("#modulepanel-table").panel("close");$("#menuswitchtable").off("click").on("click",function(a){a.stopImmediatePropagation();a.preventDefault();$("#modulepanel-table").panel("open")})}function hideMenuProd(){$("#modulepanel-prod").panel("close");$("#menuswitchprod").off("click").on("click",function(a){a.stopImmediatePropagation();a.preventDefault();$("#modulepanel-prod").panel("open")})}function addProductToQueueNoGuiUpdate(f,l,g,c,e){var b=getProdProperties(f);var a=b.name;var h=b.price;var m={name:a,option:l,extras:g,prodid:f,price:h,changedPrice:c,togo:e};for(var k=0;k";var l=groupedNewOrders.count.length;for(f=0;f1){k=""+g.toString()+"x "+k}var e=groupedNewOrders.prodids[f];if(h!=""){h="

    "+toHtml(h)+"

    "}var b=groupedNewOrders.changedPrices[f];var a=groupedNewOrders.togos[f];var n="";var c=groupedNewOrders.extras[f];if((c!=null)&&(c!="")){n=""+c+""}if(b!="NO"){b=b.replace(".",decpoint);if(a!=0){m+='
  • '+k+h+n+" ("+b+" - To-Go)
  • "}else{m+='
  • '+k+h+n+" ("+b+")
  • "}}else{if(a!=0){m+='
  • '+k+h+n+" - To-Go
  • "}else{m+='
  • '+k+h+n+"
  • "}}}$("#neworders").html(m);refreshList("#neworders");binding_neworderelem()}function getProdSizeClass(){if(osprodbtnsize==1){return("osprod-1")}else{if(osprodbtnsize==2){return("osprod-2")}}return""}function binding_neworderelem(){$(".neworder_el").off("click").on("click",function(c){c.stopImmediatePropagation();c.preventDefault();var b=$("#neworders li").index($(this).closest("li"))-1;var a={count:groupedNewOrders.count[b],name:groupedNewOrders.name[b],price:groupedNewOrders.price[b],option:groupedNewOrders.option[b],extras:groupedNewOrders.extras[b],prodid:groupedNewOrders.prodids[b],origidxs:groupedNewOrders.origidxs[b],changedPrices:groupedNewOrders.changedPrices[b],togos:groupedNewOrders.togos[b]};$("#actiononneworderel").data("entry",a);$("#actiononneworderel").data("newcount",a.count);$("#actiononneworderel").data("groupedListIndex",b);$("#act-optionfield").val(a.option);$("#togocheckbox").prop("checked",a.togos==1?true:false);actionSelOnNewOrderElem()})}function sendNewOrders(c,f,a){var g=$("#typprodpage").data("table-info");var b=g[1];if(neworders.length!=0){var e={tableid:b,prods:neworders,print:(c?1:0),payprinttype:f};$("#typprodpage").data("neworders",[]);if(f=="s"){doJsonAjax("POST","php/contenthandler.php?module=queue&command=addProductListToQueue",e,a,"Fehler bei Produktversand")}else{doJsonAjax("POST","php/contenthandler.php?module=queue&command=addProductListToQueue",e,fillPrintAreaAndPrint,"Fehler bei Produktversand")}}else{if(c&¬DeliveredProdsAvailable){}}}function reloadPage(){tableListActive=false;setTimeout(function(){document.location.href="waiter.html"},250)}function gotoTablePage(){var a=$("#tables-page").data("allroomtables");var b=a.length;if(!isTogoOrderSelected||(b==1)){$.mobile.changePage("#tables-page")}else{reloadPage()}}function removeProductFromQueue(a,c,f,e,b,g){if(typeof g==="undefined"){g=true}if(!b){alert(W_WRONG_PIN[lang]);return}$.ajax({type:"POST",dataType:"json",url:"php/contenthandler.php?module=queue&command=removeProductFromQueue",data:{queueid:a,isPaid:c,isCooking:f,isReady:e},async:false,success:function(l){if(l.status!="OK"){alert(W_REMOVE_ERROR[lang])}var k=$("#typprodpage").data("table-info");var h=k[1];var i="php/contenthandler.php?module=queue&command=getJsonLongNamesOfProdsForTableNotDelivered&tableid="+h;if(g){fillNotDeliveredProductsOfATable(i)}},error:function(h){alert("Sorry, Fehler bei Produktentfernung!")}})}function reorderProduct(e,a,f){var c=[];for(var b=0;b'+k.name+""});a+='
  • '+W_TOGO[lang];var f=h.takeawayprice;var c=f.replace(".",decpoint)+" "+currency;if(f!=0){a+=" ("+W_TO_PAY[lang]+": "+c+")"}a+=createServeInfo(null,h.takeawayprodcount,h.takeawayprodready);a+="
  • ";$("#room-list").append(a).promise().done(function(){bindTogoOrdering();bindServeClick();$(this).off("click").on("click","a",function(l){l.stopImmediatePropagation();l.preventDefault();var k=b[this.id];currentRoomIndex=this.id;isTogoOrderSelected=false;$("#tables-page").data("roomdetail",k);nextPage="tables-page";$.mobile.changePage("#tables-page")});refreshList(this)})}})}function handleClickInTablemap(a){forwardDisplayToProductView.call(this,a.roomid,a.tableid,a.tablename)}$(document).on("pagebeforeshow","#tables-page",function(){lastSelectedProduct="";tableListActive=true;if(nextPage==""){reloadPage()}hideMenuTable();checkForLogIn();$("#searchField").val("");generateSearchResults();$("#tableselbackbtn").off("click").on("click",function(a){a.stopImmediatePropagation();a.preventDefault();tableListActive=false;$.mobile.changePage("#info-page")});updateTableList()});$(document).on("pagebeforeshow","#changetablewhatdialog",function(){var a=$("#changetablewhatdialog").data("fromtableid");doJsonAjax("GET","php/contenthandler.php?module=queue&command=getProdsForTableChange",{tableId:a},insertProductsToChangeTableDlg,"Tischartikel")});function insertProductsToChangeTableDlg(a){if(a.status!="OK"){alert("Fehler");return}prodsToMove=a.msg;allselected=1;updateProdToMoveList();$("#selectallnothing").off("click").on("click",function(f){f.stopImmediatePropagation();f.preventDefault();allselected=1-allselected;for(var c=0;c"+c.productname+b+"";a+="
  • "+g+"
  • "}$("#productsToMoveList").html(a);refreshList("#productsToMoveList");handleClickOnMoveableProd()}function handleClickOnMoveableProd(){$(".prodToMoveEl").off("click").on("click",function(f){f.stopImmediatePropagation();f.preventDefault();var b=this.id.split("_")[1];var a=prodsToMove[b];var c=a["class"];if(c=="unselecteditem"){a["class"]="selecteditem"}else{a["class"]="unselecteditem"}updateProdToMoveList()});$("#moveprods").off("click").on("click",function(k){k.stopImmediatePropagation();k.preventDefault();var g=[];for(var f=0;f'+W_TOGO[lang]+"";$("#tables-list-togo").html(k);$("#togoarea").show();refreshList("#tables-list-togo");bindTogoOrdering();bindServeClick()}}else{$(h).show();$("#togoarea").hide();$("#tablemapcontent").hide();var k='
  • '+W_TABLES[lang]+"
  • ";var f="";if(ostablebtnsize==1){f="ostable-1"}else{if(ostablebtnsize==2){f="ostable-2"}}$.each(l,function(p,s){var r=s.pricesum;var n=r.replace(".",decpoint)+" "+currency;var o=s.prodcount;var m=s.prodready;var q=s.readyQueueIds;if(r!=0){k+='
  • '+s.name+" ("+W_TO_PAY[lang]+": "+n+")"+createServeInfo(s.id,o,m)+"
  • "}else{k+='
  • '+s.name+createServeInfo(s.id,o,m)+"
  • "}});if(c=="t"){k+='
  • '+W_TOGO[lang]+"
  • "}$(h).empty().append(k).promise().done(function(){bindTogoOrdering();bindServeClick();$(this).off("click").on("click",".info-go",function(p){p.stopImmediatePropagation();p.preventDefault();var o=g;var m=l[this.id]["id"];var n=l[this.id]["name"];forwardDisplayToProductView.call(this,a,m,n)});refreshList(this)})}}function bindServeClick(){$(".prodreadyicon").off("click").on("click",function(l){l.stopImmediatePropagation();l.preventDefault();var f=this.id.split("_")[1];var h=queueIdsOfTakeAway;if((f!=null)&&(f!="n")){var a=$("#tables-page").data("roomdetail");var c=a.tables;for(var b=0;b0){var k=h.join();doJsonAjax("POST","php/contenthandler.php?module=queue&command=declareMultipleProductsDelivered",{queueids:k},updateAfterDelivery,"Bereitstellung")}})}function updateAfterDelivery(a){if(tableListActive){updateTableList()}else{reloadPage()}}function bindTogoOrdering(){$(".togoorder").off("click").on("click",function(a){a.stopImmediatePropagation();a.preventDefault();isTogoOrderSelected=true;forwardDisplayToProductView.call(this,0,0,W_TOGO[lang])})}function forwardDisplayToProductView(b,a,c){neworders=[];updateNewOrdersGui();var e=new Array(b,a,c);$("#typprodpage").data("table-info",e);nextPage="typprodpage";$.mobile.changePage("#typprodpage");neworders=[];updateNewOrdersGui()}function attachAndDisplayFirstRefTypes(e){$("#typprodpage").data("types_prods",e);var a=e.prods;var c=[];for(var b=0;b";if(applyExtraBtnPos!=1){k+='
  • '+W_APPLY[lang]+"
  • "}for(var f=0;f=0){b="f";h="check"}k+='
  • '+toHtml(g)+"
  • "}if(applyExtraBtnPos!=2){k+='
  • '+W_APPLY[lang]+"
  • "}k+=createHigherLine(l);return k}function bindExtrasSel(){$(".extrasel").off("click").on("click",function(m){m.stopImmediatePropagation();m.preventDefault();var a=this.id.split("_");var b=a[1];var f=a[2];if((b=="abottom")||(b=="atop")){var k=getProdEntry(f);var c=k.extras;var n=[];for(var h=0;h=0){n[n.length]={id:b,name:l}}}addProductToNewOrdersList(f,n)}else{if(w_extras.indexOf(b)>=0){w_extras.splice(w_extras.indexOf(b),1)}else{w_extras[w_extras.length]=b}var o=listOfExtras(f);$("#typeproducts-list").html(o);refreshList("#typeproducts-list");bindExtrasSel();bindHigherButtons()}})}function lastSelectedProdToStr(){return" ("+W_LAST_SELECTED[lang]+": "+lastSelectedProduct+")"}function listOfTypesProds(e){var a='
  • '+W_SELECTION[lang]+"";if(lastSelectedProduct!=""){a+=lastSelectedProdToStr()}a+="
  • ";var b=$("#typprodpage").data("types_prods");var c=getProdSizeClass();$.each(b.types,function(g,f){if(parseInt(f.ref)==e){a+='
  • '+toHtml(f.name)+"
  • "}});$.each(b.prods,function(f,g){if(parseInt(g.ref)==e){a+='
  • '+toHtml(g.name);if((g.amount!="null")&&(g.amount<11)){a+=" ("+W_ONLY[lang]+" "+g.amount+")"}a+=createProdInfoTxt(g.id);a+="
  • "}});if(e!=0){a+=createHigherLine(c)}return a}function createHigherLine(b){var a='
  • ';a+='
    ';a+='
    ';a+='
    ';a+="
    ";a+="
  • ";return a}function createProdInfoTxt(b){var a="";a+="
    ";a+="
    ";a+="
    ";return a}function createSearchProdInfoTxt(b){var a="";a+="
    ";a+="
    ";a+="
    ";return a}function createServeInfo(e,c,b){if(supplyright==0){return""}if(e==null){e="n"}if(b>0){var a=""+b+"("+c+")";if(b>=c){a+="
    "}else{a+="
    "}return a}else{return""}}function getProdEntry(e){var b=$("#typprodpage").data("types_prods");var c=0;var a=b.prods;for(c=0;c";var b=$("#typprodpage").data("types_prods");var e=getProdSizeClass();var a=false;var c=[];$.each(b.prods,function(g,h){if(parseInt(h.favorite)==1){a=true;c[c.length]={id:h.id,longname:h.longname}}});c.sort(prodcompare);$.each(c,function(g,h){f+='
  • '+toHtml(h.longname);f+=createProdInfoTxt(h.id);f+="
  • "});f+="";if(a){$("#favarea").html(f);$("#favarea").trigger("create")}else{$("#favarea").html("");$("#favarea").trigger("create")}}function bindFavEvent(){$(".fav").off("click").on("click",function(b){b.stopImmediatePropagation();b.preventDefault();favOrSearchWasClicked=true;levelOneType=0;var a=this.id.split("_")[1];selectedProdCount=getProdCount(a);handleClickOnProd(a)})}function displayTypesProds(c,b){window.scrollTo(0,0);if(c==0){fillFavArea();bindFavEvent()}else{$("#favarea").html("")}if(b==null){idOfHigherType=c;var a=listOfTypesProds(parseInt(c));extrasMenuOpen=false}else{var a=listOfExtras(parseInt(c));extrasMenuOpen=true}$("#typeproducts-list").empty().append(a).promise().done(function(){refreshList("#typeproducts-list");$(this).off("click").on("click","a",function(i){i.stopImmediatePropagation();i.preventDefault();favOrSearchWasClicked=false;$("#searchField").val("");generateSearchResults();var g=this.id;var f=g.split("_");if(f[0]=="t"){if(c==0){levelOneType=f[1];c=f[1]}displayTypesProds(f[1],null)}else{var h=f[1];selectedProdCount=getProdCount(h);handleClickOnProd(h)}});bindHigherButtons()});$(".prodinfo").off("click").on("click",function(i){i.stopImmediatePropagation();i.preventDefault();var f=this.id.split("_")[1];var h=getProdEntry(f);var g=h.price;alert(W_PRICE[lang]+": "+g+" "+currency)});$(".prodplus").off("click").on("click",function(h){h.stopImmediatePropagation();h.preventDefault();var g=this.id.split("_")[1];var f=getProdCount(g);$("#prodcount_"+g).html(f+1)});$(".prodminus").off("click").on("click",function(h){h.stopImmediatePropagation();h.preventDefault();var g=this.id.split("_")[1];var f=getProdCount(g);if(f==2){$("#prodcount_"+g).html("");selectedProdCount=1}else{if(f>2){$("#prodcount_"+g).html(f-1)}}})}function getHigherType(){var c=$("#typprodpage").data("types_prods");var b=c.types;var f=0;if(!extrasMenuOpen){for(var e=0;e0)){w_extras=[];w_allextras=a;idOfHigherType=c.ref;displayTypesProds(b,a);bindExtrasSel()}else{addProductToNewOrdersList(b,null)}}function addProductToNewOrdersList(f,e){var i=$("#typprodpage").data("table-info");var c=i[1];addProductToQueue(f,e,"NO",0);var a=getProdAudio(parseInt(f));var b=parseInt($("#typprodpage").data("ordervolume"))/10;if(a!=""){var h="customer/"+a;if(a.match(/mp3$/)){$("#audiofile").html('')}else{if(a.match(/ogg$/)){$("#audiofile").html('')}else{if(a.match(/wav$/)){$("#audiofile").html('')}}}document.getElementById("audiofile").load();document.getElementById("audiofile").volume=b;document.getElementById("audiofile").play()}else{if(b>0.5){beep()}}var g="php/contenthandler.php?module=queue&command=getJsonLongNamesOfProdsForTableNotDelivered&tableid="+c;fillNotDeliveredProductsOfATable(g);if(keeptypelevel==0){displayTypesProds(levelOneType,null)}else{if(extrasMenuOpen){displayTypesProds(idOfHigherType,null)}}refreshList("#typeproducts-list")}function beep(){var a=new Audio("data:audio/wav;base64,//uQRAAAAWMSLwUIYAAsYkXgoQwAEaYLWfkWgAI0wWs/ItAAAGDgYtAgAyN+QWaAAihwMWm4G8QQRDiMcCBcH3Cc+CDv/7xA4Tvh9Rz/y8QADBwMWgQAZG/ILNAARQ4GLTcDeIIIhxGOBAuD7hOfBB3/94gcJ3w+o5/5eIAIAAAVwWgQAVQ2ORaIQwEMAJiDg95G4nQL7mQVWI6GwRcfsZAcsKkJvxgxEjzFUgfHoSQ9Qq7KNwqHwuB13MA4a1q/DmBrHgPcmjiGoh//EwC5nGPEmS4RcfkVKOhJf+WOgoxJclFz3kgn//dBA+ya1GhurNn8zb//9NNutNuhz31f////9vt///z+IdAEAAAK4LQIAKobHItEIYCGAExBwe8jcToF9zIKrEdDYIuP2MgOWFSE34wYiR5iqQPj0JIeoVdlG4VD4XA67mAcNa1fhzA1jwHuTRxDUQ//iYBczjHiTJcIuPyKlHQkv/LHQUYkuSi57yQT//uggfZNajQ3Vmz+Zt//+mm3Wm3Q576v////+32///5/EOgAAADVghQAAAAA//uQZAUAB1WI0PZugAAAAAoQwAAAEk3nRd2qAAAAACiDgAAAAAAABCqEEQRLCgwpBGMlJkIz8jKhGvj4k6jzRnqasNKIeoh5gI7BJaC1A1AoNBjJgbyApVS4IDlZgDU5WUAxEKDNmmALHzZp0Fkz1FMTmGFl1FMEyodIavcCAUHDWrKAIA4aa2oCgILEBupZgHvAhEBcZ6joQBxS76AgccrFlczBvKLC0QI2cBoCFvfTDAo7eoOQInqDPBtvrDEZBNYN5xwNwxQRfw8ZQ5wQVLvO8OYU+mHvFLlDh05Mdg7BT6YrRPpCBznMB2r//xKJjyyOh+cImr2/4doscwD6neZjuZR4AgAABYAAAABy1xcdQtxYBYYZdifkUDgzzXaXn98Z0oi9ILU5mBjFANmRwlVJ3/6jYDAmxaiDG3/6xjQQCCKkRb/6kg/wW+kSJ5//rLobkLSiKmqP/0ikJuDaSaSf/6JiLYLEYnW/+kXg1WRVJL/9EmQ1YZIsv/6Qzwy5qk7/+tEU0nkls3/zIUMPKNX/6yZLf+kFgAfgGyLFAUwY//uQZAUABcd5UiNPVXAAAApAAAAAE0VZQKw9ISAAACgAAAAAVQIygIElVrFkBS+Jhi+EAuu+lKAkYUEIsmEAEoMeDmCETMvfSHTGkF5RWH7kz/ESHWPAq/kcCRhqBtMdokPdM7vil7RG98A2sc7zO6ZvTdM7pmOUAZTnJW+NXxqmd41dqJ6mLTXxrPpnV8avaIf5SvL7pndPvPpndJR9Kuu8fePvuiuhorgWjp7Mf/PRjxcFCPDkW31srioCExivv9lcwKEaHsf/7ow2Fl1T/9RkXgEhYElAoCLFtMArxwivDJJ+bR1HTKJdlEoTELCIqgEwVGSQ+hIm0NbK8WXcTEI0UPoa2NbG4y2K00JEWbZavJXkYaqo9CRHS55FcZTjKEk3NKoCYUnSQ0rWxrZbFKbKIhOKPZe1cJKzZSaQrIyULHDZmV5K4xySsDRKWOruanGtjLJXFEmwaIbDLX0hIPBUQPVFVkQkDoUNfSoDgQGKPekoxeGzA4DUvnn4bxzcZrtJyipKfPNy5w+9lnXwgqsiyHNeSVpemw4bWb9psYeq//uQZBoABQt4yMVxYAIAAAkQoAAAHvYpL5m6AAgAACXDAAAAD59jblTirQe9upFsmZbpMudy7Lz1X1DYsxOOSWpfPqNX2WqktK0DMvuGwlbNj44TleLPQ+Gsfb+GOWOKJoIrWb3cIMeeON6lz2umTqMXV8Mj30yWPpjoSa9ujK8SyeJP5y5mOW1D6hvLepeveEAEDo0mgCRClOEgANv3B9a6fikgUSu/DmAMATrGx7nng5p5iimPNZsfQLYB2sDLIkzRKZOHGAaUyDcpFBSLG9MCQALgAIgQs2YunOszLSAyQYPVC2YdGGeHD2dTdJk1pAHGAWDjnkcLKFymS3RQZTInzySoBwMG0QueC3gMsCEYxUqlrcxK6k1LQQcsmyYeQPdC2YfuGPASCBkcVMQQqpVJshui1tkXQJQV0OXGAZMXSOEEBRirXbVRQW7ugq7IM7rPWSZyDlM3IuNEkxzCOJ0ny2ThNkyRai1b6ev//3dzNGzNb//4uAvHT5sURcZCFcuKLhOFs8mLAAEAt4UWAAIABAAAAAB4qbHo0tIjVkUU//uQZAwABfSFz3ZqQAAAAAngwAAAE1HjMp2qAAAAACZDgAAAD5UkTE1UgZEUExqYynN1qZvqIOREEFmBcJQkwdxiFtw0qEOkGYfRDifBui9MQg4QAHAqWtAWHoCxu1Yf4VfWLPIM2mHDFsbQEVGwyqQoQcwnfHeIkNt9YnkiaS1oizycqJrx4KOQjahZxWbcZgztj2c49nKmkId44S71j0c8eV9yDK6uPRzx5X18eDvjvQ6yKo9ZSS6l//8elePK/Lf//IInrOF/FvDoADYAGBMGb7FtErm5MXMlmPAJQVgWta7Zx2go+8xJ0UiCb8LHHdftWyLJE0QIAIsI+UbXu67dZMjmgDGCGl1H+vpF4NSDckSIkk7Vd+sxEhBQMRU8j/12UIRhzSaUdQ+rQU5kGeFxm+hb1oh6pWWmv3uvmReDl0UnvtapVaIzo1jZbf/pD6ElLqSX+rUmOQNpJFa/r+sa4e/pBlAABoAAAAA3CUgShLdGIxsY7AUABPRrgCABdDuQ5GC7DqPQCgbbJUAoRSUj+NIEig0YfyWUho1VBBBA//uQZB4ABZx5zfMakeAAAAmwAAAAF5F3P0w9GtAAACfAAAAAwLhMDmAYWMgVEG1U0FIGCBgXBXAtfMH10000EEEEEECUBYln03TTTdNBDZopopYvrTTdNa325mImNg3TTPV9q3pmY0xoO6bv3r00y+IDGid/9aaaZTGMuj9mpu9Mpio1dXrr5HERTZSmqU36A3CumzN/9Robv/Xx4v9ijkSRSNLQhAWumap82WRSBUqXStV/YcS+XVLnSS+WLDroqArFkMEsAS+eWmrUzrO0oEmE40RlMZ5+ODIkAyKAGUwZ3mVKmcamcJnMW26MRPgUw6j+LkhyHGVGYjSUUKNpuJUQoOIAyDvEyG8S5yfK6dhZc0Tx1KI/gviKL6qvvFs1+bWtaz58uUNnryq6kt5RzOCkPWlVqVX2a/EEBUdU1KrXLf40GoiiFXK///qpoiDXrOgqDR38JB0bw7SoL+ZB9o1RCkQjQ2CBYZKd/+VJxZRRZlqSkKiws0WFxUyCwsKiMy7hUVFhIaCrNQsKkTIsLivwKKigsj8XYlwt/WKi2N4d//uQRCSAAjURNIHpMZBGYiaQPSYyAAABLAAAAAAAACWAAAAApUF/Mg+0aohSIRobBAsMlO//Kk4soosy1JSFRYWaLC4qZBYWFRGZdwqKiwkNBVmoWFSJkWFxX4FFRQWR+LsS4W/rFRb/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////VEFHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAU291bmRib3kuZGUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMjAwNGh0dHA6Ly93d3cuc291bmRib3kuZGUAAAAAAAAAACU=");a.play()}function fetchTypeProdsFromServer(){doJsonAjaxAsync("GET","php/contenthandler.php?module=products&command=getAllTypesAndAvailProds",null,attachAndDisplayFirstRefTypes,true)}var waitProdTimer=null;function fillTypeProdList(b){var a=$("#typprodpage").data("types_prods");if(a!=undefined){displayTypesProds(b,null)}else{waitProdTimer=setInterval(function(){var c=$("#typprodpage").data("types_prods");if(c!=undefined){clearInterval(waitProdTimer);displayTypesProds(b,null)}},200)}}function fillTypeProdList_(a){displayTypesProds(a,null)}function createTxtAssignedProd(e){var b="";if(e.option!=""){b=" ("+toHtml(e.option)+")"}var c=e.longname;if(e.togo==1){c="To-Go: "+c}if(e.pricechanged==1){c+=" - "+e.price.replace(".",decpoint)}var a="";if(e.isready=="1"){a+=" ☞"}if(e.isCooking=="1"){a+=" ♨"}if(e.isPaid=="1"){a+=" ☑"}return toHtml(c)+b+a+"
    "+createExtraParagraph(e.extras)}function createListElOfAssignedProd(b){var a="";if("count" in b){if(b.count>1){a=b.count+"x "}}if(b.isready=="0"){return'
  • '+a+createTxtAssignedProd(b)+"
  • "}else{return'
  • '+a+createTxtAssignedProd(b)+"
  • "}}function fillAssignedProdList(b){if(b.length>0){notDeliveredProdsAvailable=true}else{notDeliveredProdsAvailable=false}$("#cancelcodefield").val("");if(cancelunpaidcode!=""){if(b.length>0){$("#cancelcodearea").show()}else{$("#cancelcodearea").hide()}}else{$("#cancelcodearea").hide()}var c=new Grouping(b,createTxtAssignedProd);c.group();var a='
  • '+W_KIT_BAR[lang]+"
  • ";a+=c.outputList(createListElOfAssignedProd);if(notDeliveredProdsAvailable){a+='
  • '+W_DEL_ALL_UNDELIVERED[lang]+"
  • "}$("#orderedprod-list-0").html(a);refreshList("#orderedprod-list-0");$("#undeliveredheader").off("click").on("click",function(f){f.stopImmediatePropagation();f.preventDefault();alert(W_UNDELIV_INFO[lang])});bindingOfAssignedProds(c);bindDelAllUndeliveredProds(b)}function bindDelAllUndeliveredProds(a){$("#delallundelivered").off("click").on("click",function(b){b.stopImmediatePropagation();b.preventDefault();areYouSure("Produkte löschen.",W_DEL_ALL_ASSIGNED_PRODS[lang],W_REMOVE[lang],function(){removeAllAssignedProds(a)})})}function removeAllAssignedProds(h){var c=true;if(cancelunpaidcode!=""){if($("#cancelcodefield").val()!=cancelunpaidcode){c=false;alert(W_WRONG_PIN[lang]);return}}for(var f=0;f