diff --git a/printserver/OrderSprinterPrintserver.exe b/printserver/OrderSprinterPrintserver.exe index 5379dcb..0a26c13 100644 Binary files a/printserver/OrderSprinterPrintserver.exe and b/printserver/OrderSprinterPrintserver.exe differ diff --git a/spider/install/installer.php b/spider/install/installer.php index a039fa5..0e42664 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.23"); + Database::setVersion($pdo,$prefix,"1.3.24"); 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/spider/php/clients.php b/spider/php/clients.php index 2dc5d3d..db79765 100644 --- a/spider/php/clients.php +++ b/spider/php/clients.php @@ -181,5 +181,3 @@ function readclients() { header("Location: ../infopage.html?i=overview.php=Import_war_erfolgreich."); /* Browser umleiten */ exit; } - -?> \ No newline at end of file diff --git a/spider/php/datacollector.php b/spider/php/datacollector.php index 42be298..62e91a7 100644 --- a/spider/php/datacollector.php +++ b/spider/php/datacollector.php @@ -125,5 +125,3 @@ function getDataFromClient($clientid,$command,$data) { echo $file; } - -?> \ No newline at end of file diff --git a/webapp/OrderSprinterPrintserver.exe b/webapp/OrderSprinterPrintserver.exe index 5379dcb..0a26c13 100644 Binary files a/webapp/OrderSprinterPrintserver.exe and b/webapp/OrderSprinterPrintserver.exe differ diff --git a/webapp/bar.html b/webapp/bar.html index 3c8adbc..7b16e2b 100644 --- a/webapp/bar.html +++ b/webapp/bar.html @@ -5,7 +5,7 @@ - + @@ -109,7 +109,7 @@ function initializeEverything() {
-

Bar

+

Bar

