functionsendNewOrders(b){vara=getTableid();if(neworders.length!=0){varc={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.")}}functionhandleSentNewOrders(a){if(a.status!="OK"){alert("Es ist ein Fehler beim Versenden der Bestellung aufgetreten")}else{neworders=[];$("#search").val("");refreshGui()}}functionrefreshGui(){requestRoomInformation();clearProductsSelection();requestProdInformation();requestOrderedInformation();displayPanels()}functiongetTableid(){if(selectedroomindex!==null){if(selectedroomindex<0){return0}else{if(selectedtableindex!==null){vara=roominfo.roomstables[selectedroomindex].tables[selectedtableindex];returna.id}else{return0}}}}functionenableSendButton(){}functiondisableSendButton(){}functionmoveItems(){$("#selectiondialog").dialog({autoOpen:false,modal:true,height:400,buttons:{Abbrechen:function(){$(this).dialog("close")}}});vara=getRoomsForDialog();$("#selectiondialog").html(a);$("#selectiondialog").dialog("open");$(".ui-dialog-buttonset .ui-button").css("background-color","#44ff44");$(".ui-widget-header").css("background-color","#ff4400");bindMoveItemsRoom()}functionbindMoveItemsRoom(){$(".roomchangeitem").off("click").on("click",function(c){c.stopImmediatePropagation();c.preventDefault();varb=parseInt(this.id.split("_")[1]);vara=getTablesForDialog(b);$("#selectiondialog").dialog("open");$("#selectiondialog").html(a);bindMoveItemsTable(b)})}functionbindRightButtons(){$("#sendNewOrders").off("click").on("click",function(a){a.stopImmediatePropagation();a.preventDefault();sendNewOrders(false)});$("#paydeskbtn").off("click").on("click",function(a){a.stopImmediatePropagation();a.preventDefault();if(neworders.length>0){if(waitergopayprint==1){sendNewOrders(true)}else{sendNewOrders(false)}}goPayDesk()});$("#workbtn").off("click").on("click",function(a){if(neworders.length>0){sendNewOrders(true)}});$("#goorderbtn").off("click").on("click",function(a){a.stopImmediatePropagation();a.preventDefault();goOrderDesk()});$("#mainmenudlg").dialog({autoOpen:false,modal:true});$("#changetablebtn").off("click").on("click",function(a){a.stopImmediatePropagation();a.preventDefault();moveItems()})}functionbindMoveItemsTable(a){$(".tablechangeitem").off("click").on("click",function(c){c.stopImmediatePropagation();c.preventDefault();moveToRoomIndex=a;varb=parseInt(this.id.split("_")[1]);vard=roominfo.roomstables[a].tables[b];moveToTableId=d.id;if(selectedroomindex!="-1"){vard=roominfo.roomstables[selectedroomindex].tables[selectedtableindex];moveFromTableId=d.id;$("#selectiondialog").dialog("close");doAjax("GET","php/contenthandler.php?module=queue&command=getProdsForTableChange",{tableId:moveFromTableId},insertProductsToChangeTableDlg,null,true)}else{$("#selectiondialog").dialog("close")}})}functioninsertProductsToChangeTableDlg(a){if(a.status!="OK"){alert("Fehler");return}prodsToMove=a.msg;allselected=1;updateProdToMoveList();$("#selectallnothing").off("click").on("click",function(d){d.stopImmediatePropagation();d.preventDefault();allselected=1-allselected;for(varc=0;c<prodsToMove.length;c++){varb=prodsToMove[c];if(allselected===1){b["class"]="selecteditem"}else{b["class"]="unselecteditem"}}updateProdToMoveList()})}functionupdateProdToMoveList(){if(allselected===1){$("#selectallnothing_txt").val(W_UNSELALL[lang])}else{$("#selectallnothing_txt").val(W_SELALL[lang])}vara="";for(vare=0;e<prodsToMove.length;e++){varc=prodsToMove[e];varh="prodToMove_"+e;varb=" (unbezahlt)";varg="proditemselected";if(c["class"]===undefined){c["class"]="selecteditem"}vard=c["class"];if(d=="unselecteditem"){g="proditemunselected"}if(c.status==="unpaid_undelivered"){b=" (unbezahlt, nicht serviert)"}if((workflowconfig==WORKFLOW_WORK)||(workflowconfig==WORKFLOW_WORK_TRANSFER)){b=""}varf="<span class='"+d+"'>"+c.productname+b+"</span>";a+="<li class='prodToMoveEl "+g+"' id='"+h+"' >"+f+"</li>"}$("#productsToMoveList").