var CALC_NONE=0;var CALC_TOTAL=1;var CALC_TIP=2;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;var restaurantmode=1;var sumupforcard=0;var affiliatekey="";var appid="";var serverurl="";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='<lidata-role="list-divider"data-theme="b"data-role="heading">Hauptmenü</li>';$.each(c.menu,function(g,f){var e=f.name;var h=f.link;if((e!="Abmelden")&&(e!="Log out")&&(e!="Adios")){b+='<lidata-theme="e"><ahref="'+h+'"target="_top"class="modulebutton">'+e+"</a></li>"}else{b+='<lidata-theme="e"><ahref="'+h+'"target="_top">'+e+"</a></li>"}});$(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()}else{$(".printerstatus").hide()}if(a.tasksforme===1){$(".tasksstatus").show()}else{$(".tasksstatus").hide()}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+" - In der Feedbackansicht lässt sich ein Fehlerprotokoll an den Anbieter übermitteln.");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+" - In der Feedbackansicht lässt sich ein Fehlerprotokoll an den Anbieter übermitteln.");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+"