diff --git a/webapp/waiterdesktop.php b/webapp/waiterdesktop.php
index 11b554c..b556994 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="
"+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+="- "+m+" "+n+" - "+g+":
";var h=k.prods;a+="";h.forEach(function(o,q){var p=toHtml(o.name);var r=toHtml(o.extras);a+="- "+p;if(r!=""){a+=" ("+r+")"}});a+="
"});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
"+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+" "}else{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+='
'}a+='
";var h=g.pricesum;if(h!=0){var e=h.replace(".",decpoint)+" "+currency;a+='
'+e+"
"}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+='
'+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){selectedtableindex=a;showRoomTableTextInfo();showTablesForRoomIndex()}function startProductDisplay(){selectedtypeid=null;selectedprodid=null;clearProductsSelection();requestProdInformation();requestOrderedInformation();$("#search").val("");$("#searchpanel").show();$("#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(f,b){if(b==undefined){b=""}var c="";if(f.option!=""){c="
"+toHtml(f.option)+""}var g="";var e=toHtml(f.longname);if(f.togo==1){g="To-Go: "}e='
'+g+''+e+"
";if(f.pricechanged==1){e+=" - "+f.price.replace(".",decpoint)}var a="";if(f.isready=="1"){a+=" ☞"}if(f.isCooking=="1"){a+=" ♨"}if(f.isPaid=="1"){a+=" ☑"}return e+'
'+c+a+createExtraParagraphForOrderedEl(f.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+"
"}else{a+=''+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+='
"+h}if((g.amount!="null")&&(g.amount<11)){a+=" ("+W_ONLY[lang]+" "+g.amount+")"}a+="
"})}$("#productspanel").html(a);bindProduct();bindRemark()}function createImageStyle(b){var a=" style=\"background-image: url('"+b+"'); background-size: cover; background-repeat: no-repeat; background-position: center center; \" ";return a}function getTypeChain(){var b=getType(selectedtypeid);if(b==null){return[]}var e=[b];var c=false;while(!c){var a=b.ref;if((a==null)||(a==0)){c=true;break}else{b=getType(a);e[e.length]=b}}return e}function showChain(){var a="";if((selectedroomindex=="-1")||(selectedtableindex!=null)){var e=getTypeChain();a+='
Auswahl
';for(var c=e.length-1;c>=0;c--){var b=e[c];a+='
'+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()})}function bindProduct(){$(".productitem").off("click").on("click",function(f){f.stopImmediatePropagation();f.preventDefault();$("#search").val("");selectedprodid=parseInt(this.id.split("_")[1]);var c=$("#remark").val();var a=getProdEntry(selectedprodid);var b=a.extras;if((b!=null)&&(b.length>0)){if(a.unit==1){requestPriceInExtras=true;presetPriceInExtras=""}else{requestPriceInExtras=false}showExtras(a,c)}else{if(a.unit==1){enterpricedlgshown=true;$("#enterpricedlg").data("prodid",selectedprodid);$("#enterpricedlg").data("option",c);$("#enterpricefield").val("");$("#enterpricedlg").dialog({autoOpen:false,modal:true,height:570,width:400,buttons:{Abbrechen:function(){$(this).dialog("close")}}});$("#enterpricedlg").dialog("open");bindEnterPriceNumbers()}else{addProductToNewOrders(selectedprodid,c,null,"NO",0)}}})}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 c=$("#enterpricefield").val();var a=$("#enterpricedlg").data("option");c=c.trim();c=c.replace(decpoint,".");if((c!="")&&($.isNumeric(c))){$("#enterpricedlg").dialog("close");addProductToNewOrders(b,a,null,c,0,c)}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
";$("#selectiondialog").html(a);$(".ui-dialog-buttonset .ui-button").css("background-color","#44ff44");$(".ui-widget-header").css("background-color","#ff4400");bindExtra()}function bindExtra(){$(".extraitem").off("click").on("click",function(a){a.stopImmediatePropagation();a.preventDefault();extraClicked(parseInt(this.id.split("_")[2]))});$(".extraitemselected").off("click").on("click",function(a){a.stopImmediatePropagation();a.preventDefault();extraClicked(parseInt(this.id.split("_")[2]))})}function extraClicked(a){if(requestPriceInExtras!==false){presetPriceInExtras=$("#enterpriceextrasfield").val()}if(e_extras_selection[a]){e_extras_selection[a]=false}else{e_extras_selection[a]=true}displayExtras()}function applyExtras(){var b=[];for(var e=0;e=0)&&(a<=1000)){actcount=a}}insertDataIntoActDialog()});$(".actbtn").off("click").on("click",function(c){c.stopImmediatePropagation();c.preventDefault();var b=this.id;if(b==="actminusbtn"){if(actcount>0){actcount--}$("#actnumberentryfield").val(actcount)}else{if(b==="actplusbtn"){actcount++;$("#actnumberentryfield").val(actcount)}else{if(b==="actdiscount1btn"){actprice=origprice-origprice*discount1/100;var a=actprice.toFixed(2).replace(".",decpoint);$("#actpricefield").val(a);$("#actpriceinfo").html(a+" "+currency)}else{if(b==="actdiscount2btn"){actprice=origprice-origprice*discount2/100;var a=actprice.toFixed(2).replace(".",decpoint);$("#actpricefield").val(a);$("#actpriceinfo").html(a+" "+currency)}else{if(b==="actdiscount3btn"){actprice=origprice-origprice*discount3/100;var a=actprice.toFixed(2).replace(".",decpoint);$("#actpricefield").val(a);$("#actpriceinfo").html(a+" "+currency)}else{if(b==="acttogobtn"){acttogo=1-acttogo}}}}}}insertDataIntoActDialog()})}function changeAllNewOrders(){actionNewOrderConfirm(CHANGE_ALL)}function changeOneNewOrder(){actionNewOrderConfirm(CHANGE_ONE)}function delNewOrderItem(){actcount=0;actionNewOrderConfirm(CHANGE_ALL)}function actionNewOrderConfirm(h){var c=selectedEntry;if(rightchangeprice==1){var g=$("#actpricefield").val().trim();g=g.replace(",",".");if(g>999.99){alert("Maximaler Preis für das Produkt überschritten");return}if(g==""){g="NO"}else{if(!$.isNumeric(g)){alert("Es wurde ein falsches Zahlenformat angegeben");return}else{g=roundtodigits(g,2).toString();actprice=g;$("#actpricefield").val("")}}}else{var o=getProdEntry(c.prodid);if(o.unit==1){var g=$("#actpricefield").val().trim();g=g.replace(",",".")}else{g="NO"}}if(h==CHANGE_ONE){var a=c.origidxs;neworders[a[0]].option=$("#actremarkfield").val();neworders[a[0]].changedPrice=g;neworders[a[0]].togo=acttogo}else{var a=c.origidxs;for(m=0;m0){var a=c.origidxs;var r=a[0];var l=neworders[r].prodid;var g=neworders[r].changedPrice;var e=neworders[r].togo;var n=neworders[r].option;var k=neworders[r].extras;for(m=0;m=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}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;if((a.msg.length==0)&&(returntoorder==1)){unZoomTableMap();goOrderDesk()}else{displayProdsToPayForTable();displayProdsOnReceipt()}}function displayProdsToPayForTable(){bindHostButton("#hostbutton");bindCashButton();if(prodsToPayList.length==0){$("#oben").html("Keine weiteren Artikel vorhanden.")}else{prodsToPayListGrouping=new Grouping(prodsToPayList,createHashOfPayableItem);prodsToPayListGrouping.group();var a=prodsToPayListGrouping.outputList(createPayableItemListElement);$("#oben").html(a)}$(".payable").off("click").on("click",function(c){c.stopImmediatePropagation();c.preventDefault();var h=this.id;var g=$(".payable").index(this);var f=prodsToPayListGrouping.sortedset[g];var b=aProdToPayIsClicked(f);updateAccounted(h,b,f.count);displayProdsOnReceipt()});$("#payall").off("click").on("click",function(h){h.stopImmediatePropagation();h.preventDefault();for(var b=0;b'+payments[0].name+"