diff --git a/gastsystem/index.php b/gastsystem/index.php index 21b2ed9..45449be 100644 --- a/gastsystem/index.php +++ b/gastsystem/index.php @@ -9,8 +9,8 @@ - - + + @@ -105,7 +105,7 @@
diff --git a/gastsystem/install.php b/gastsystem/install.php index 3e1ee03..a75e6c2 100644 --- a/gastsystem/install.php +++ b/gastsystem/install.php @@ -90,10 +90,10 @@ if (isset($_POST['code'])) { } else { echo ""; echo "1){o=f+g_units_arr[r].text+" "}var p=toHtml(groupedNewOrders.name[l]);var n=groupedNewOrders.option[l];var m=groupedNewOrders.count[l];if(m>1){p=""+m.toString()+"x "+o+p}else{p=o+p}var k=groupedNewOrders.prodids[l];if(n!=""){n=""+toHtml(n)+"
"}var e=groupedNewOrders.changedPrices[l];var c=groupedNewOrders.togos[l];var t="";var h=groupedNewOrders.extras[l];if((h!=null)&&(h!="")){t=""+h+""}var g='';var b=p+n+t;if(e!="NO"){e=e.replace(".",decpoint)+" "+currency;if(r>1){e+="/"+g_units_arr[r].text}if(c!=0){s+=g+''+b+" ("+e+" - To-Go) "}else{s+=g+''+b+" ("+e+")"}}else{if(c!=0){s+=g+''+b+" - To-Go"}else{s+=g+''+b+""}}}$("#neworders").html(s);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],unit:groupedNewOrders.units[b],unitamount:groupedNewOrders.unitamounts[b]};$("#actiononneworderel").data("entry",a);$("#actiononneworderel").data("newcount",a.count);$("#actiononneworderel").data("groupedListIndex",b);$("#actiononneworderel").data("countatdialogstart",a.count);$("#act-optionfield").val(a.option);$("#act-numberfield").val(a.count);$("#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)){if(tablesAfterSend==1){$.mobile.changePage("#tables-page")}else{reloadPage()}}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+""});if(showtogo==1){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("");$("#barcode").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";return a}function displayTablesListOrMap(h){var g=$("#tables-page").data("roomdetail");if($("#info-page").data("type")=="t"){$("#tableselbackbtn").hide()}else{$("#tableselbackbtn").show()}var a=g.id;var l=g.tables;var i=shallDisplayRoom(a);var c=$("#info-page").data("type");if(i.show){$(h).hide();d=new Date();$("#mapimgpart").attr("src","php/tablemap.php?command=getTableMapImgAsPng&showBubbles=0&roomid="+a+"&"+d.getTime());$("#tablemapcontent").show();var b=new Tablemap(a,null,"");var e=b.createOverlay("#mapimgpart",i.pos,W_TO_PAY[lang],decpoint,currency,l,ostablebtnsize);$("#tableoverlay").html(e);b.bindingForOverlaySelection(handleClickInTablemap.bind(this),a,l,null);if(c=="t"){var k="";if(showtogo==1){k+=' '+W_TOGO[lang]+" "}k+="";$("#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"){if(showtogo==1){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){m+=' '+W_APPLY[lang]+" "}for(var f=0;f=0){b="f";l="check"}m+=' '+toHtml(k)+" "}if(requestPriceInExtras!=false){m+=''+currency+" "}if(applyExtraBtnPos!=2){m+=''+W_APPLY[lang]+" "}m+=createHigherLine(n);return m}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,0,1)}else{alert(W_NO_VALID_PRICE[lang])}}else{addProductToNewOrdersList(f,o,null,0,1)}}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(g){var a=' '+W_SELECTION[lang]+"";if(lastSelectedProduct!=""){a+=lastSelectedProdToStr()}a+=" ";var b=$("#typprodpage").data("types_prods");var f=getProdSizeClass();$.each(b.types,function(l,k){if(parseInt(k.ref)==g){a+=''+toHtml(k.name)+" "}});var i=false;if(preferimgmobile==1){var e=null;for(var c=0;c';if(i&&(preferimgmobile==1)){var k="php/contenthandler.php?module=products&command=getprodimage&prodid="+m.id+"&size=l";a+=''}a+=toHtml(m.name);if((m.amount!="null")&&(m.amount<11)){a+=" ("+W_ONLY[lang]+" "+m.amount+")"}a+=createProdInfoTxt(m.id,m.unit);a+=""}});if(g!=0){a+=createHigherLine(f)}return a}function createHigherLine(e){var f="f";if(preferfixbtns==1){f="a"}var a=' ';a+=' ";return a}function createProdEntryWithTextPrice(a,f,g){var e=getProdEntry(a);var c=e.unit;if(e!=null){var b=e.price.replace(".",decpoint);if(c>1){b+="';var c="";var b="";if(preferfixbtns==1){c="fixedtypetopimg";b="fixedtypehigherimg"}a+='';a+='';a+="";a+="
/"+g_units_arr[c].text}return""+b+""}return""}function createProdInfoTxt(b,c){var a="";if(showplusminus==1){a+="";7}if(priceinlist==0){a+=""}else{a+=createProdEntryWithTextPrice(b,"prodtextinfo","pinfo")}if(showplusminus==1){a+="";a+=""}return a}function createSearchProdInfoTxt(b,c){var a="";if(showplusminus==1){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'+W_FAVS[lang]+"";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,unit:h.unit}}});c.sort(prodcompare);$.each(c,function(g,h){f+=' '+toHtml(h.longname);f+=createProdInfoTxt(h.id,h.unit);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];if(showplusminus==1){selectedProdCount=getProdCount(a)}else{selectedProdCount=1}handleClickOnProd(a)})}function displayTypesProds(c,b){if(preferfixbtns!=1){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(f){f.stopImmediatePropagation();f.preventDefault();productInListClicked(this.id,c)});bindHigherButtons()});$(".prodinfo").off("click").on("click",function(l){l.stopImmediatePropagation();l.preventDefault();var g=this.id.split("_")[1];var k=getProdEntry(g);var i=k.price;var h=k.unit;var f=W_PRICE[lang]+": "+i+" "+currency;if(h>2){f+="/"+g_units_arr[h].text}alert(f)});$(".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)}}});$(".prodcount").off("click").on("click",function(i){i.stopImmediatePropagation();i.preventDefault();var h=this.id.split("_")[1];var g=getProdEntry(h);var f=g.unit;if(f>1){alert(W_NOT_SUPPORTED[lang]);return}$("#enternumberdlg").data("prodid",h);enternumberdlgshown=true;$("#enternumberfield").val("");$.mobile.changePage("#enternumberdlg");var k=$(this).parent().attr("id");bindEnterNumberNumbers(k,c)})}function productInListClicked(b,e){favOrSearchWasClicked=false;$("#searchField").val("");$("#barcode").val("");generateSearchResults();var a=b.split("_");if(a[0]=="t"){if(e==0){levelOneType=a[1];e=a[1]}displayTypesProds(a[1],null)}else{var c=a[1];if(showplusminus==1){selectedProdCount=getProdCount(c)}else{selectedProdCount=1}$("#prodcount_"+c).html("");handleClickOnProd(c)}}function getHigherType(){var c=$("#typprodpage").data("types_prods");var b=c.types;var f=0;if(!extrasMenuOpen){for(var e=0;e0)&&(e<2)){w_extras=[];w_allextras=b;idOfHigherType=f.ref;if(f.unit==1){requestPriceInExtras=true;presetPriceInExtras=""}else{requestPriceInExtras=false}displayTypesProds(c,b);bindExtrasSel()}else{if(f.unit!=0){var a=g_units_arr[f.unit].longtext;$("#enterpriceheader").html(a);$("#enterpricedlg").data("unit",f.unit);hideMenuProd();enterpricedlgshown=true;$("#enterpricedlg").data("prodid",c);$("#enterpricefield").val("");$.mobile.changePage("#enterpricedlg");bindEnterPriceNumbers()}else{addProductToNewOrdersList(c,null,null,0,1)}}}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(f){f.stopImmediatePropagation();f.preventDefault();var a=$("#enterpricedlg").data("prodid");var c=$("#enterpricefield").val();c=c.trim();c=c.replace(decpoint,".");var b=$("#enterpricedlg").data("unit");if((c!="")&&($.isNumeric(c))){$("#enterpricedlg").dialog("close");if(b==1){addProductToNewOrdersList(a,null,c,0,1)}else{addProductToNewOrdersList(a,null,null,b,c)}}else{alert(W_NO_VALID_PRICE[lang])}})}function bindPartNumberEntry(){$(".numfield td").off("click").on("click",function(f){f.stopImmediatePropagation();f.preventDefault();var g=$(this).html();var c=$(this).attr("class");if(c!="keyboardapply"){var a=String($("#enternumberfield").val());if(c=="dellastkey"){var h=a.length;if(h>0){var b=a.substring(0,h-1);$("#enternumberfield").val(b)}}else{$("#enternumberfield").val(a+g)}}})}function bindEnterNumberNumbers(b,a){bindPartNumberEntry();$("#apply_numberenter").off("click").on("click",function(g){g.stopImmediatePropagation();g.preventDefault();var f=$("#enternumberdlg").data("prodid");var c=$("#enternumberfield").val().trim();if(c==""){c=1}if($.isNumeric(c)){if((c<1)||(c>1000)){alert(w_INVALID_NO_RANGE[lang])}else{if(c>1){$("#enternumberdlg").dialog("close");$("#prodcount_"+f).html(c);productInListClicked(b,a)}else{$("#enternumberdlg").dialog("close");$("#prodcount_"+f).html("");productInListClicked(b,a)}}}else{alert(W_INVALID_NO_ENTERING[lang])}})}function bindEnterSearchNumberNumbers(a){bindPartNumberEntry();$("#apply_numberenter").off("click").on("click",function(f){f.stopImmediatePropagation();f.preventDefault();var c=$("#enternumberdlg").data("prodid");var b=$("#enternumberfield").val().trim();if(b==""){b=1}if($.isNumeric(b)){if((b<1)||(b>1000)){alert(w_INVALID_NO_RANGE[lang])}else{if(b>1){$("#enternumberdlg").dialog("close");$("#srprodcount_"+c).html(b);handleClickOnSearchResult(c)}else{$("#enternumberdlg").dialog("close");$("#srprodcount_"+c).html("");handleClickOnSearchResult(c)}}}else{alert(W_INVALID_NO_ENTERING[lang])}})}function addProductToNewOrdersList(e,f,g,m,b){if(g==undefined){g=null}if(m==undefined){m=0}if(b==undefined){b=1}var h=$("#typprodpage").data("table-info");var a=h[1];addProductToQueue(e,f,"NO",0,g,m,b);var i=getProdAudio(parseInt(e));var c=parseInt($("#typprodpage").data("ordervolume"))/10;if(i!=""){var l="customer/"+i;if(i.match(/mp3$/)){$("#audiofile").html('')}else{if(i.match(/ogg$/)){$("#audiofile").html('')}else{if(i.match(/wav$/)){$("#audiofile").html('')}}}document.getElementById("audiofile").load();document.getElementById("audiofile").volume=c;document.getElementById("audiofile").play()}else{if(c>0.5){beep()}}var k="php/contenthandler.php?module=queue&command=getJsonLongNamesOfProdsForTableNotDelivered&tableid="+a;fillNotDeliveredProductsOfATable(k);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//xKJ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S+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(f){var b="";if(f.option!=""){b=" ("+toHtml(f.option)+")"}var c=f.longname;if(f.togo==1){c="To-Go: "+c}if(f.pricechanged==1){c+=" - "+f.price.replace(".",decpoint)+" "+currency}if(f.unit>1){var g=g_units_arr[f.unit].text;var e=f.unitamount.replace(".",decpoint);c+=" ("+e+" "+g+")"}var a="";if(f.isready=="1"){a+=" ☞"}if(f.isCooking=="1"){a+=" ♨"}if(f.isPaid=="1"){a+=" ☑"}return toHtml(c)+b+a+"
"+createExtraParagraph(f.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 '}$(document).on("pagebeforeshow","#typprodpage",function(){allowPrintAndOrderBtn=true;lastSelectedProduct="";tableListActive=false;if(nextPage==""){reloadPage()}$("#tablemapcontent").hide();$.ajaxSetup({cache:false});hideMenuProd();getPayPrintType();checkForLogIn();fillOrderVolume(0);doJsonAjax("GET","php/contenthandler.php?module=admin&command=getOrderVolume",null,fillOrderVolume,null);$("#workprintarea").html("");var a=$(this).data("table-info");var c=a[0];var b=a[1];$("#changetablewhatdialog").data("fromtableid",b);var e=a[2];$("#typprodpage h1").html(W_ATABLE[lang]+": "+e+getPrinterStatusStr());$("#optionfield").val("");if((!enterpricedlgshown)&&(!enternumberdlgshown)){fillTypeProdList(0)}else{enterpricedlgshown=false;enternumberdlgshown=false}var f="php/contenthandler.php?module=queue&command=getJsonLongNamesOfProdsForTableNotDelivered&tableid="+b;fillNotDeliveredProductsOfATable(f);$("#workprint_btn").data("tableid",b);$("#gopaydesk_btn").data("tableid",b);$("#workprint_btn").data("tablename",e);bindPrintButton();bindGoPayDeskButton();bindChangetableButton();bindSendNewOrdersButton();bindRecordsHeader();getUserHasRightForPaydesk()});function bindRecordsHeader(){$("#recordslistheader").html(""+W_RECORDS_INIT[lang]+"");$("#recordslistheader").off("click").on("click",function(b){b.stopImmediatePropagation();b.preventDefault();var c=$("#typprodpage").data("table-info");var a=c[1];doJsonAjaxAsync("GET","php/contenthandler.php?module=queue&command=getRecords&tableid="+a,null,fillRecordsArea,true)})}function fillRecordsArea(c){if(c.status=="OK"){var b=c.msg;var a=""+W_RECORDS_HEADER[lang]+"
";if(b.length==0){a+=W_NO_ENTRIES[lang];$("#recordslistheader").html(a);return}a+="";b.forEach(function(h,g){var k=toHtml(h.time);var l=toHtml(h.username);var i=toHtml(h.action);var e=W_RECORD_ACTION[i][lang];a+="
";$("#recordslistheader").html(a)}}function bindSendNewOrdersButton(){$("#sendorder_btn").off("click").on("click",function(a){a.stopImmediatePropagation();a.preventDefault();if(allowPrintAndOrderBtn){allowPrintAndOrderBtn=false;lastSelectedProduct="";if(extrasMenuOpen){alert(W_OPEN_PANEL[lang])}else{sendNewOrders(false,"s",gotoTablePage)}}})}function bindPrintButton(){$("#workprint_btn").off("click").on("click",function(b){b.stopImmediatePropagation();b.preventDefault();if(allowPrintAndOrderBtn){allowPrintAndOrderBtn=false;lastSelectedProduct="";if(extrasMenuOpen){alert(W_OPEN_PANEL[lang])}else{if(neworders.length>0){var a=$("#workprintarea").data("payPrintType");sendNewOrders(true,a,gotoTablePage)}else{alert(W_NO_ORDERS[lang])}}}})}function bindGoPayDeskButton(){$("#gopaydesk_btn").off("click").on("click",function(b){b.stopImmediatePropagation();b.preventDefault();if(allowPrintAndOrderBtn){allowPrintAndOrderBtn=false;lastSelectedProduct="";if(neworders.length>0){var a=$("#workprintarea").data("payPrintType");if(waitergopayprint==1){sendNewOrders(true,a,goToPayDesk)}else{sendNewOrders(false,a,goToPayDesk)}}else{if(notDeliveredProdsAvailable){goToPayDesk()}else{alert(W_NO_ORDERS[lang])}}}})}function goToPayDesk(){var a=$("#gopaydesk_btn").data("allowed");if(a.toLowerCase()=="yes"){window.location.href="paydesk.html?t="+$("#gopaydesk_btn").data("tableid")}else{alert("Fehlendes Benutzerrecht für Kasse")}}function createRoomOrTableList(b,c){var a='- "+k+" "+l+" - "+e+":
";var f=h.prods;a+="";f.forEach(function(m,o){var n=toHtml(m.name);var p=toHtml(m.extras);a+="
"});a+="- "+n;if(p!=""){a+=" ("+p+")"}});a+="
'+c+" ";$.each(b,function(f,e){a+=''+e.name+" "});return a}function handleClickInChangeTablemap(a){$("#changetablewhatdialog").data("totableid",a.tableid);$.mobile.changePage("#changetablewhatdialog")}function displayTableDialog(e,g,c){$("#header_tchange").html("Tischauswahl");var f=shallDisplayRoom(e);if(f.show){$("#roomOrTableList").hide();$("#tablemapcontentchangetable").show();d=new Date();$("#mapimgpartchangetable").attr("src","php/tablemap.php?command=getTableMapImgAsPng&roomid="+e+"&"+d.getTime());var b=new Tablemap(e,null,"");b.bindingForSelection("#mapimgpartchangetable",handleClickInChangeTablemap.bind(this),f.pos,e);if(c){$.mobile.changePage("#tablechangedialog")}$("#changetablebackbtn").off("click").on("click",function(h){$("#tablemapcontentchangetable").hide();$("#roomOrTableList").show()})}else{$("#roomOrTableList").show();var a=createRoomOrTableList(g,"Tische");$("#roomOrTableList").empty().append(a).promise().done(function(){if(c){$.mobile.changePage("#tablechangedialog")}refreshList("#roomOrTableList");$(this).off("click").on("click",".info-go",function(i){i.stopImmediatePropagation();i.preventDefault();var h=($(this).attr("id")).split("_")[1];$("#changetablewhatdialog").data("totableid",g[h].id);$.mobile.changePage("#changetablewhatdialog")})})}}function resultOfChangeTable(a){if(a.status!="OK"){alert("Fehler "+a.code+": "+a.msg+"\n\nMöglicherweise hat ein Kollege\nin der Zwischenzeit Produkte zugestellt.")}else{alert("Tischwechsel durchgeführt!")}window.location.href="waiter.html"}function bindChangetableButton(){$("#changetable_btn").off("click").on("click",function(c){c.stopImmediatePropagation();c.preventDefault();var b=$("#tables-page").data("allroomtables");var f=b.length;if(f==1){displayTableDialog(b[0].id,b[0].tables,true)}else{$("#header_tchange").html("Raumauswahl");var a=createRoomOrTableList(b,W_ROOMS[lang]);$("#roomOrTableList").empty().append(a).promise().done(function(){$.mobile.changePage("#tablechangedialog");refreshList("#roomOrTableList");$(this).off("click").on("click",".info-go",function(h){h.stopImmediatePropagation();h.preventDefault();var g=($(this).attr("id")).split("_")[1];displayTableDialog(b[g].id,b[g].tables,false)})})}})}function createHtmlOfKind(e,a,k){var g="";for(var b=0;b"+c+"
"+h+"
"}}return g}function createExtraParagraph(b){if((b==null)||(b=="")){return""}var c="";for(var a=0;a"}return c}function arrayContainsKind(b,e,g){var a=false;for(var c=0;c ";if(o.status=="OK"){var b=o.msg;var f=$("#workprintarea").data("payPrintType");var g="";var m=$("#workprint_btn").data("tablename");if(arrayContainsKind(b,0,1)){var e=" Speisen für "+m+" (Printer 1)
";var l=e+"
"+i+"
"+createHtmlOfKind(b,0,1)+"
";g+=l+"
"}if(arrayContainsKind(b,0,2)){var e="Speisen für "+m+" (Printer 2)
";var l=e+"
"+i+"
"+createHtmlOfKind(b,0,2)+"
";g+=l+"
"}if(arrayContainsKind(b,1,1)){var c="Getränke für "+m+" (Printer 1)
";var k=c+"
"+i+"
"+createHtmlOfKind(b,1,1)+"
";g+=k+"
"}if(arrayContainsKind(b,1,2)){var c="Getränke für "+m+" (Printer 2)
";var k=c+"
"+i+"
"+createHtmlOfKind(b,1,2)+"
";g+=k+"
"}$("#workprintarea").html(g);window.print();setTimeout(function(){document.location.href="waiter.html"},250)}else{alert("Druckdaten konnten nicht angefordert werden")}}function updateNotDeliveredList(){var a=$("#typprodpage").data("table-info");var c=a[1];var e="php/contenthandler.php?module=queue&command=getJsonLongNamesOfProdsForTableNotDelivered&tableid="+c;var b="#orderedprod-list-0";fillNotDeliveredProductsOfATable(e)}function doJsonAjax(a,b,f,e,c){$.ajax({type:a,url:b,dataType:"json",data:f,async:true,success:function(g){if(e!=null){e(g)}},error:function(l,g,h){var k=c+", Status: "+g+", Error:"+h+", Msg: "+l.responseText+" ("+b+")";if(b!="php/debug.php"){var i={cmd:b,fct:e.name,xhr:l.responseText,errormsg:c,status:g};if(c!=null){if($(".connectionstatus").is(":visible")){alert("Kommunikation zum Server ist unterbrochen!")}else{var k=c+h+" ("+b+")";alert("Kommunikationsfehler zum Server: "+k+" - In der Feedbackansicht lässt sich ein Fehlerprotokoll an den Anbieter übermitteln.");doJsonAjax("POST","php/debug.php",i,null)}}}}})}function doJsonAjaxAsync(a,b,e,c,f){$.ajax({type:a,url:b,dataType:"json",data:e,async:f,success:function(g){if(c!=null){c(g)}},error:function(k,g,i){var h={cmd:b,fct:c.name,xhr:k.responseText,errormsg:i,status:g};doJsonAjax("POST","php/debug.php",h,null)}})}function doYouWantDelOrReorder(e,f,c,b,a){$("#delOrReorderDlg .sure-1").text(f);$("#delOrReorderDlg .sure-2").text(e);$("#delOrReorderDlg .sure-cancel").text(W_CANCEL[lang]);$("#delOrReorderDlg .sure-do").text(c).off("click.delOrReorderDlg").on("click.delOrReorderDlg",function(){b()});$("#delOrReorderDlg .reorder").text(W_REORDER[lang]).off("click.delOrReorderDlg").on("click.delOrReorderDlg",function(){a()});$(this).off("click.delOrReorderDlg");$.mobile.changePage("#delOrReorderDlg")}function areYouSure(c,b,a,e){$("#sure .sure-1").text(c);$("#sure .sure-2").text(b);$("#sure .sure-do").text(a).off("click.sure").on("click.sure",function(){e()});$(this).off("click.sure");$.mobile.changePage("#sure")}function changePriceInActPanel(a){if(rightchangeprice){$("#act-changepricefield").val(a.toFixed(2).replace(".",decpoint))}}function actionSelOnNewOrderElem(){var e=$("#actiononneworderel").data("entry");var c=$("#actiononneworderel").data("newcount");var b=e.unit;$("#act_count").html(c);var a=e.price.replace(".",decpoint)+" "+currency;if(b>1){a+="/"+g_units_arr[b].text}$("#act_name").html(e.name+" ("+a+")");if(e.option!=""){$("#act_option").html(" ("+e.option+")")}if(rightchangeprice){if(e.changedPrices!="NO"){$("#act-changepricefield").val(e.changedPrices)}}$("#act-select-comment").html(predefinedComments);$.mobile.changePage("#actiononneworderel");if(c==1){$("#actionneworderconfirm_all").html(W_ACT_CHANGE[lang]);$("#actionneworderconfirm_one").hide()}else{$("#actionneworderconfirm_all").html(W_ACT_CHANGE_ALL[lang]);$("#actionneworderconfirm_one").html(W_ACT_CHANGE_ONE[lang]);$("#actionneworderconfirm_one").show()}$("#act-select-comment").selectmenu("refresh");$("#togocheckbox").checkboxradio("refresh");$("#act-numberfield").off("keyup").on("keyup",function(k){var f=$("#actiononneworderel").data("newcount");var h=$("#act-numberfield").val().trim();if((h!="")&&($.isNumeric(h))){if((h>=0)&&(h<=1000)){var g=h;$("#actiononneworderel").data("newcount",g)}else{$("#act-numberfield").val(f)}}else{var i=$("#actiononneworderel").data("countatdialogstart");$("#actiononneworderel").data("newcount",i)}actionSelOnNewOrderElem($("#actiononneworderel").data("entry"),$("#actiononneworderel").data("groupedListIndex"))});$("#actminusone").off("click").on("click",function(f){f.stopImmediatePropagation();f.preventDefault();reduceOneNewOrderItem();actionSelOnNewOrderElem($("#actiononneworderel").data("entry"),$("#actiononneworderel").data("groupedListIndex"))});$("#actplusone").off("click").on("click",function(f){f.stopImmediatePropagation();f.preventDefault();increaseOneNewOrderItem();actionSelOnNewOrderElem($("#actiononneworderel").data("entry"),$("#actiononneworderel").data("groupedListIndex"))});$("#actdel").off("click").on("click",function(f){delOneNewOrderItem();actionSelOnNewOrderElem($("#actiononneworderel").data("entry"),$("#actiononneworderel").data("groupedListIndex"));actionNewOrderConfirm(CHANGE_ONE)});$("#actionneworderconfirm_all").off("click").on("click",function(f){f.stopImmediatePropagation();f.preventDefault();$("#actiononneworderel").dialog("close");actionNewOrderConfirm(CHANGE_ALL)});$("#actionneworderconfirm_one").off("click").on("click",function(f){f.stopImmediatePropagation();f.preventDefault();$("#actiononneworderel").dialog("close");actionNewOrderConfirm(CHANGE_ONE)});$("#actionnewordercancel").off("click").on("click",function(f){binding_neworderelem()});$("#discount1").off("click").on("click",function(g){g.stopImmediatePropagation();g.preventDefault();var f=e.price;changePriceInActPanel(f-f*discount1/100)});$("#discount2").off("click").on("click",function(g){g.stopImmediatePropagation();g.preventDefault();var f=e.price;changePriceInActPanel(f-f*discount2/100)});$("#discount3").off("click").on("click",function(g){g.stopImmediatePropagation();g.preventDefault();var f=e.price;changePriceInActPanel(f-f*discount3/100)})}function waiterroundtodigits(c,b){c=parseFloat(c);if(!c){return 0}var a=Math.pow(10,b);return Math.round(c*a)/a}function actionNewOrderConfirm(p){var u=$("#actiononneworderel").data("entry");var n=u.unit;var l=u.unitamount;var k=$("#act-optionfield").val();if(rightchangeprice==1){var a=$("#act-changepricefield").val().trim();a=a.replace(",",".");if(a>999.99){alert(W_MAX_PRICE_EXCEEDED[lang]);return}if(a==""){a="NO"}else{if(!$.isNumeric(a)){alert(W_WRONG_FORMAT[lang]);return}else{a=waiterroundtodigits(a,2).toString();$("#act-changepricefield").val("")}}}else{var g=getProdProperties(u.prodid);var n=g.unit;var a=u.changedPrices;a=a.replace(",",".")}var c=$("#togocheckbox").prop("checked");if(c){c=1}else{c=0}if(p==CHANGE_ONE){var e=u.origidxs;neworders[e[0]].option=k;neworders[e[0]].changedPrice=a;neworders[e[0]].togo=c;neworders[e[0]].unit=n;neworders[e[0]].unitamount=l}else{var e=u.origidxs;for(s=0;s0){var e=u.origidxs;var f=e[0];var m=neworders[f].prodid;var a=neworders[f].changedPrice;var c=neworders[f].togo;var k=neworders[f].option;var n=neworders[f].unit;var l=neworders[f].unitamount;var b=neworders[f].extras;for(s=0;s 0){$("#actiononneworderel").data("newcount",a-1);$("#act-numberfield").val(a-1)}}function delOneNewOrderItem(){$("#actiononneworderel").data("newcount",0)}function increaseOneNewOrderItem(){var b=$("#actiononneworderel").data("entry");var a=$("#actiononneworderel").data("newcount");$("#actiononneworderel").data("newcount",a+1);$("#act-numberfield").val(a+1)}function group(h){var B=[];var e=[];var D=[];var w=[];var p=[];var g=[];var z=[];var A=[];var a=[];var m=[];var u=[];var v=[];var C={count:B,joinedvals:e,name:D,price:w,option:p,extras:g,prodids:z,origidxs:A,changedPrices:a,togos:m,units:u,unitamounts:v};var y=0;for(y=0;y + "+toHtml(c[x].name)+""}}var s=D+"-"+p+"-"+b+"-"+q+"-"+o;if(f!="NO"){s=D+"-"+p+"-"+b+f}if(l==1){s+=" - To-Go"}var k=C.joinedvals.indexOf(s);if(k>=0){C.count[k]=C.count[k]+1;idxarr=C.origidxs[k];idxarr[idxarr.length]=y;C.origidxs[k]=idxarr}else{var n=C.count.length;C.count[n]=1;C.joinedvals[n]=s;C.name[n]=D;C.price[n]=w;C.option[n]=p;C.extras[n]=b;C.prodids[n]=r;C.changedPrices[n]=f;C.togos[n]=l;C.units[n]=q;C.unitamounts[n]=o;C.origidxs[n]=[y]}}return C}; diff --git a/webapp/waiterdesktop.php b/webapp/waiterdesktop.php index ed32bfd..0bd3bd0 100644 --- a/webapp/waiterdesktop.php +++ b/webapp/waiterdesktop.php @@ -27,7 +27,7 @@ +function sendNewOrders(b){var a=getTableid();if(neworders.length!=0){var c={tableid:a,prods:neworders,print:(b?1:0),payprinttype:"s"};doAjax("POST","php/contenthandler.php?module=queue&command=addProductListToQueue",c,handleSentNewOrders,"Fehler bei Produktversand",false)}else{alert("Es sind keine Produkte ausgewählt worden.")}}function handleSentNewOrders(a){if(a.status!="OK"){alert("Es ist ein Fehler beim Versenden der Bestellung aufgetreten")}else{neworders=[];$("#search").val("");refreshGui()}}function refreshGui(){requestRoomInformation();clearProductsSelection();requestProdInformation();requestOrderedInformation();displayPanels();allowPrintAndOrderBtn=true}function getTableid(){if(selectedroomindex!==null){if(selectedroomindex<0){return 0}else{if(selectedtableindex!==null){var a=roominfo.roomstables[selectedroomindex].tables[selectedtableindex];return a.id}else{return 0}}}}function enableSendButton(){}function disableSendButton(){}function moveItems(){$("#selectiondialog").dialog({autoOpen:false,modal:true,height:400,buttons:{Abbrechen:function(){$(this).dialog("close")}}});var a=getRoomsForDialog();$("#selectiondialog").html(a);$("#selectiondialog").dialog("open");$(".ui-dialog-buttonset .ui-button").css("background-color","#44ff44");$(".ui-widget-header").css("background-color","#ff4400");bindMoveItemsRoom()}function bindMoveItemsRoom(){$(".roomchangeitem").off("click").on("click",function(c){c.stopImmediatePropagation();c.preventDefault();var b=parseInt(this.id.split("_")[1]);var a=getTablesForDialog(b);$("#selectiondialog").dialog("open");$("#selectiondialog").html(a);bindMoveItemsTable(b)})}function bindRightButtons(){$("#sendNewOrders").off("click").on("click",function(a){a.stopImmediatePropagation();a.preventDefault();if(allowPrintAndOrderBtn){allowPrintAndOrderBtn=false;unZoomTableMap();updateChangeTableBtnIfTableIsSelected();sendNewOrders(false)}});$("#paydeskbtn").off("click").on("click",function(a){a.stopImmediatePropagation();a.preventDefault();if(allowPrintAndOrderBtn){allowPrintAndOrderBtn=false;unZoomTableMap();if(neworders.length>0){if(waitergopayprint==1){sendNewOrders(true)}else{sendNewOrders(false)}}goPayDesk()}});$("#workbtn").off("click").on("click",function(a){if(allowPrintAndOrderBtn){allowPrintAndOrderBtn=false;unZoomTableMap();updateChangeTableBtnIfTableIsSelected();if(neworders.length>0){sendNewOrders(true)}}});$("#goorderbtn").off("click").on("click",function(a){a.stopImmediatePropagation();a.preventDefault();unZoomTableMap();goOrderDesk()});$("#mainmenudlg").dialog({autoOpen:false,modal:true});$("#changetablebtn").off("click").on("click",function(a){a.stopImmediatePropagation();a.preventDefault();unZoomTableMap();moveItems()});$("#tablerecordsbtn").off("click").on("click",function(b){b.stopImmediatePropagation();b.preventDefault();var a=getTableid();doAjax("GET","php/contenthandler.php?module=queue&command=getRecords&tableid="+a,null,showRecords,true)})}function showRecords(b){if(b.status!="OK"){alert("Fehler aufgetreten: "+b.msg)}else{var a=createTableRecords(b);$("#recordsdlg").dialog({autoOpen:false,modal:true,height:570,width:600,buttons:{Abbrechen:function(){$(this).dialog("close")}}});$("#recordsdlg").dialog("open");$("#recordsdlg").html(a)}}function createTableRecords(f){var e=["Tischprotokoll","Records of table","Historia de la mesa"];var c=[["Bestellung","Ordering","Ordenar"],["Rechnung","Bill","Pagar"],["Produktstorno","Discard product","Descartar producto"],["Rechnungsstorno","Discard bill","Descartar pago"],["Rechnungs- und Produktstorno","Discard bill and product","Descrtar pago y producto"],["Tischwechsel Produktentfernung","Move products to other table","Productos a otra mesa"],["Tischwechsel Produktbuchung","Received moved products","Recibo productos de otra mesa"]];var b=f.msg;var a=""}else{a+='"+e[0]+"
";if(b.length==0){a+="keine Einträge";return a}a+="";b.forEach(function(k,i){var m=toHtml(k.time);var n=toHtml(k.username);var l=toHtml(k.action);var g=c[l][0];a+="
";return a}function bindMoveItemsTable(a){$(".tablechangeitem").off("click").on("click",function(c){c.stopImmediatePropagation();c.preventDefault();moveToRoomIndex=a;var b=parseInt(this.id.split("_")[1]);var f=roominfo.roomstables[a].tables[b];moveToTableId=f.id;if(selectedroomindex!="-1"){var f=roominfo.roomstables[selectedroomindex].tables[selectedtableindex];moveFromTableId=f.id;$("#selectiondialog").dialog("close");doAjax("GET","php/contenthandler.php?module=queue&command=getProdsForTableChange",{tableId:moveFromTableId},insertProductsToChangeTableDlg,null,true)}else{$("#selectiondialog").dialog("close")}})}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- "+m+" "+n+" - "+g+":
";var h=k.prods;a+="";h.forEach(function(o,q){var p=toHtml(o.name);var r=toHtml(o.extras);a+="
"});a+="- "+p;if(r!=""){a+=" ("+r+")"}});a+="
"+c.productname+b+"";a+=" "+g+" "}$("#productsToMoveList").html(a);$("#moveItemdslg").dialog({autoOpen:false,modal:true,height:600,width:800,buttons:{Abbrechen:function(){$(this).dialog("close")},Verschieben:function(){$(this).dialog("close");doMoveItems()}}});$("#moveItemdslg").dialog("open");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()})}function doMoveItems(){$("#moveItemdslg").dialog("close");var a=[];for(var f=0;f'+g.name+" '+g.name+""}});var e=roominfo.takeawayprice.replace(".",decpoint)+" "+currency;if(e!=""){e=''+e+""}if(showtogo==1){if(selectedroomindex<0){a+='';a+='"}else{a+='Zum Mitnehmen';a+=e;a+="';a+='"}}$("#roompanel").html(a);$("#tablepanelcontent").html("");showRoomTableTextInfo();showTablesForRoomIndex();bindingRoom()}function getRoomsForDialog(){var b=roominfo.roomstables;var a="";$.each(b,function(e,c){a+='Zum Mitnehmen';a+=e;a+="'+c.name+""});return a}function bindingRoom(){$(".roomitem").off("click").on("click",function(b){b.stopImmediatePropagation();b.preventDefault();var a=parseInt(this.id.split("_")[1]);$("#changetablebtn").hide();$("#tablerecordsbtn").hide();if(panelMode=="waiter"){if(neworders.length>0){$("#unsentorderdlg").dialog({autoOpen:false,modal:true,height:400,buttons:{Nein:function(){$(this).dialog("close")},Ja:function(){$(this).dialog("close");discardChangeRoom(a)}}});$("#unsentorderdlg").dialog("open")}else{changeRoom(a);if(selectedroomindex=="-1"){$("#tablerecordsbtn").show();startProductDisplay()}}}else{changeRoom(a);goPayDesk()}})}function clearSearchResult(){$("#search").val("");productFilter=null;$("#barcode").val("");showAllProdsToChoose()}function discardChangeRoom(a){clearSearchResult();neworders=[];groupedNewOrders=null;showNewOrders();changeRoom(a)}function changeRoom(a){clearSearchResult();clearProductsSelection();selectedtableindex=null;selectedroomindex=a;if(restaurantmode==1){showRooms()}}function showRoomTableTextInfo(){var a="Keine Auswahl";if(selectedroomindex!==null){if(selectedroomindex<0){a="Zum Mitnehmen"}else{a="Raum: "+roominfo.roomstables[selectedroomindex].name;if(selectedtableindex!==null){var b=roominfo.roomstables[selectedroomindex].tables[selectedtableindex];a+=" - Tisch: "+b.name}}}$("#location").html(a)}function showTablesForRoomIndex(){if((selectedroomindex>=0)&&(selectedroomindex!==null)){var f=roominfo.roomstables[selectedroomindex].id;var g=shallDisplayRoom(f);if(g.show){$("#tablepanelcontent").hide();d=new Date();$("#mapimgpart").attr("src","php/tablemap.php?command=getTableMapImgAsPng&showBubbles=0&roomid="+f+"&"+d.getTime());$("#tablemapcontent").show();var c=new Tablemap(selectedroomindex,null,"");var e=roominfo.roomstables[selectedroomindex]["tables"];var a=null;if(selectedtableindex!=null){a=roominfo.roomstables[selectedroomindex].tables[selectedtableindex].id}var b=c.createOverlay("#mapimgpart",g.pos,W_TO_PAY[lang],decpoint,currency,e,ostablebtnsize,a);$("#tableoverlay").html(b);c.bindingForOverlaySelection(handleClickInTablemap.bind(this),f,e,switchZoomView)}else{showTablesListForRoomIndex()}}else{showTablesListForRoomIndex()}}function switchZoomView(){if(tableMapIsZoomed){$(".main").show();$("#roompanel").show();tableMapIsZoomed=false}else{$(".main").hide();$("#roompanel").hide();tableMapIsZoomed=true}}function unZoomTableMap(){tableMapIsZoomed=true;switchZoomView()}function handleClickInTablemap(b){selectedtableindex=null;var c=roominfo.roomstables[selectedroomindex].tables;for(var a=0;a=0)&&(selectedroomindex!==null)){var c=roominfo.roomstables[selectedroomindex].tables;var a="";$.each(c,function(f,g){if((selectedtableindex!=null)&&(c[selectedtableindex].id==g.id)){a+=' '}else{a+='"}else{a+=''}a+='"});$("#tablepanelcontent").html(a)}else{$("#tablepanelcontent").html("")}$("#tablepanelcontent").show();bindingTable()}function getTablesForDialog(b){var c=roominfo.roomstables[b].tables;var a="";$.each(c,function(e,f){a+=''+g.name+" ";var h=g.pricesum;if(h!=0){var e=h.replace(".",decpoint)+" "+currency;a+=''+e+""}a+="'+f.name+""});return a}function updateChangeTableBtnIfTableIsSelected(){$("#tablerecordsbtn").show();if(panelMode=="waiter"){$("#changetablebtn").show()}else{$("#changetablebtn").hide()}}function bindingTable(){$(".tableitem").off("click").on("click",function(b){b.stopImmediatePropagation();b.preventDefault();var a=parseInt(this.id.split("_")[1]);if(panelMode=="waiter"){$("#tablerecordsbtn").show();$("#changetablebtn").show();if(neworders.length>0){$("#unsentorderdlg").dialog({autoOpen:false,modal:true,height:400,buttons:{Nein:function(){$(this).dialog("close")},Ja:function(){$(this).dialog("close");discardChangeTable(a)}}});$("#unsentorderdlg").dialog("open")}else{changeTable(a);startProductDisplay()}}else{changeTable(a);goPayDesk()}})}function discardChangeTable(a){neworders=[];groupedNewOrders=null;showNewOrders();changeTable(a)}function changeTable(a){clearSearchResult();selectedtableindex=a;showRoomTableTextInfo();showTablesForRoomIndex()}function startProductDisplay(){selectedtypeid=null;selectedprodid=null;clearProductsSelection();requestProdInformation();requestOrderedInformation();clearSearchResult();$("#searchpanel").show();if(usebarcode==1){document.getElementById("barcode").focus()}$("#remarkpanel").show()}function clearProductsSelection(){neworders=[];groupedNewOrders=[];selectedtypeid=null;$("#groupchain").html("");$("#groupchoice").html("");$("#productspanel").html("");$("#remark").val("");$("#neworders").html("");$("#ordered").html("");$("#searchpanel").hide();$("#remarkpanel").hide()}var allOrderdItems=[];function requestOrderedInformation(){if(panelMode!="waiter"){return}var a=0;if((selectedroomindex==null)&&(selectedtableindex==null)){return}if((selectedroomindex!=null)&&(selectedroomindex!="-1")){var b=roominfo.roomstables[selectedroomindex].tables[selectedtableindex];a=b.id}doAjax("GET","php/contenthandler.php?module=queue&command=getJsonLongNamesOfProdsForTableNotDelivered&tableid="+a,null,insertOrderedInformation,true)}function insertOrderedInformation(b){allOrderdItems=b;var c=new Grouping(b,createTxtAssignedProd);c.group();var a="";a+=c.outputList(createListElOfAssignedProd);$("#ordered").html(a);bindOrderedItem()}function createTxtAssignedProd(g,b){if(b==undefined){b=""}var c="";if(g.option!=""){c=""+toHtml(g.option)+""}var h="";var e=toHtml(g.longname);if(g.togo==1){h="To-Go: "}e='
'+h+''+e+"";if(g.pricechanged==1){e+=" - "+g.price.replace(".",decpoint)+" "+currency}if(g.unit>1){var i=g_units_arr[g.unit].text;var f=g.unitamount.replace(".",decpoint);e+=" ("+f+" "+i+")"}var a="";if(g.isready=="1"){a+=" ☞"}if(g.isCooking=="1"){a+=" ♨"}if(g.isPaid=="1"){a+=" ☑"}return e+''+c+a+createExtraParagraphForOrderedEl(g.extras)+""}function createListElOfAssignedProd(e){var c="";if("count" in e){if(e.count>1){if(preferimgdesk==0){c=''+e.count+"x"}else{c=''+e.count+"x"}}}var a="";if(preferimgdesk==0){a+=""+c+createTxtAssignedProd(e)+""}else{var b="php/contenthandler.php?module=products&command=getprodimage&prodid="+e.prodid+"&size=m";var f=""+c+createTxtAssignedProd(e,"whitebackground")+"";a+='"+f+""}return a}function createExtraParagraphForOrderedEl(b){if((b==null)||(b=="")){return""}var e="";var c=[];for(var a=0;a"}return" "+c.join("
")}function bindOrderedItem(){$(".ordereditem-item-sent").off("click").on("click",function(g){g.stopImmediatePropagation();g.preventDefault();var b=this.id.split("_")[1];var h=allOrderdItems;for(var c=0;c=0){c[c.length]={id:h.id,name:h.name,amount:h.amount}}}}else{if(selectedtypeid!=null){var a=getType(selectedtypeid);for(var e=0;e '+c.name+" '+c.name+""}})}$("#groupchoice").html(a);showChain();bindType()}function bindType(){$(".groupitemchoice").off("click").on("click",function(a){a.stopImmediatePropagation();a.preventDefault();$("#search").val("");productFilter=null;showAllProdsToChoose();selectedtypeid=parseInt(this.id.split("_")[1]);updateProductInfoDisplay()})}function showAllProdsToChoose(){var b="osprod-desk-0";if(osprodbtnsize==1){b="osprod-desk-1"}else{if(osprodbtnsize==2){b="osprod-desk-2"}}var a="";if((selectedroomindex=="-1")||(selectedtableindex!=null)){var c=getAllProds(productFilter);$.each(c,function(f,g){if(preferimgdesk==0){a+=''+g.name}else{var e="php/contenthandler.php?module=products&command=getprodimage&prodid="+g.id+"&size=m";var h=""+g.name+"";a+='';for(var c=e.length-1;c>=0;c--){var b=e[c];a+='"+h}if((g.amount!="null")&&(g.amount<11)){a+=" ("+W_ONLY[lang]+" "+g.amount+")"}a+=""})}$("#productspanel").html(a);bindProduct();bindRemark()}function findProdWithBarcode(b){if((selectedroomindex=="-1")||(selectedtableindex!=null)){var e=productInformation.prods;for(var c=0;cAuswahl '+b.name+""}}$("#groupchain").html(a);bindChain();bindSearch()}function bindChain(){$(".groupitem").off("click").on("click",function(a){a.stopImmediatePropagation();a.preventDefault();selectedtypeid=parseInt(this.id.split("_")[1]);if(selectedtypeid=="-1"){selectedtypeid=null}updateProductInfoDisplay();$("#search").val("");productFilter=null;showAllProdsToChoose()})}function bindSearch(){$("#search").off("keyup").on("keyup",function(a){a.stopImmediatePropagation();a.preventDefault();productFilter=($("#search").val().trim().toLowerCase()).trim();if(productFilter==""){productFilter=null}showAllProdsToChoose()});if(usebarcode==1){$("#barcode").off("keyup").on("keyup",function(f){f.stopImmediatePropagation();f.preventDefault();var c=$("#barcode").val();c=c.split("-").join("");c=c.split(" ").join("");if(c!=""){var a=findProdWithBarcode(c);if(a!=null){$("#search").val("");$("#barcode").val("");var b=a.id;beepBarcodeBooking();completeProductClicked(b)}}})}}function bindProduct(){$(".productitem").off("click").on("click",function(b){b.stopImmediatePropagation();b.preventDefault();var a=parseInt(this.id.split("_")[1]);completeProductClicked(a)})}function beepBarcodeBooking(){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/6jYDAm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S5yfK6dhZc0Tx1KI/gviKL6qvvFs1+bWtaz58uUNnryq6kt5RzOCkPWlVqVX2a/EEBUdU1KrXLf40GoiiFXK///qpoiDXrOgqDR38JB0bw7SoL+ZB9o1RCkQjQ2CBYZKd/+VJxZRRZlqSkKiws0WFxUyCwsKiMy7hUVFhIaCrNQsKkTIsLivwKKigsj8XYlwt/WKi2N4d//uQRCSAAjURNIHpMZBGYiaQPSYyAAABLAAAAAAAACWAAAAApUF/Mg+0aohSIRobBAsMlO//Kk4soosy1JSFRYWaLC4qZBYWFRGZdwqKiwkNBVmoWFSJkWFxX4FFRQWR+LsS4W/rFRb/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////VEFHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAU291bmRib3kuZGUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMjAwNGh0dHA6Ly93d3cuc291bmRib3kuZGUAAAAAAAAAACU=");a.play()}function completeProductClicked(e){$("#search").val("");$("#barcode").val("");if(usebarcode==1){$("#barcode").focus()}selectedprodid=e;var c=$("#remark").val();var a=getProdEntry(e);var b=a.extras;var f=a.unit;if((b!=null)&&(b.length>0)&&(f<2)){if(a.unit==1){requestPriceInExtras=true;presetPriceInExtras=""}else{requestPriceInExtras=false}showExtras(a,c)}else{if(a.unit!=0){enterpricedlgshown=true;$("#enterpricedlg").data("prodid",e);$("#enterpricedlg").data("option",c);$("#enterpricedlg").data("unit",a.unit);$("#enterpricefield").val("");var g="Preiseingabe";if(a.unit>1){g="Eingabe "+g_units_arr[a.unit]["longtext"]}$("#entervalueunit").html(g);$("#enterpricedlg").dialog({autoOpen:false,modal:true,height:570,width:400,buttons:{Abbrechen:function(){$(this).dialog("close")}}});$("#enterpricedlg").dialog("open");bindEnterPriceNumbers()}else{addProductToNewOrders(e,c,null,"NO",0,null,0,1)}}}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"){applyPriceEnter()}else{var c=String($("#enterpricefield").val());$("#enterpricefield").val(c+f)}})}function applyPriceEnter(){var b=$("#enterpricedlg").data("prodid");var e=$("#enterpricefield").val();var a=$("#enterpricedlg").data("option");var c=$("#enterpricedlg").data("unit");e=e.trim();e=e.replace(decpoint,".");if((e!="")&&($.isNumeric(e))){$("#enterpricedlg").dialog("close");if(c==1){addProductToNewOrders(b,a,null,e,0,e,0,1)}else{addProductToNewOrders(b,a,null,"NO",0,null,c,e)}}else{alert(W_NO_VALID_PRICE[lang])}}function bindRemark(){$("#remark").off("click").on("click",function(c){if(genComments!=null){if(genComments.length>0){c.stopImmediatePropagation();c.preventDefault();var a="";for(var b=0;b"+toHtml(genComments[b].comment)+""}$("#commentschoice").html(a);$("#gencommentsdlg").dialog({autoOpen:false,modal:true,height:600,buttons:{Abbrechen:function(){$(this).dialog("close")},Anwenden:function(){$(this).dialog("close");applyComment()}}});$("#gencommentsdlg").dialog("open");$("#gencommentsdlg").css("height",genComments.length*52+150);$("#generalcommentfield").val("");$(".ui-dialog-buttonset .ui-button:nth-child(1)").css("background-color","#eeeeee");$(".ui-dialog-buttonset .ui-button:nth-child(1)").css("color","#ff0000");$(".ui-dialog-buttonset .ui-button:nth-child(2)").css("background-color","#00ff00");$(".ui-dialog-buttonset .ui-button:nth-child(2)").css("color","#000000");$(".ui-widget-header").css("background-color","#ff4400");bindCommentClick()}}})}function bindCommentClick(){$(".commentitem").off("click").on("click",function(a){a.stopImmediatePropagation();a.preventDefault();$("#gencommentsdlg").dialog("close");$("#remark").val($(this).text())})}function applyComment(){$("#remark").val($("#generalcommentfield").val())}function getProdEntry(c){var a=productInformation.prods;for(var b=0;b 0){b+=" "+q.join("
")}else{b=""}var t=E+"-"+p+"-"+b+"-"+r+"-"+o;if(f!="NO"){t=E+"-"+p+"-"+b+f}if(l==1){t+=" - To-Go"}var k=D.joinedvals.indexOf(t);if(k>=0){D.count[k]=D.count[k]+1;idxarr=D.origidxs[k];idxarr[idxarr.length]=z;D.origidxs[k]=idxarr}else{var n=D.count.length;D.count[n]=1;D.joinedvals[n]=t;D.name[n]=E;D.price[n]=x;D.option[n]=p;D.extras[n]=b;D.prodids[n]=s;D.changedPrices[n]=f;D.togos[n]=l;D.units[n]=r;D.unitamounts[n]=o;D.origidxs[n]=[z]}}return D}function showNewOrders(){groupedNewOrders=group(neworders);var k="";var q=groupedNewOrders.count.length;for(var h=q-1;h>=0;h--){var r=groupedNewOrders.units[h];var e=groupedNewOrders.unitamounts[h];var o="";if(r>1){o=e+g_units_arr[r].text+" "}var p=toHtml(groupedNewOrders.name[h]);var n=groupedNewOrders.option[h];var m=groupedNewOrders.count[h];if(m>1){p=""+m.toString()+"x "+o+p}else{p=o+p}var g=groupedNewOrders.prodids[h];if(n!=""){n=""+toHtml(n)+"
"}var c=groupedNewOrders.changedPrices[h];var b=groupedNewOrders.togos[h];var s="";var f=groupedNewOrders.extras[h];if((f!=null)&&(f!="")){s=""+f+""}var a="";if(c!="NO"){var l=c.replace(".",decpoint)+" "+currency;if(r>1){l+="/"+g_units_arr[r].text}if(b!=0){a="
("+l+" - To-Go)"}else{a="
("+l+")"}}else{if(b!=0){a="
(To-Go)"}}k+=''+p+n+s+a+""}$("#neworders").html(k);$("#remark").val("");if(neworders.length>0){enableSendButton()}else{disableSendButton()}bindNewOrderItem();displayRightButtons()}var roominfo=null;var selectedroomindex=null;var selectedtableindex=null;var productInformation=null;var selectedtypeid=null;var selectedprodid=null;var neworders=[];var groupedNewOrders={count:[],joinedvals:[],name:[],prodids:[],extras:[],origidxs:[],changedPrices:[],togos:[]};var workflowconfig=0;var decpoint=".";var currency="";var rightchangeprice=0;var rightpaydesk=false;var restaurantmode=1;var sumupforcard=0;var affiliatekey="";var appid="";var serverurl="";var supplyright=0;var preferimgdesk=0;var prominentsearch=0;var discount1=50;var discount2=20;var discount3=10;var discountname1="";var discountname2="";var discountname3="";var osroombtnsize=0;var ostablebtnsize=0;var osprodbtnsize=0;var tableMapIsZoomed=false;var waitergopayprint=0;var mainmenu=[];var version="";var loggedinUser="";var lang=0;var payments="";var hostTemplate="";var cancelunpaidcode="";var WORKFLOW_DIGI_AND_WORK=0;var WORKFLOW_DIGI=1;var WORKFLOW_WORK=2;var WORKFLOW_WORK_TRANSFER=3;var productFilter=null;var prodsToMove=[];var allselected=0;var moveFromTableId=null;var moveToRoomIndex=null;var moveToTableId=null;var panelMode="waiter";var cashenabled=1;var returntoorder=1;var genComments=null;var allowPrintAndOrderBtn=false;var showtogo=1;var enterpricedlgshown=false;var requestPriceInExtras=false;var presetPriceInExtras="";var usebarcode=0;var dailycode="";var W_SELALL=["Alles auswählen","Select all","Elegir todo"];var W_UNSELALL=["Alles abwählen","Unselect all","No elegir nada"];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_ONLY=["noch","only","sólo"];var W_TO_PAY=["offen","to pay","a pagar"];var P_CASHACTION_OK=["Kassenaktion abgeschlossen.","Action completed.","Acción terminado."];var W_NO_VALID_PRICE=["Keine gültige Zahl","No valid value","No es un número valido"];var W_NO_REORDER_VAR_PRICE=["Nur Produkte mit der Einheit 'Stück' könne auf diese Weise nachbestellt werden.","Only products of unit 'Piece' can be reordered this way.","Un producto de esta unidad no se puede reordenado asi."];function setLanguage(a){}$(document).ready(function(){selectedroomindex=null;productFilter=null;doAjax("GET","php/contenthandler.php?module=admin&command=getWaiterSettings",null,insertWaiterConfig,"Fehler Konfigurationsdaten",true);doAjax("GET","php/contenthandler.php?module=admin&command=getJsonMenuItemsAndVersion",null,saveMenuInfo,null,true);getGeneralConfigItems();getTableMapPreferences();intervalGetItemsToPayAndRoomInfo(10);getMenuInBackground(60);getPayments(savePayments);getHostTemplate();intervalCheckConnection(2);intervalGetPrinterStatus(5);intervalGetGeneralCommentsAndTablePref(10);intervalGetWaiterMessage(20);intervalFetchDaycode(10);if(restaurantmode==0){changeRoom(-1);startProductDisplay()}});function savePayments(a){payments=a.payments;hotelinterface=a.hotelinterface;guests=a.guests;internalguests=a.internalguests}function intervalGetItemsToPayAndRoomInfo(b){var a=setInterval(function(){getAndShowPayItems();requestRoomInformation();requestOrderedInformation()},b*1000)}function intervalGetGeneralCommentsAndTablePref(b){doAjax("GET","php/contenthandler.php?module=products&command=getAllGeneralComments",null,fillGenCommentsList,null,true);var a=setInterval(function(){doAjax("GET","php/contenthandler.php?module=products&command=getAllGeneralComments",null,fillGenCommentsList,null,true);getTableMapPreferences()},b*1000)}function intervalGetWaiterMessage(b){doAjax("GET","php/contenthandler.php?module=admin&command=getWaiterMessage",null,fillWaiterMessage,null,true);var a=setInterval(function(){doAjax("GET","php/contenthandler.php?module=admin&command=getWaiterMessage",null,fillWaiterMessage,null,true)},b*1000)}function intervalFetchDaycode(b){var a=setInterval(function(){doAjax("GET","php/contenthandler.php?module=admin&command=getDailycode",null,updateDailycode,true)},b*1000)}function updateDailycode(a){if(a.status=="OK"){dailycode=a.msg;$(".daycodefield").html(toHtml(dailycode))}}function getMenuInBackground(b){var a=setInterval(function(){requestProdInformation()},b*1000)}function insertWaiterConfig(c){var a=c.isUserLoggedIn;if(a!=1){setTimeout(function(){document.location.href="index.html"},250)}else{var b=c.config;workflowconfig=b.workflowconfig;decpoint=b.decpoint;currency=b.currency;rightchangeprice=c.rightchangeprice;supplyright=c.supplyright;preferimgdesk=c.preferimgdesk;prominentsearch=b.prominentsearch;waitergopayprint=b.waitergopayprint;discount1=b.discount1;discount2=b.discount2;discount3=b.discount3;discountname1=b.discountname1;discountname2=b.discountname2;discountname3=b.discountname3;cashenabled=b.cashenabled;rightpaydesk=c.rightpaydesk;restaurantmode=b.restaurantmode;returntoorder=b.returntoorder;showtogo=b.showtogo;billprintjobs=b.billprintjobs;if((b.cancelunpaidcode!=null)&&(b.cancelunpaidcode!="")){cancelunpaidcode=b.cancelunpaidcode}else{cancelunpaidcode=""}osroombtnsize=c.buttonsizes.roombtnsize;ostablebtnsize=c.buttonsizes.tablebtnsize;osprodbtnsize=c.buttonsizes.prodbtnsize;dailycode=b.dailycode;if(b.showdaycode==1){$(".daycodeareamobile").show();$(".daycodefield").html(toHtml(dailycode))}else{$(".daycodeareamobile").hide()}usebarcode=b.usebarcode;if(usebarcode==1){$("#barcode").show();$("#barcode").val("");document.getElementById("barcode").focus()}initializeOrderView()}}function fillGenCommentsList(a){if(a.status!="OK"){alert("Fehler "+a.code+": "+a.msg);return}genComments=a.msg}function fillWaiterMessage(a){if(a.status=="OK"){var b=a.msg.trim();if(b!=""){$("#waitermessagearea").html("Nachricht: "+toHtml(b));$("#waitermessagearea").show()}else{$("#waitermessagearea").html("");$("#waitermessagearea").hide()}}}function initializeOrderView(){panelMode="waiter";initGui();clearProductsSelection();requestRoomInformation();requestProdInformation();bindMainMenuButton();bindRightButtons();if(restaurantmode==0){$("#tablepanel").hide()}}function getHostTemplate(){$.ajax({url:"customer/bon-bewirtungsvorlage.html",async:false,success:function(a){hostTemplate=a},error:function(a){},cache:false})}function saveMenuInfo(a){if(a.loggedin==1){loggedinUser=a.user;$("#loggedinuser").html(" "+loggedinUser);$("#versioninfo").html(a.version);version=a.version;$.each(a.menu,function(e,c){var b=c.name;var f=c.link;mainmenu[mainmenu.length]={name:b,link:f}});$("#mainmenubtn").show()}else{$("#mainmenubtn").hide()}}function bindMainMenuButton(){$("#selectiondialog").dialog({autoOpen:false,modal:true,height:400,buttons:{Anwenden:function(){$(this).dialog("close");applyExtras()}}});$("#unsentorderdlg").dialog({autoOpen:false,modal:true,height:400,buttons:{Nein:function(){$(this).dialog("close")},Ja:function(){$(this).dialog("close")}}});$("#actmenudlg").dialog({autoOpen:false,modal:true,height:400});$("#mainmenudlg").dialog({autoOpen:false,modal:true,height:400,width:200,position:{my:"right top",at:"right top",of:"body"},buttons:{Abbrechen:function(){$(this).dialog("close")}}});$("#ordereditemdlg").dialog({autoOpen:false,modal:true,height:400,width:200});$("#moveItemdslg").dialog({autoOpen:false,modal:true,height:400,width:200});$("#mainmenubtn").off("click").on("click",function(f){f.stopImmediatePropagation();f.preventDefault();var b="";$("#mainmenudlg").html(b);var a=280+mainmenu.length*40;$("#mainmenudlg").dialog({autoOpen:false,modal:true,height:a,width:200,position:{my:"right top",at:"right top",of:"body"},buttons:{Abbrechen:function(){$(this).dialog("close")}}});$("#mainmenudlg").dialog("open");$(".mainmenuitem").off("click").on("click",function(i){i.stopImmediatePropagation();i.preventDefault();var h=parseInt(this.id.split("_")[1]);var g=mainmenu[h].link;$("#mainmenudlg").dialog("close");setTimeout(function(){document.location.href=g},250)})});bindCashButton()}function goOrderDesk(){panelMode="waiter";initGui();clearProductsSelection();requestProdInformation();requestOrderedInformation()}function goPayDesk(){panelMode="paydesk";initGui();startCashProcess()}function initGui(){displayPanels();displayRightButtons()}function displayPanels(){if(panelMode==="waiter"){$("#panelmodetxt").html("Bestellung");$("#groupchain").show();$("#groupchoice").show();$("#searchpanel").show();if(usebarcode==1){document.getElementById("barcode").focus()}$("#productspanel").show();$("#remarkpanel").show();$("#ordered").show();$("oben").html("");$("#oben").hide();$("#unten").html("");$("#unten").hide();$("#receiptpanel").hide();$("#paybuttonpanel").hide();$("#billprintjobspanel").hide();$("#receiptpanel").hide()}else{$("#panelmodetxt").html("Kasse");$("#groupchain").hide();$("#groupchoice").hide();$("#searchpanel").hide();$("#productspanel").hide();$("#remarkpanel").hide();$("#ordered").hide();$("oben").html("");$("#oben").show();$("#unten").html("");$("#unten").show();$("#goorderbtn").show();$("#receiptpanel").show();$("#paybuttonpanel").show();$("#receiptpanel").show()}}function displayRightButtons(){$("#changetablebtn").hide();$("#tablerecordsbtn").hide();if(panelMode==="waiter"){if((rightpaydesk==1)&&(cashenabled==1)){$("#paydeskbtn").show()}$("#hostbutton").hide();$("#paydeskcash").hide();$("#paydeskprint").hide();$("#goorderbtn").hide();if(neworders.length>0){if((workflowconfig==WORKFLOW_DIGI_AND_WORK)||(workflowconfig==WORKFLOW_WORK)||(workflowconfig==WORKFLOW_WORK_TRANSFER)){$("#workbtn").show()}if((workflowconfig==WORKFLOW_DIGI_AND_WORK)||(workflowconfig==WORKFLOW_DIGI)||(workflowconfig==WORKFLOW_WORK_TRANSFER)){$("#sendNewOrders").show()}}if((selectedtableindex!=null)&&(neworders.length==0)){$("#changetablebtn").show();$("#tablerecordsbtn").show()}}else{$("#paydeskbtn").hide();if((restaurantmode==1)&&(showhostprint==1)){$("#hostbutton").show()}if(prodsaccounted.length>0){if(forceprint==0){$("#paydeskcash").show()}$("#paydeskprint").show();$("#goorderbtn").show()}else{$("#paydeskcash").hide();$("#paydeskprint").hide()}$("#workbtn").hide();$("#sendNewOrders").hide()}}var e_extras=[];var e_extras_selection=[];var e_prod=null;var e_option=null;function showExtras(a,c){e_prod=a;e_option=c;e_extras=a.extras;e_extras_selection=[];for(var b=0;b";if(requestPriceInExtras!=false){a+=''}for(var e=0;e
"+toHtml(c)+""}else{a+=" - "+toHtml(c)+"
"}}a+="
=0){if(selectedtableindex!=null){var b=roominfo.roomstables[selectedroomindex].tables[selectedtableindex];a=b.id;taxtype="normal"}else{a=null}}else{tabeid=0;taxtype="togo"}}else{a=null}showItemsPerPrintJob=false;if((billprintjobs==1)||((billprintjobs==2)&&(a==0))){showItemsPerPrintJob=true;$("#billprintjobspanel").show()}else{$("#billprintjobspanel").hide()}if(a!=null){doAjax("GET","php/contenthandler.php?module=queue&command=getJsonProductsOfTableToPay",{tableid:a},showProductsToPay,"Fehler bei der Datenübermittlung",true)}else{prodsToPayList=[];displayProdsToPayForTable();displayProdsOnReceipt()}}}function showProductsToPay(a){if(a.status!="OK"){alert("Fehler: "+a.msg);if(a.code==4){setTimeout(function(){document.location.href="index.html"},250)}}prodsToPayList=a.msg;fillProdByPrintJobsList(prodsToPayList);if((a.msg.length==0)&&(returntoorder==1)){unZoomTableMap();goOrderDesk()}else{displayProdsToPayForTable();displayProdsOnReceipt()}}function putItemInSortedListToReceipt(b){for(var e=0;e