Hauptmenü
diff --git a/webapp/bill.html b/webapp/bill.html index afda751..8702226 100644 --- a/webapp/bill.html +++ b/webapp/bill.html @@ -5,7 +5,7 @@ - + @@ -464,7 +464,7 @@ $(document).on("pageinit", "#bill-page", function () {
-

Kassenbons

+

Kassenbons

Hauptmenü
diff --git a/webapp/customers.html b/webapp/customers.html index d92c724..50f17ec 100644 --- a/webapp/customers.html +++ b/webapp/customers.html @@ -125,7 +125,7 @@ $(document).on("pageinit", "#info-page", function () {
-

Gäste

+

Gäste

Hauptmenü
diff --git a/webapp/dash.php b/webapp/dash.php index f0c58ba..603afca 100644 --- a/webapp/dash.php +++ b/webapp/dash.php @@ -214,7 +214,7 @@
-

OrderSprinter

+

OrderSprinter

Hauptmenü
diff --git a/webapp/feedback.html b/webapp/feedback.html index ef4e114..cd0234d 100644 --- a/webapp/feedback.html +++ b/webapp/feedback.html @@ -4,7 +4,7 @@ - + diff --git a/webapp/help.php b/webapp/help.php index 72993aa..0e01064 100644 --- a/webapp/help.php +++ b/webapp/help.php @@ -39,7 +39,7 @@ $(document).on("pageinit", "#help-page", function () {
-

OrderSprinter Hilfe

+

OrderSprinter Hilfe

Hauptmenü
diff --git a/webapp/img/connection.png b/webapp/img/connection.png new file mode 100644 index 0000000..b256e4d Binary files /dev/null and b/webapp/img/connection.png differ diff --git a/webapp/index.html b/webapp/index.html index 109edb7..420c42d 100644 --- a/webapp/index.html +++ b/webapp/index.html @@ -9,8 +9,8 @@ - - + + @@ -215,7 +215,7 @@ function handleResultOfInstallCheck(is_installed) { if (is_installed == "Yes") { useInstallation(); } else { - setTimeout(function(){document.location.href = "install.html?v=1.3.23"},500); + setTimeout(function(){document.location.href = "install.html?v=1.3.24"},500); } } @@ -240,7 +240,7 @@ $(document).on("pageinit", "#index-page", function () {
-

OrderSprinter

+

OrderSprinter

Hauptmenü
diff --git a/webapp/install.html b/webapp/install.html index a46fd70..cdaaa29 100644 --- a/webapp/install.html +++ b/webapp/install.html @@ -47,8 +47,8 @@ var NOTWRITEABLE = ["Nicht beschreibbar","No write access","Imposible sobrescrib var WORKING = ["Arbeitet...","Working...","Trabajando..."]; var DB_SETTING_WRONG = ["Datenbank-Angaben falsch","Data base values wrong","Datos de la base de datos falsos"]; var ERROR = ["Installation/Update nicht erfolgreich: ", "Install/Update not performed: ", "Problema con el update/instal: "]; -var UPDATE_OK = ["Update erfolgreich! Bitte install-Verzeichnis löschen.","Update successful! Please remove install directory.","Update completo. Esta recomendado removar el fichero 'install'"]; -var AUTO_UPDATE_OK = ["Update erfolgreich! Bitte vergessen Sie nicht, auch den Printserver zu updaten, wenn Sie dessen neuen Funktionen nutzen möchten.","Update successful! Please do not forget to update the printservers if you want to use its new features.","Update completo. No olvide el printserver si quiere usa sus funciones nuevas."]; +var UPDATE_OK = ["Update erfolgreich! Bitte install-Verzeichnis löschen. Bitte beachten Sie, dass die Software im Fehlerfall Debug-Daten an den Anbieter sendet. Mehr Infos dazu auf der Homepage.","Update successful! Please remove install directory. Please be aware that debug data will be sent to the provider in case of malfunctions.","Update completo. Esta recomendado removar el fichero 'install'. Por favor dar cuenta que debug data esta enviado fuera en caso de malfunctions."]; +var AUTO_UPDATE_OK = ["Update erfolgreich! Bitte vergessen Sie nicht, auch den Printserver zu updaten, wenn Sie dessen neuen Funktionen nutzen möchten. Bitte beachten Sie, dass die Software im Fehlerfall Debug-Daten an den Anbieter sendet. Mehr Infos dazu auf der Homepage.","Update successful! Please do not forget to update the printservers if you want to use its new features. Please be aware that debug data will be sent to the provider in case of malfunctions.","Update completo. No olvide el printserver si quiere usa sus funciones nuevas. Por favor dar cuenta que debug data esta enviado fuera en caso de malfunctions."]; var SAMPLE_HEADLINE = ["Sie können die Datenbank mit Beispieldaten füllen. Diese können später beliebig wieder in der Verwaltungs- und Angebotsansicht verändert werden.", "You can fill the data base with sample data. The content can later be changed in the manager and product view.", @@ -387,20 +387,22 @@ function resultOfSampleData(jsonAnswer) { + "umgeleitet. Wenn Sie sich mit dem soeben vergebenen Passwort einloggen " + "können, war die Installation erfolgreich. Löschen Sie in diesem Fall " + "das Verzeichnis 'install', damit die Installation nicht zu einem späteren " - + "Zeitpunkt versehentlich überschrieben wird!"); + + "Zeitpunkt versehentlich überschrieben wird! Bitte beachten Sie, dass in Fehlerfällen " + + "Debug-Daten zum Anbieter geschickt werden. Genaueres dazu ist auf der Homepage beschrieben."); window.location.href = "index.html"; } else if (langid == 1) { $("#progress").html("Finished"); alert("The installation is finished. You will be directed to the main page. If you can log " + "in with the admin password the installation was successful. Remove the install " - + "directory to avoid a later change of the installation by accident"); + + "directory to avoid a later change of the installation by accident. Please be aware that " + + " in case of malfunctions debug data will be sent to the provider of the software."); window.location.href = "index.html"; } else if (langid == 2) { $("#progress").html("Acabado"); alert("La instalación esta completada. Vas a ser dirijido a la página principal. Si puedes" + " log in con la contraseña que has ponido en la página de instalación, la" + " instalación esta completada con éxito. Esta recomendado removar el fichero " - + " 'install'"); + + " 'install'. Por favor, dar cuenta de que en problemas debug data esta enviado fuera."); window.location.href = "index.html"; } } else { @@ -725,7 +727,7 @@ $(document).ready(function() {   - +   diff --git a/webapp/install/installer.php b/webapp/install/installer.php index a145f6a..2cb0bb3 100644 --- a/webapp/install/installer.php +++ b/webapp/install/installer.php @@ -2633,6 +2633,28 @@ return false; } } +function updateUserTable1323_1324($prefix, $version, $dbname) { +$pdo = $this->pdo; +try { +if ($version != "1.3.23") { +$ret = $this->updateUserTable1322_1323($prefix, $version, $dbname); +if (!$ret) { +echo "Version update v1.3.22 to 1.3.23 not successful."; +return false; +} +} + +DbUtils::overrulePrefix($prefix); + +$this->updateVersion($pdo, '1.3.24'); + +return true; +} catch (PDOException $e) { +echo "Error in v1.3.23 to 1.3.24: $e"; +return false; +} +} + function insertIntRow($pdo,$table,$rowToInsert,$afterRow) { $sql = "SHOW COLUMNS FROM $table LIKE '$rowToInsert'"; @@ -2789,7 +2811,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.23')"); +$this->basedb->doSQL($pdo,"INSERT INTO `%config%` (`id` , `name`, `setting`) VALUES (NULL , 'version', '1.3.24')"); $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')"); @@ -3018,7 +3040,7 @@ echo json_encode("ERROR"); } function writeConfigFile($host,$db,$user,$password,$prefix) { -$errorlevel = "openDbAndReturnPdo($_POST['host'],$_POST['db'],$_POST['user'],$_POST['password']); @@ -3264,7 +3286,7 @@ $supportedVersions = array("1.0.22","1.0.23","1.0.24","1.0.25","1.0.26","1.0.27" "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.3.1","1.3.2","1.3.3","1.3.4","1.3.5","1.3.6","1.3.7","1.3.8","1.3.9","1.3.10","1.3.11","1.3.12", -"1.3.13","1.3.14","1.3.15","1.3.16","1.3.17","1.3.18","1.3.19","1.3.20","1.3.21","1.3.22" +"1.3.13","1.3.14","1.3.15","1.3.16","1.3.17","1.3.18","1.3.19","1.3.20","1.3.21","1.3.22","1.3.23" ); if (!in_array($version, $supportedVersions)) { @@ -3272,7 +3294,7 @@ echo json_encode("Quellversion nicht unterstützt"); return; } -$ret = $admin->updateUserTable1322_1323($_POST['prefix'], $version, $_POST['db']); +$ret = $admin->updateUserTable1323_1324($_POST['prefix'], $version, $_POST['db']); if(session_id() == '') { session_start(); diff --git a/webapp/kitchen.html b/webapp/kitchen.html index af1891e..7f9b852 100644 --- a/webapp/kitchen.html +++ b/webapp/kitchen.html @@ -5,7 +5,7 @@ - + @@ -111,7 +111,7 @@ function initializeEverything() {
-

Küche

+

Küche

Hauptmenü
diff --git a/webapp/manager.html b/webapp/manager.html index 2f2f8b8..c386a50 100644 --- a/webapp/manager.html +++ b/webapp/manager.html @@ -5,7 +5,7 @@ - + @@ -723,7 +723,7 @@ function saveValueIntoForm(aValue, decpoint, formid) { $(formid).val(formattedVal); } -function insertGeneralConfigItems(configResult) { +function insertGeneralConfigItems(configResult) { if (configResult.status == "OK") { var values = configResult.msg; @@ -1231,7 +1231,7 @@ function initRestoreFileUpload() { } else { alert("Import war erfolgreich."); setTimeout(function(){ - document.location.href = "index.html?v=1.3.23"; + document.location.href = "index.html?v=1.3.24"; },250); } }, @@ -1790,9 +1790,9 @@ function handleUpdateCheckResult(answer) { var millis=getMillis(); setTimeout(function(){ - document.location.href = "install.html?v=1.3.23&mode=onlyupdate&n=" + millis; + document.location.href = "install.html?v=1.3.24&mode=onlyupdate&n=" + millis; },250); - document.location.href = "install.html?v=1.3.23&mode=onlyupdate&n=" + millis; + document.location.href = "install.html?v=1.3.24&mode=onlyupdate&n=" + millis; } function handleUpdateReplace(answer) { @@ -3189,7 +3189,7 @@ $(document).on("pageinit", "#admin-page", function () {
-

Administration

+

Administration

Hauptmenü
diff --git a/webapp/paydesk.html b/webapp/paydesk.html index 19e17d0..da2ecc9 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 preferimgmobile=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);intervalCheckConnection(2)}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(m,h,i){if(b!="php/debug.php"){var k={cmd:b,fct:e.name,xhr:m.responseText,errormsg:c,status:h};var o=getMillis();if(c!=null){if($(".connectionstatus").is(":visible")){alert("Kommunikation zum Server ist unterbrochen!")}else{var l=c+i+" ("+b+")";alert("Kommunikationsfehler zum Server: "+l);doAjax("POST","php/debug.php?n="+o,k,null,true)}}}}})}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(k,f,g){if(b!="php/debug.php"){var h={cmd:b,fct:c.name,xhr:k.responseText,errormsg:errorMsg,status:f};var l=getMillis();if(errorMsg!=null){if($(".connectionstatus").is(":visible")){alert("Kommunikation zum Server ist unterbrochen!")}else{var i=errorMsg+g+" ("+b+")";alert("Kommunikationsfehler zum Server: "+i);doAjax("POST","php/debug.php?n="+l,h,null,true)}}}}})}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}}function isFloat(a){return Number(a)===a&&a%1!==0}function getMillis(){var a=new Date();var b=a.getTime();return b}function intervalCheckConnection(b){checkConnection();var a=setInterval(function(){checkConnection()},b*1000)}function checkConnection(){var a=new Image();a.onerror=function(){$(".connectionstatus").show()};a.onload=function(){$(".connectionstatus").hide()};a.src="img/gray.png?t="+(+new Date)}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;gBarbestand inkl. eigener Kassen-Eingaben/Entnahmen:","Cash incl. own cash insert/take-outs:","Cash incl. tomas y entradas proprias:"];var P_NO_ELEM=["Keine Rechnungselemente","No items selected","Ningún producto selecionado"];var P_NO_ELEM_DETAILS=["Es wurden keine abrechenbaren Produkte festgelegt (der Bon ist leer!).","There are no selected items. The receipt is empty!","No hay ningún elemento seleccionado para pagar."];var P_CASHACTION_OK=["Kassenaktion abgeschlossen.","Action completed.","Acción terminado."];var P_NAV=["Navigation","Navigation","Navigación"];var P_ORDER_ACTION=["-> 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;var showpayment2=1;var showpayment3=1;var showpayment4=1;var showpayment5=1;var showpayment6=1;var showpayment7=1;var showpayment8=1;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;showpayment2=a.showpayment2;showpayment3=a.showpayment3;showpayment4=a.showpayment4;showpayment5=a.showpayment5;showpayment6=a.showpayment6;showpayment7=a.showpayment7;showpayment8=a.showpayment8;$("#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 generateCashOverviewOfUser(e){var a="";for(var b=0;b"+(parseFloat(c.value).toFixed(2)).replace(".",decpoint)+"
    "}return a}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;doAjax("GET","php/contenthandler.php?module=admin&command=getPreferimgmobile",null,fillPreferimgmobile,null)}function fillPreferimgmobile(a){preferimgmobile=a}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(g){var f=g.payments;hotelinterface=g.hotelinterface;guests=g.guests;internalguests=g.internalguests;var c="";c+=''+f[0].name+"";c+="


    ";for(var b=0;b'+a+""}if((e==3)&&(showpayment3==1)){c+=''+a+""}if((e==4)&&(showpayment4==1)){c+=''+a+""}if((e==5)&&(showpayment5==1)){c+=''+a+""}if((e==6)&&(showpayment6==1)){c+=''+a+""}if((e==7)&&(showpayment7==1)){c+=''+a+""}if((e==8)&&(showpayment8==1)){c+=''+a+""}}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 generateProdListItem(e,g,a,f,b,c){var k=getProdSizeClass();var h='
  • ';h+='';if(preferimgmobile==1){var i="php/contenthandler.php?module=products&command=getprodimage&prodid="+c+"&size=l";h+=''}h+=f+"
  • ";return h}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=generateProdListItem("c","plus","payable_"+b.id,a+createHashOfPayableItem(b),"payable",b.prodid);return c}function createOnReceiptItemListElement(b){var a="";if("count" in b){if(b.count>1){a=b.count+"x "}}var c=generateProdListItem("c","plus","payable_"+b.id,a+createHashOfPayableItem(b),"onreceipt",b.prodid);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(b){var a=generateCashOverviewOfUser(b.cashperpayments);$("#cashbyguests").html(a);$("#cashtotal").html((parseFloat(b.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 @@ -42,7 +42,7 @@ var CALC_TIP=0;var CALC_TOTAL=1;var lang=0;var receiptfontsize=12;var paymentcon
    -

    Kasse

    +

    Kasse

    Hauptmenü
    diff --git a/webapp/php/admin.php b/webapp/php/admin.php index 889945a..07f0175 100644 --- a/webapp/php/admin.php +++ b/webapp/php/admin.php @@ -1215,7 +1215,7 @@ class Admin { $view = "preferences.html"; } - echo json_encode($view . "?v=1.3.23"); + echo json_encode($view . "?v=1.3.24"); } } @@ -1422,27 +1422,27 @@ 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.23"); }; + if ($_SESSION['right_waiter']) { $mainMenu[] = array("name" => $waitertxt[$lang], "link" => "waiter.html?v=1.3.24"); }; } else { - if ($_SESSION['right_waiter']) { $mainMenu[] = array("name" => $waiterdesktxt[$lang], "link" => "waiterdesktop.php?v=1.3.23"); }; + if ($_SESSION['right_waiter']) { $mainMenu[] = array("name" => $waiterdesktxt[$lang], "link" => "waiterdesktop.php?v=1.3.24"); }; } - if ($_SESSION['right_kitchen']) { $mainMenu[] = array("name" => $kitchentxt[$lang], "link" => "kitchen.html?v=1.3.23"); }; - if ($_SESSION['right_bar']) { $mainMenu[] = array("name" => "Bar", "link" => "bar.html?v=1.3.23"); }; - if ($_SESSION['right_supply']) { $mainMenu[] = array("name" => $supplytxt[$lang], "link" => "supplydesk.html?v=1.3.23"); }; + if ($_SESSION['right_kitchen']) { $mainMenu[] = array("name" => $kitchentxt[$lang], "link" => "kitchen.html?v=1.3.24"); }; + if ($_SESSION['right_bar']) { $mainMenu[] = array("name" => "Bar", "link" => "bar.html?v=1.3.24"); }; + if ($_SESSION['right_supply']) { $mainMenu[] = array("name" => $supplytxt[$lang], "link" => "supplydesk.html?v=1.3.24"); }; if ($_SESSION['modus'] == 0) { - if ($_SESSION['right_paydesk']) { $mainMenu[] = array("name" => $paydesktxt[$lang], "link" => "paydesk.html?v=1.3.23"); }; + if ($_SESSION['right_paydesk']) { $mainMenu[] = array("name" => $paydesktxt[$lang], "link" => "paydesk.html?v=1.3.24"); }; } - if ($_SESSION['right_statistics']) { $mainMenu[] = array("name" => $stattxt[$lang], "link" => "reports.html?v=1.3.23"); }; - if ($_SESSION['right_bill']) { $mainMenu[] = array("name" => $bontxt[$lang], "link" => "bill.html?v=1.3.23"); }; - if ($_SESSION['right_products']) { $mainMenu[] = array("name" => $prodtxt[$lang], "link" => "products.html?v=1.3.23"); }; - if ($_SESSION['right_reservation']) { $mainMenu[] = array("name" => $restxt[$lang], "link" => "reservation.html?v=1.3.23"); }; - if ($_SESSION['right_rating']) { $mainMenu[] = array("name" => $ratingtxt[$lang], "link" => "rating.html?v=1.3.23"); }; - if ($_SESSION['right_customers']) { $mainMenu[] = array("name" => $customerstxt[$lang], "link" => "customers.html?v=1.3.23"); }; - if ($_SESSION['right_dash']) { $mainMenu[] = array("name" => $dashtxt[$lang], "link" => "dash.php?v=1.3.23"); }; - if ($_SESSION['right_manager'] || $_SESSION['is_admin'] || $_SESSION['right_closing']) { $mainMenu[] = array("name" => $admintxt[$lang], "link" => "manager.html?v=1.3.23"); }; - $mainMenu[] = array("name" => $settingtxt[$lang], "link" => "preferences.html?v=1.3.23"); - $mainMenu[] = array("name" => "Hilfe", "link" => "help.php?v=1.3.23"); - $mainMenu[] = array("name" => "Feedback", "link" => "feedback.html?v=1.3.23"); + if ($_SESSION['right_statistics']) { $mainMenu[] = array("name" => $stattxt[$lang], "link" => "reports.html?v=1.3.24"); }; + if ($_SESSION['right_bill']) { $mainMenu[] = array("name" => $bontxt[$lang], "link" => "bill.html?v=1.3.24"); }; + if ($_SESSION['right_products']) { $mainMenu[] = array("name" => $prodtxt[$lang], "link" => "products.html?v=1.3.24"); }; + if ($_SESSION['right_reservation']) { $mainMenu[] = array("name" => $restxt[$lang], "link" => "reservation.html?v=1.3.24"); }; + if ($_SESSION['right_rating']) { $mainMenu[] = array("name" => $ratingtxt[$lang], "link" => "rating.html?v=1.3.24"); }; + if ($_SESSION['right_customers']) { $mainMenu[] = array("name" => $customerstxt[$lang], "link" => "customers.html?v=1.3.24"); }; + if ($_SESSION['right_dash']) { $mainMenu[] = array("name" => $dashtxt[$lang], "link" => "dash.php?v=1.3.24"); }; + if ($_SESSION['right_manager'] || $_SESSION['is_admin'] || $_SESSION['right_closing']) { $mainMenu[] = array("name" => $admintxt[$lang], "link" => "manager.html?v=1.3.24"); }; + $mainMenu[] = array("name" => $settingtxt[$lang], "link" => "preferences.html?v=1.3.24"); + $mainMenu[] = array("name" => "Hilfe", "link" => "help.php?v=1.3.24"); + $mainMenu[] = array("name" => "Feedback", "link" => "feedback.html?v=1.3.24"); } $mainMenu[] = array("name" => $logout[$lang], "link" => "logout.php"); @@ -1450,7 +1450,7 @@ class Admin { $waiterMessage = $this->getMessage(null, "waitermessage"); } - $mainMenuAndVersion = array ("version" => "OrderSprinter 1.3.23", + $mainMenuAndVersion = array ("version" => "OrderSprinter 1.3.24", "user" => $currentUser, "menu" => $mainMenu, "waitermessage" => $waiterMessage, @@ -1593,7 +1593,7 @@ class Admin { } function getRoleListCore($pdo) { - $sql = "SELECT * from %roles% ORDER BY is_admin,right_manager"; + $sql = "SELECT * from %roles% ORDER BY is_admin,right_manager,right_waiter DESC,right_kitchen DESC,right_bar DESC,right_paydesk DESC,right_bill DESC,right_supply DESC"; $stmt = $pdo->prepare(DbUtils::substTableAlias($sql)); $stmt->execute(); $roles = $stmt->fetchAll(PDO::FETCH_ASSOC); @@ -1602,7 +1602,7 @@ class Admin { function getUserList() { $pdo = DbUtils::openDbAndReturnPdoStatic(); - $sql = "SELECT *,%user%.id as id,is_admin,right_manager FROM %user%,%roles% WHERE active='1' AND %user%.roleid=%roles%.id ORDER BY is_admin,right_manager"; + $sql = "SELECT *,%user%.id as id,is_admin,right_manager FROM %user%,%roles% WHERE active='1' AND %user%.roleid=%roles%.id ORDER BY is_admin,right_manager,right_waiter DESC,right_kitchen DESC,right_bar DESC,right_paydesk DESC,right_bill DESC,right_supply DESC"; $stmt = $pdo->prepare(DbUtils::substTableAlias($sql)); $stmt->execute(); $users = $stmt->fetchAll(PDO::FETCH_ASSOC); diff --git a/webapp/php/debug.php b/webapp/php/debug.php new file mode 100644 index 0000000..54e7553 --- /dev/null +++ b/webapp/php/debug.php @@ -0,0 +1,54 @@ + 150) { + $cmd = substr($cmd, 0,149); + } + if (strlen($xhr) > 500) { + $xhr = substr($xhr, 0,499); + } + if (strlen($fct) > 100) { + $fct = substr($fct, 0,99); + } + if (strlen($errormsg) > 150) { + $errormsg = substr($errormsg, 0,149); + } + if (strlen($status) > 150) { + $status = substr($status, 0,149); + } + $version = "1.3.24"; + + $arr = array("cmd" => $cmd,"fct" => $fct, "xhr" => $xhr,"errormsg" => $errormsg,"status" => $status,"version" => $version); +} else { + return; +} + +$url = "http://www.ordersprinter.de/debug/save.php?cmd=save"; + +$query = http_build_query($arr); +$opts = array( + 'http'=>array( + 'header' => "Content-Type: application/x-www-form-urlencoded\r\n". + "Content-Length: ".strlen($query)."\r\n". + "User-Agent:MyAgent/1.0\r\n", + + 'method' => 'POST', + 'content' => $query + ) +); + +$context = stream_context_create($opts); + +$ret = file_get_contents($url, false, $context); + +echo $ret; diff --git a/webapp/preferences.html b/webapp/preferences.html index 081c3b8..85a4eae 100644 --- a/webapp/preferences.html +++ b/webapp/preferences.html @@ -5,7 +5,7 @@ - + diff --git a/webapp/products.html b/webapp/products.html index c06b004..019ed31 100644 --- a/webapp/products.html +++ b/webapp/products.html @@ -7,7 +7,7 @@ - + @@ -1124,7 +1124,7 @@ function setLanguage(language) {
    -

    Angebot

    +

    Angebot

    Hauptmenü
    diff --git a/webapp/rating.html b/webapp/rating.html index 032e04d..53a9a88 100644 --- a/webapp/rating.html +++ b/webapp/rating.html @@ -7,7 +7,7 @@ - + diff --git a/webapp/reports.html b/webapp/reports.html index 6f3f4a9..8f3ccd6 100644 --- a/webapp/reports.html +++ b/webapp/reports.html @@ -7,7 +7,7 @@ - + @@ -221,7 +221,7 @@ function setLanguage(language) {
    -

    Statistik

    +

    Statistik

    Hauptmenü
    diff --git a/webapp/reservation.html b/webapp/reservation.html index c3b60c3..995afa6 100644 --- a/webapp/reservation.html +++ b/webapp/reservation.html @@ -5,7 +5,7 @@ - + @@ -609,7 +609,7 @@ $(document).on("pagebeforeshow", "#changeres-page", function () {
    -

    Reservierung

    +

    Reservierung

    Hauptmenü
    diff --git a/webapp/supplydesk.html b/webapp/supplydesk.html index c4f55d5..4afb42d 100644 --- a/webapp/supplydesk.html +++ b/webapp/supplydesk.html @@ -5,7 +5,7 @@ - + @@ -285,7 +285,7 @@ function initializeEverything() {
    -

    Bereitstellung

    +

    Bereitstellung

    Hauptmenü
    diff --git a/webapp/utilities.js b/webapp/utilities.js index 81409e5..8c5b6b4 100644 --- a/webapp/utilities.js +++ b/webapp/utilities.js @@ -38,6 +38,7 @@ function initializeMainMenu(menuid) { }); intervalGetPrinterStatus(5); + intervalCheckConnection(2); } function intervalGetPrinterStatus(seconds) { @@ -76,42 +77,83 @@ function refreshList(selector) { } } -function doAjax(getOrPost,url,data,functionToCallIfSuccess,errorMsg,doAsync) { - if (typeof doAsync === 'undefined') { doAsync = false; } - $.ajax({ type: getOrPost, - url: url, - dataType: "json", - data: data, - async: doAsync, - success : function(jsonContent) - { - if (functionToCallIfSuccess != null) { - functionToCallIfSuccess(jsonContent); - } - }, - error: function(xhr,status,error ) { - if (errorMsg != null) { - var errorMsgTxt = errorMsg + ", Status: " + status + ", Error:" + error + ", Msg: " + xhr.responseText + " (" + url + ")"; - alert( "Kommunikationsfehler zum Server: " + errorMsgTxt); - } - } +function doAjax(getOrPost, url, data, functionToCallIfSuccess, errorMsg, doAsync) { + if (typeof doAsync === 'undefined') { + doAsync = false; + } + $.ajax({type: getOrPost, + url: url, + dataType: "json", + data: data, + async: doAsync, + success: function (jsonContent) + { + if (functionToCallIfSuccess != null) { + functionToCallIfSuccess(jsonContent); + } + }, + error: function (xhr, status, error) { + + if (url != "php/debug.php") { + var debugData = { + cmd: url, + fct: functionToCallIfSuccess.name, + xhr: xhr.responseText, + errormsg: errorMsg, + status: status + }; + + var n = getMillis(); + + if (errorMsg != null) { + if ($(".connectionstatus").is(":visible")) { + alert("Kommunikation zum Server ist unterbrochen!"); + } else { + var errorMsgTxt = errorMsg + error + " (" + url + ")"; + alert("Kommunikationsfehler zum Server: " + errorMsgTxt); + doAjax("POST", "php/debug.php?n=" + n, debugData, null, true); + } + } + } + } }); } -function doAjaxAsync(getOrPost,url,data,functionToCallIfSuccess) { - $.ajax({ type: getOrPost, - url: url, - dataType: "json", - data: data, - async: true, - success : function(jsonContent) - { - if (functionToCallIfSuccess != null) { - functionToCallIfSuccess(jsonContent); - } - }, - error: function(xhr,status,error ) { - } +function doAjaxAsync(getOrPost, url, data, functionToCallIfSuccess) { + $.ajax({type: getOrPost, + url: url, + dataType: "json", + data: data, + async: true, + success: function (jsonContent) + { + if (functionToCallIfSuccess != null) { + functionToCallIfSuccess(jsonContent); + } + }, + error: function (xhr, status, error) { + if (url != "php/debug.php") { + var debugData = { + cmd: url, + fct: functionToCallIfSuccess.name, + xhr: xhr.responseText, + errormsg: errorMsg, + status: status + }; + + var n = getMillis(); + + if (errorMsg != null) { + if ($(".connectionstatus").is(":visible")) { + alert("Kommunikation zum Server ist unterbrochen!"); + } else { + var errorMsgTxt = errorMsg + error + " (" + url + ")"; + alert("Kommunikationsfehler zum Server: " + errorMsgTxt); + doAjax("POST", "php/debug.php?n=" + n, debugData, null, true); + } + } + } + } }); } @@ -208,4 +250,22 @@ function getMillis() { var d = new Date(); var n = d.getTime(); return n; +} + +function intervalCheckConnection(seconds) { + checkConnection(); + var fetchTimer = setInterval(function() { + checkConnection(); + }, seconds * 1000); +} + +function checkConnection() { + var img = new Image(); + img.onerror = function () { + $(".connectionstatus").show(); + } + img.onload = function () { + $(".connectionstatus").hide(); + } + img.src = "img/gray.png?t=" + (+new Date); } \ No newline at end of file diff --git a/webapp/waiter.html b/webapp/waiter.html index ac21269..8916c80 100644 --- a/webapp/waiter.html +++ b/webapp/waiter.html @@ -4,8 +4,8 @@ - - + + @@ -33,7 +33,7 @@ +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 W_NO_VALID_PRICE=["Keine gültige Preiseingabe","No valid price","Precio no valido"];var W_NO_REORDER_VAR_PRICE=["Produkt mit variablem Preis kann nicht auf diese Weise nachbestellt werden.","Produkt with variable price cannot be reordered this way.","Producto con un precio variable no se puede reordenado asi."];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='
    ';g+=getDiscountButton("discount1","a",discount1,discountname1);g+=getDiscountButton("discount2","b",discount2,discountname2);g+=getDiscountButton("discount3","c",discount3,discountname3);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("change").on("change",function(k){var i=$("#select-comment").find(":selected").val();$("#optionfield").val(i)});$("#act-select-comment").off("change").on("change",function(k){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_priceenter").off("click").on("click",function(i){i.stopImmediatePropagation();i.preventDefault();$("#enterpricedlg").dialog("close")});$("#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 getDiscountButton(f,e,c,a){var b='";if(a.trim()!=""){b='"}return b}function generateSearchResults(){var e=$("#searchField").val().trim().toLowerCase();if(e.length";var a=$("#typprodpage").data("types_prods_sorted");$.each(a,function(h,k){var g=k.longname;if(g.toLowerCase().indexOf(e)>=0){b+='
  • ';if(preferimgmobile==1){var f="php/contenthandler.php?module=products&command=getprodimage&prodid="+k.id+"&size=l";b+=''}b+=toHtml(g);b+=createSearchProdInfoTxt(k.id);b+="
  • "}});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 intervalCheckConnection(b){checkConnection();var a=setInterval(function(){checkConnection()},b*1000)}function checkConnection(){var a=new Image();a.onerror=function(){$(".connectionstatus").show()};a.onload=function(){$(".connectionstatus").hide()};a.src="img/gray.png?t="+(+new Date)}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 calcTotalPriceOfProdAndExtras(b,e){var a=parseFloat(b);if(e!=null){for(var c=0;c";var m=groupedNewOrders.count.length;for(g=0;g1){l=""+h.toString()+"x "+l}var f=groupedNewOrders.prodids[g];if(k!=""){k="

    "+toHtml(k)+"

    "}var c=groupedNewOrders.changedPrices[g];var b=groupedNewOrders.togos[g];var o="";var e=groupedNewOrders.extras[g];if((e!=null)&&(e!="")){o=""+e+""}if(c!="NO"){c=c.replace(".",decpoint);if(b!=0){n+='
  • '+l+k+o+" ("+c+" - To-Go)
  • "}else{n+='
  • '+l+k+o+" ("+c+")
  • "}}else{if(b!=0){n+='
  • '+l+k+o+" - To-Go
  • "}else{n+='
  • '+l+k+o+"
  • "}}}$("#neworders").html(n);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(f,b,g){var a=getProdProperties(f);if((a.unit!=0)&&(a.unit!="null")){alert(W_NO_REORDER_VAR_PRICE[lang]);return}var e=[];for(var c=0;c'+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(requestPriceInExtras!=false){k+='
  • '}if(applyExtraBtnPos!=2){k+='
  • '+W_APPLY[lang]+"
  • "}k+=createHigherLine(l);return k}function bindExtrasSel(){$(".extrasel").off("click").on("click",function(n){n.stopImmediatePropagation();n.preventDefault();var a=this.id.split("_");var b=a[1];var f=a[2];if((b=="abottom")||(b=="atop")){var l=getProdEntry(f);var c=l.extras;var o=[];for(var h=0;h=0){o[o.length]={id:b,name:m,price:g.price}}}if(requestPriceInExtras){var k=$("#enterpriceextrasfield").val();k=k.trim();k=k.replace(decpoint,".");if((k!="")&&($.isNumeric(k))){requestPriceInExtras=false;presetPriceInExtras="";addProductToNewOrdersList(f,o,k)}else{alert(W_NO_VALID_PRICE[lang])}}else{addProductToNewOrdersList(f,o)}}else{if(w_extras.indexOf(b)>=0){w_extras.splice(w_extras.indexOf(b),1)}else{w_extras[w_extras.length]=b}if(requestPriceInExtras!==false){presetPriceInExtras=$("#enterpriceextrasfield").val()}var p=listOfExtras(f);$("#typeproducts-list").html(p);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(g,h){if(parseInt(h.ref)==e){a+='
  • ';if(preferimgmobile==1){var f="php/contenthandler.php?module=products&command=getprodimage&prodid="+h.id+"&size=l";a+=''}a+=toHtml(h.name);if((h.amount!="null")&&(h.amount<11)){a+=" ("+W_ONLY[lang]+" "+h.amount+")"}a+=createProdInfoTxt(h.id);a+="
  • "}});if(e!=0){a+=createHigherLine(c)}return a}function createHigherLine(b){var a='
  • ';a+='
    ';a+='
    ';a+='
    ';a+="
    ";a+="
  • ";return a}function createProdEntryWithTextPrice(a,e,f){var c=getProdEntry(a);if(c!=null){var b=c.price.replace(".",decpoint);return"
    "+b+"
    "}return""}function createProdInfoTxt(b){var a="";if(priceinlist==0){a+="
    "}else{a+=createProdEntryWithTextPrice(b,"prodtextinfo","pinfo")}if(showplusminus==1){a+="
    ";a+="
    "}return a}function createSearchProdInfoTxt(b){var a="";if(priceinlist==0){a+="
    "}else{a+=createProdEntryWithTextPrice(b,"srtextinfo","srinfo")}if(showplusminus==1){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("")}var a=null;if(b==null){idOfHigherType=c;a=listOfTypesProds(parseInt(c));extrasMenuOpen=false}else{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;if(c.unit==1){requestPriceInExtras=true;presetPriceInExtras=""}else{requestPriceInExtras=false}displayTypesProds(b,a);bindExtrasSel()}else{if(c.unit==1){hideMenuProd();enterpricedlgshown=true;$("#enterpricedlg").data("prodid",b);$("#enterpricefield").val("");$.mobile.changePage("#enterpricedlg");bindEnterPriceNumbers()}else{addProductToNewOrdersList(b,null)}}}function bindEnterPriceNumbers(){$(".numfield td").off("click").on("click",function(b){b.stopImmediatePropagation();b.preventDefault();var f=$(this).html();var a=$(this).attr("class");if(a!="keyboardapply"){var c=String($("#enterpricefield").val());$("#enterpricefield").val(c+f)}});$("#apply_priceenter").off("click").on("click",function(c){c.stopImmediatePropagation();c.preventDefault();var a=$("#enterpricedlg").data("prodid");var b=$("#enterpricefield").val();b=b.trim();b=b.replace(decpoint,".");if((b!="")&&($.isNumeric(b))){$("#enterpricedlg").dialog("close");addProductToNewOrdersList(a,null,b)}else{alert(W_NO_VALID_PRICE[lang])}})}function addProductToNewOrdersList(b,c,f){var g=$("#typprodpage").data("table-info");var a=g[1];addProductToQueue(b,c,"NO",0,f);var h=getProdAudio(parseInt(b));var e=parseInt($("#typprodpage").data("ordervolume"))/10;if(h!=""){var k="customer/"+h;if(h.match(/mp3$/)){$("#audiofile").html('')}else{if(h.match(/ogg$/)){$("#audiofile").html('')}else{if(h.match(/wav$/)){$("#audiofile").html('')}}}document.getElementById("audiofile").load();document.getElementById("audiofile").volume=e;document.getElementById("audiofile").play()}else{if(e>0.5){beep()}}var i="php/contenthandler.php?module=queue&command=getJsonLongNamesOfProdsForTableNotDelivered&tableid="+a;fillNotDeliveredProductsOfATable(i);if((keeptypelevel==0)||(favOrSearchWasClicked)){displayTypesProds(levelOneType,null)}else{if(extrasMenuOpen){displayTypesProds(idOfHigherType,null)}}allowPrintAndOrderBtn=true;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);$("#cancelcodeform").off("submit").on("submit",function(f){f.stopImmediatePropagation();f.preventDefault()})}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
    "}if((f==3)&&(showpayment3==1)){c+='
    '+a+"
    "}if((f==4)&&(showpayment4==1)){c+='
    '+a+"
    "}if((f==5)&&(showpayment5==1)){c+='
    '+a+"
    "}if((f==6)&&(showpayment6==1)){c+='
    '+a+"
    "}if((f==7)&&(showpayment7==1)){c+='
    '+a+"
    "}if((f==8)&&(showpayment8==1)){c+='
    '+a+"
    "}}c+='
    '+P_CANCEL[lang]+"
    ";$("#selectiondialog").html(c);var e=600;if(paymentconfig==1){e=380}$("#selectiondialog").dialog({autoOpen:false,modal:true,height:e,buttons:{Abbrechen:function(){$(this).dialog("close")}}});$("#selectiondialog").dialog("open");bindPayment()}function bindPayment(){$(".paymentcancel").off("click").on("click",function(a){a.stopImmediatePropagation();a.preventDefault();$("#selectiondialog").dialog("close")});$(".paymentitem").off("click").on("click",function(a){a.stopImmediatePropagation();a.preventDefault();var b=this.id.split("_")[1];currentPaymentId=b;$("#selectiondialog").dialog("close");if((currentPaymentId==PAYMENT_HS3)||(currentPaymentId==PAYMENT_GUEST)){$("#hoteldialog").dialog({autoOpen:false,modal:true,height:400,width:500,buttons:{Abbrechen:function(){$(this).dialog("close")}}});$("#hoteldialog").dialog("open");$("#roomguesttextfield").val("");bindhotelinterface(currentPaymentId);return}else{startPayProcess(b,"","","")}})}function bindhotelinterface(a){generateGuestResult($("#roomguesttextfield").val(),false,a);$("#roomguesttextfield").off("keyup").on("keyup",function(b){generateGuestResult($("#roomguesttextfield").val(),false,a)});$("#paym_hotel").off("click").on("click",function(h){h.stopImmediatePropagation();h.preventDefault();var f=$("#hotelroomfoundguest").data("reservation");var c=$("#hotelroomfoundguest").data("guest");var b=$("#hotelroomselection").find(":selected").val();if(b!=undefined){var c=guests[b];var g="";if(currentPaymentId==PAYMENT_GUEST){c=internalguests[b];g=c.id}startPayProcess(currentPaymentId,c.reservationid,c.object+" - "+c.guest,g);$("#hoteldialog").dialog("close")}else{alert("Kein Gast ausgewählt")}})}function generateGuestResult(c){c=c.trim().toLowerCase();if(c==""){$("#hotelroomselection").html("");return}var b="";var a=false;$.each(guests,function(h,k){var e=k.object;var l=k.guest;var f=(e.toLowerCase().indexOf(c)>=0);var g=(l.toLowerCase().indexOf(c)>=0);if(f||g){if(!a){a=true;b+='"}else{b+='"}}});$("#hotelroomselection").html(b)}function updateAccounted(c,a,b){if(a===b){$("#"+c).removeClass("paystillopen");$("#"+c).removeClass("payallaccounted");$("#"+c).removeClass("payitemnormborder");$("#"+c).addClass("payallaccounted");$("#"+c).addClass("payitemoffborder")}else{$("#"+c).removeClass("paystillopen");$("#"+c).removeClass("payallaccounted");$("#"+c).removeClass("payitemoffborder");$("#"+c).addClass("paystillopen");$("#"+c).addClass("payitemnormborder")}if(a===0){$("#"+c+" .payitemaccounted").html("")}else{$("#"+c+" .payitemaccounted").html(a)}}function getProdAccountedEntry(c){var f=createHashOfPayableItem(c);for(var a=0;a1){f=e.count+"x ";h=e.count}}var a=false;var g=getProdAccountedEntry(e);var i="";if(g!==null){if(g.count!=0){i=g.count}if(g.count==h){a=true}}var l="";if(a){if(preferimgdesk==0){l='
    '+f+createHashOfPayableItemWithoutTax(e)+"
    "+i+"
    "}else{var m="php/contenthandler.php?module=products&command=getprodimage&prodid="+e.prodid+"&size=m";var b=" style=\"background-image: url('"+m+"'); background-size: cover; background-repeat: no-repeat; background-position: center center; \" ";var c=""+f+createHashOfPayableItemWithoutTax(e)+"";l='
    "+c+"
    "+i+"
    "}}else{if(preferimgdesk==0){l='
    '+f+createHashOfPayableItemWithoutTax(e)+"
    "+i+"
    "}else{var m="php/contenthandler.php?module=products&command=getprodimage&prodid="+e.prodid+"&size=m";var k=" style=\"background-image: url('"+m+"'); background-size: cover; background-repeat: no-repeat; background-position: center center; \" ";var n=""+f+createHashOfPayableItemWithoutTax(e)+"";l='
    "+n+"
    "+i+"
    "}}return l}function createOnReceiptItemListElement(c){var b="";if("count" in c){if(c.count>1){b=c.count+"x "}}var a='
    '+b+createHashOfPayableItem(c)+"
    ";return a}function getProdOfAllProdsWithHash(e){var b=prodsToPayListGrouping.sortedset;for(var a=0;a";$("#receiptpanel").html(c);calcSum();var k=$("#receiptpart").html();$("#info-page").data("receipthtml",k);displayRightButtons()}function getTableName(){if(selectedtableindex!=null){var a=roominfo.roomstables[selectedroomindex].tables[selectedtableindex];return a.name}else{if(selectedroomindex=="-1"){return"Zum Mitnehmen"}else{return null}}}function createReceiptHeader(){var a=genCreateReceiptHeader(0,"",getTableName(),loggedinUser,currency);return a}function createReceiptFooter(b,c,a){var e=genCreateReceiptFooterNoSum(b,0,"",a);return e}function getQueueIdsDueToCountOfItem(g){var e=[];var h=g.hash;var f=g.count;for(var b=0;b=f){break}}}return e}function startPayProcess(n,l,m,g){var k=getTableName();var b=0;if(selectedroomindex!=-1){if(selectedtableindex!=null){var f=roominfo.roomstables[selectedroomindex].tables[selectedtableindex];b=f.id}else{b=0}}var e=$("#info-page").data("usst");if($("#info-page").data("taxtype")=="togo"){e=$("#info-page").data("togotax")}checkForLogIn();var a=[];for(var h=0;h";printContent(s)}}startCashProcess()}}else{alert("Fehler: "+q)}},error:function(i){alert("Sorry, there was a problem! "+i)}})}var P_DESCR=["Beschreibung","Description","Descripción"];var P_PRICE=["Preis","Price","Precio"];var P_TOTAL=["Total","Total","Total"];var P_ID=["Id:","Id:","Id:"];var P_ROOMSEL=["Raumauswahl","Room selection","Selección de espacio"];var P_PAYDESK_ACTIONS=["Kassenaktionen","Paydesk actions","Acciones de caja"];var P_BAR_INPUT=["Bareinlage","Input money","Insertar dinero"];var P_BAR_GET=["Barentnahme","Take money","Sacar dinero"];var P_BAR_SUM=["Einnahmen","Revenue","Cobro"];var P_TITLE=["Kasse","Paydesk","Caja"];var P_TABLE=["Tisch","Table","Mesa"];var P_TABLE_SEL=["Tischauswahl","Select table","Qué mesa?"];var P_NOT_PAID=["Ausstehend für ","Not paid for ","Impagado para "];var P_ALL=["Alles","All","Todo"];var P_CONTENT_RECEIPT=["Inhalt Kassenbon","Content of receipt","Contenido del tique"];var P_ONLY_PAY=["Nur Zahlung","Only pay","Solo pagar"];var P_PAY_PRINT=["Bondruck","Pay+Print","Pagar+Imprimir"];var P_CHANGE_CALC=["Wechselgeldrechner:","Change Calculator:","Calculadora de Cambio:"];var P_CHOOSE_PAYWAY=["Auswahl der Zahlungsart:","Selection of method of payment:","Selección del modo de pago:"];var P_CANCEL=["Abbrechen","Cancel","Cancelar"];var P_CASHTAKEOUT=["Barentnahme aus der Kasse","Cash take-out","Sacar dinero"];var P_CASHTAKIN=["Bareinlage in die Kasse","Cash insert","Insertar dinero"];var P_AMOUNT=["Betrag:","Amount:","Valor:"];var P_OVERVIEW=["Übersicht Kellnerkasse","Overview waiter purse","Resumen cartera de bolsillo"];var P_PUT_IN=["Einlegen","Insert","Insertar"];var P_TAKE_OUT=["Entnehmen","Take out","Sacar"];var P_OVERV_DETAILS=["Diese Übersicht zeigt die Einnahmen durch den Kellner pro Zahlungsweg seit der letzten Tageslosung sowie als weiteren Wert den Kassenstand unter Berücksichtigung der eigenen Eingaben und Entnahmen.","This overview contains the amount of money of this waiter since the last closing as well as the total amount of money including the own cash insert and take-out actions.","Este resumen contiene todo el dinero del camarero, y también el dinero incluido con acciones de insertar y sacar."];var P_CASH_SUM=["Bewirtungseinnahmen (ohne Ein-/Auslagen):","Cash by payment (without inserts/take-outs):","Cobro (sin tomas/entradas):"];var P_INCLUDE_OWN=["Barbestand inkl. eigener Kassen-Eingaben/Entnahmen:","Cash incl. own cash insert/take-outs:","Cash incl. tomas y entradas proprias:"];var P_NO_ELEM=["Keine Rechnungselemente","No items selected","Ningún producto selecionado"];var P_NO_ELEM_DETAILS=["Es wurden keine abrechenbaren Produkte festgelegt (der Bon ist leer!).","There are no selected items. The receipt is empty!","No hay ningún elemento seleccionado para pagar."];var P_CASHACTION_OK=["Kassenaktion abgeschlossen.","Action completed.","Acción terminado."];var P_NAV=["Navigation","Navigation","Navigación"];var P_ORDER_ACTION=["-> 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;var showpayment2=1;var showpayment3=1;var showpayment4=1;var showpayment5=1;var showpayment6=1;var showpayment7=1;var showpayment8=1;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;showpayment2=a.showpayment2;showpayment3=a.showpayment3;showpayment4=a.showpayment4;showpayment5=a.showpayment5;showpayment6=a.showpayment6;showpayment7=a.showpayment7;showpayment8=a.showpayment8;$("#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 generateCashOverviewOfUser(e){var a="";for(var b=0;b"+(parseFloat(c.value).toFixed(2)).replace(".",decpoint)+"
    "}return a};