diff --git a/printserver/OrderSprinterPrintserver.exe b/printserver/OrderSprinterPrintserver.exe index a99c445..366e105 100644 Binary files a/printserver/OrderSprinterPrintserver.exe and b/printserver/OrderSprinterPrintserver.exe differ diff --git a/spider/install/installer.php b/spider/install/installer.php index 2cdc845..c38961b 100644 --- a/spider/install/installer.php +++ b/spider/install/installer.php @@ -85,7 +85,7 @@ class Installer { } Database::dropTables($pdo); Database::createEmptyTables($pdo, $prefix); - Database::setVersion($pdo,$prefix,"1.3.8"); + Database::setVersion($pdo,$prefix,"1.3.9"); Database::setAccessPassword($pdo,$prefix,$adminpass); Database::setRefreshRate($pdo,$prefix,"5"); // default: 5 times per hour return array("status" => "OK","msg" => "Installation successful"); diff --git a/webapp/OrderSprinterPrintserver.exe b/webapp/OrderSprinterPrintserver.exe index a99c445..366e105 100644 Binary files a/webapp/OrderSprinterPrintserver.exe and b/webapp/OrderSprinterPrintserver.exe differ diff --git a/webapp/bar.html b/webapp/bar.html index 82daf16..ed84c91 100644 --- a/webapp/bar.html +++ b/webapp/bar.html @@ -5,7 +5,7 @@ - + diff --git a/webapp/bill.html b/webapp/bill.html index dbebc13..a6f070b 100644 --- a/webapp/bill.html +++ b/webapp/bill.html @@ -5,7 +5,7 @@ - + diff --git a/webapp/css/numfield.css b/webapp/css/numfield.css index 7ae9301..915ee59 100644 --- a/webapp/css/numfield.css +++ b/webapp/css/numfield.css @@ -1 +1 @@ -@charset "UTF-8";.numfield{border-radius:25px;background:#bbb;padding:10px;border-style:solid;border-color:green;width:280px;border-spacing:5px}.numfield td{border-radius:15px;background:#eee;padding:10px;border-style:solid;border-color:black;font-size:30px;text-align:center;color:black}.numfield td:hover{background:#999}.numfield td.numnav{color:red} \ No newline at end of file +@charset "UTF-8";.numfield{border-radius:25px;background:#bbb;padding:10px;border-style:solid;border-color:green;width:280px;border-spacing:5px}.numfield td{border-radius:15px;background:#eee;padding:10px;border-style:solid;border-color:black;font-size:30px;text-align:center;color:black}.numfield td:hover{background:#999}.numfield td.numnav{color:red}.numfield td.keyboardapply{color:green} \ No newline at end of file diff --git a/webapp/elements/product.js b/webapp/elements/product.js index f74285c..adbd79e 100644 --- a/webapp/elements/product.js +++ b/webapp/elements/product.js @@ -11,6 +11,8 @@ function createProdTableHeaderLine() { "KurznamePreis (A)" + "Preis (B)" + "Preis (C)" + + "Einheit" + + "Tage" + "Steuersatz" + "Steuersatz Österreich" + "Audio" + @@ -27,7 +29,7 @@ function ident(depth) { return txt; } -function newProduct(id, longname, shortname,priceA,priceB,priceC,tax,taxaustria,amount,available,audio,favorite) { +function newProduct(id, longname, shortname,priceA,priceB,priceC,unit,days,tax,taxaustria,amount,available,audio,favorite) { var product = { id:id, longname:longname, @@ -35,6 +37,8 @@ function newProduct(id, longname, shortname,priceA,priceB,priceC,tax,taxaustria, priceA: priceA, priceB: priceB, priceC: priceC, + unit: unit, + days: days, tax: tax, taxaustria: taxaustria, amount: amount, @@ -51,6 +55,8 @@ function newProduct(id, longname, shortname,priceA,priceB,priceC,tax,taxaustria, + "" + "" + "" + + "" + + "" + "" + "" + this.createTaxAustriaSelection("prodtaxaustriasel_" + this.id) + "" @@ -67,6 +73,12 @@ function newProduct(id, longname, shortname,priceA,priceB,priceC,tax,taxaustria, $("#prodleaf_" + this.id + " input.prodpriceA").val(this.priceA); $("#prodleaf_" + this.id + " input.prodpriceB").val(this.priceB); $("#prodleaf_" + this.id + " input.prodpriceC").val(this.priceC); + $("#prodleaf_" + this.id + " input.produnit").val(this.unit); + if (this.days == '0123456') { + $("#prodleaf_" + this.id + " input.proddays").val(''); + } else { + $("#prodleaf_" + this.id + " input.proddays").val(this.days); + } $("#prodleaf_" + this.id + " input.prodtax").val(this.tax); $("#prodleaf_" + this.id + " input.prodamount").val(this.amount); }, @@ -117,6 +129,19 @@ function newProduct(id, longname, shortname,priceA,priceB,priceC,tax,taxaustria, return txt; }, + createUnitSelection:function(id) { + var txt = ""; + + return txt; + }, + createTaxAustriaSel:function(id) { var visi = "" if (austria == 0) { @@ -129,6 +154,14 @@ function newProduct(id, longname, shortname,priceA,priceB,priceC,tax,taxaustria, return txt; }, + createUnitField:function(id) { + var txt = '

' + + '' + + this.createUnitSelection(id) + + '

'; + return txt; + }, + createFavoriteSelection:function(id,text0,text1) { if (this.favorite == 1) { return ""; @@ -176,6 +209,13 @@ function newProduct(id, longname, shortname,priceA,priceB,priceC,tax,taxaustria, + createInputField("prodpriceA_" + this.id,"prodpriceA_input_" + this.id,"priceA") + createInputField("prodpriceB_" + this.id,"prodpriceB_input_" + this.id,"priceB") + createInputField("prodpriceC_" + this.id,"prodpriceC_input_" + this.id,"priceC") + + + "
" + + this.createUnitField("produnit_input_" + this.id) + + "
" + + + createInputField("proddays_" + this.id,"proddays_input_" + this.id,"days") + + createInputField("prodtax_" + this.id,"prodtax_input_" + this.id,"tax") + '

' @@ -225,12 +265,20 @@ function newProduct(id, longname, shortname,priceA,priceB,priceC,tax,taxaustria, $("#prodpriceA_" + this.id).html(PROD_PRICE[lang] + ' (A)'); $("#prodpriceB_" + this.id).html(PROD_PRICE[lang] + ' (B)'); $("#prodpriceC_" + this.id).html(PROD_PRICE[lang] + ' (C)'); + $("#produnit_" + this.id).html(PROD_UNIT[lang]); + $("#proddays_" + this.id).html(PROD_DAYS[lang]); $("#prodtax_" + this.id).html(PROD_TAX[lang]); $("#prodtaxaustria_" + this.id).html(PROD_TAXAUSTRIA[lang]); $("#prodamount_" + this.id).html(PROD_AMOUNT[lang]); $("#prodpriceA_input_" + this.id).val(this.priceA.toString().replace(".",decpoint)); $("#prodpriceB_input_" + this.id).val(this.priceB.toString().replace(".",decpoint)); $("#prodpriceC_input_" + this.id).val(this.priceC.toString().replace(".",decpoint)); + $("#produnit_input_" + this.id).val(this.unit); + if (this.days == '0123456') { + $("#proddays_input_" + this.id).val(''); + } else { + $("#proddays_input_" + this.id).val(this.days); + } if (this.tax != "null") { $("#prodtax_input_" + this.id).val(this.tax.toString().replace(".",decpoint)); diff --git a/webapp/feedback.html b/webapp/feedback.html index 6116fcd..3721773 100644 --- a/webapp/feedback.html +++ b/webapp/feedback.html @@ -4,7 +4,7 @@ - + diff --git a/webapp/index.html b/webapp/index.html index 16315b2..75d2828 100644 --- a/webapp/index.html +++ b/webapp/index.html @@ -9,8 +9,8 @@ - - + + @@ -108,6 +108,9 @@ function displayLoginOrLogoutMask(jsonContent) { // forward to valid page! doAjax("GET","php/contenthandler.php?module=admin&command=getViewAfterLogin",null,goToView,"Einstiegsseite nicht bekommen"); + } else if (status == "WAIT") { + alert("Zu viele Fehlversuche - in 3 Minuten erneut versuchen"); + $("#passwordfield").val(""); } else { alert("Falsches Passwort?"); // user needs to log in! @@ -203,7 +206,7 @@ function handleResultOfInstallCheck(is_installed) { if (is_installed == "Yes") { useInstallation(); } else { - setTimeout(function(){document.location.href = "install.html?v=1.3.8"},500); + setTimeout(function(){document.location.href = "install.html?v=1.3.9"},500); } } diff --git a/webapp/install.html b/webapp/install.html index 21f9153..3ca33f5 100644 --- a/webapp/install.html +++ b/webapp/install.html @@ -725,7 +725,7 @@ $(document).ready(function() {   - +   diff --git a/webapp/install/installer.php b/webapp/install/installer.php index ce3a988..e88394a 100644 --- a/webapp/install/installer.php +++ b/webapp/install/installer.php @@ -1996,6 +1996,45 @@ return false; } } +function updateUserTable1308_1309($prefix, $version, $dbname) { +$pdo = $this->pdo; +try { +if ($version != "1.3.8") { +$ret = $this->updateUserTable1307_1308($prefix, $version, $dbname); +if (!$ret) { +echo "Version update v1.3.7 to 1.3.8 not successful."; +return false; +} +} + +DbUtils::overrulePrefix($prefix); + +$sql = "ALTER TABLE %products% ADD unit INT(2) NULL AFTER priceC"; +$stmt = $pdo->prepare(DbUtils::substTableAlias($sql)); +$stmt->execute(); +$sql = "ALTER TABLE %histprod% ADD unit INT(2) NULL AFTER priceC"; +$stmt = $pdo->prepare(DbUtils::substTableAlias($sql)); +$stmt->execute(); + +$this->updateVersion($pdo, '1.3.9'); +$sql = "ALTER TABLE %products% ADD days VARCHAR(20) NULL AFTER unit"; +$stmt = $pdo->prepare(DbUtils::substTableAlias($sql)); +$stmt->execute(); +$sql = "ALTER TABLE %histprod% ADD days VARCHAR(20) NULL AFTER unit"; +$stmt = $pdo->prepare(DbUtils::substTableAlias($sql)); +$stmt->execute(); + +$sql = "ALTER TABLE %user% ADD failedlogins VARCHAR(20) NULL AFTER extrasapplybtnpos"; +$stmt = $pdo->prepare(DbUtils::substTableAlias($sql)); +$stmt->execute(); + +return true; +} catch (PDOException $e) { +echo "Error in v1.3.8 to 1.3.9: $e"; +return false; +} +} + function setVersion($prefix,$theVersion) { $pdo = $this->pdo; @@ -2122,7 +2161,7 @@ $this->basedb->doSQL($pdo,"INSERT INTO `%config%` (`id` , `name`, `setting`) VAL $this->basedb->doSQL($pdo,"INSERT INTO `%config%` (`id` , `name`, `setting`) VALUES (NULL , 'billlanguage', $billlanguage)"); $this->basedb->doSQL($pdo,"INSERT INTO `%config%` (`id` , `name`, `setting`) VALUES (NULL , 'currency', '$currency')"); $this->basedb->doSQL($pdo,"INSERT INTO `%config%` (`id` , `name`, `setting`) VALUES (NULL , 'receiptfontsize', '12')"); -$this->basedb->doSQL($pdo,"INSERT INTO `%config%` (`id` , `name`, `setting`) VALUES (NULL , 'version', '1.3.8')"); +$this->basedb->doSQL($pdo,"INSERT INTO `%config%` (`id` , `name`, `setting`) VALUES (NULL , 'version', '1.3.9')"); $this->basedb->doSQL($pdo,"INSERT INTO `%config%` (`id` , `name`, `setting`) VALUES (NULL , 'paymentconfig', '0')"); $this->basedb->doSQL($pdo,"INSERT INTO `%config%` (`id` , `name`, `setting`) VALUES (NULL , 'remoteaccesscode', null)"); $this->basedb->doSQL($pdo,"INSERT INTO `%config%` (`id` , `name`, `setting`) VALUES (NULL , 'decpoint', '$decpoint')"); @@ -2510,7 +2549,7 @@ $zones[] = $timezone_identifiers[$i]; } echo json_encode($zones); } else if ($command == 'update') { -$installerVersion = "1.3.8"; +$installerVersion = "1.3.9"; $admin = new InstallAdmin(); $pdo = $admin->openDbAndReturnPdo($_POST['host'],$_POST['db'],$_POST['user'],$_POST['password']); @@ -2540,7 +2579,7 @@ $supportedVersions = array("1.0.22","1.0.23","1.0.24","1.0.25","1.0.26","1.0.27" "1.1.0","1.1.1","1.1.2","1.1.3","1.1.4","1.1.5","1.1.6","1.1.7","1.1.8", "1.1.9","1.1.10","1.1.11","1.1.12","1.1.13","1.1.14","1.1.15","1.1.16","1.1.17", "1.1.18","1.1.19","1.1.20","1.1.21","1.1.22","1.1.23","1.1.24","1.1.25","1.1.26","1.1.27","1.1.28","1.1.29","1.1.30", "1.2.0","1.2.1","1.2.2", "1.2.3", "1.2.4","1.2.5","1.2.6","1.2.7","1.2.8","1.2.9","1.2.10","1.2.11","1.2.12","1.2.13","1.2.14","1.2.15","1.2.16","1.2.17", -"1.2.18","1.2.19","1.2.20","1.2.21","1.2.22","1.3.0","1.3.1","1.3.2","1.3.3","1.3.4","1.3.5","1.3.6","1.3.7" +"1.2.18","1.2.19","1.2.20","1.2.21","1.2.22","1.3.0","1.3.1","1.3.2","1.3.3","1.3.4","1.3.5","1.3.6","1.3.7","1.3.8" ); if (!in_array($version, $supportedVersions)) { @@ -2548,7 +2587,7 @@ echo json_encode("Quellversion nicht unterstützt"); return; } -$ret = $admin->updateUserTable1307_1308($_POST['prefix'], $version, $_POST['db']); +$ret = $admin->updateUserTable1308_1309($_POST['prefix'], $version, $_POST['db']); if(session_id() == '') { session_start(); diff --git a/webapp/kitchen.html b/webapp/kitchen.html index 56c525a..febefa1 100644 --- a/webapp/kitchen.html +++ b/webapp/kitchen.html @@ -5,7 +5,7 @@ - + diff --git a/webapp/manager.html b/webapp/manager.html index 665c79d..c41646b 100644 --- a/webapp/manager.html +++ b/webapp/manager.html @@ -5,7 +5,7 @@ - + @@ -202,7 +202,7 @@ var MAN_UPDATE_HINT = ["Das Updaten über diesen Weg funktioniert nur, wenn die "This update function only works if the files in the web directory are not write-protected and if a internet connection to the OrderSprinter webserver is available.", "Esta función the actualizar solo funciona si los ficheros no sin protegidos de escribirt y si hay una conección al servidor de OrderSprinter por Internet."]; var MAN_UPDATE_URL = ["Updateserver","Update Server","Servidor"]; -var MAN_AVAIL_UPD_VERSION = ["Neuste verfügbare Version","Newest released version","ùltima version"]; +var MAN_AVAIL_UPD_VERSION = ["Neueste verfügbare Version","Newest released version","ùltima version"]; var MAN_UPD_PROGRESS = ["Fortschritt","Progress","Progreso"]; var MAN_RESTORE_BTN = ["Importieren","Restore","Importar"]; var MAN_GO_LIVE = ["Starte Produktivbetrieb","Start productive mode","Empezar trabajar realmente"]; @@ -346,6 +346,8 @@ var MAN_DEL_HINT = ["Zum Löschen anklicken","Click to delete","Click para remov var MAN_FONTSIZE_HINT = ["Die Schriftgröße hat nur Einfluss, wenn kein eigenes Layout festgelegt wurde.","The font size only effects receipts if they do not use a specified layout.","El valor sólo funciona si no se usa un layout individual."]; var MAN_INIT_AUSTRIA = ["Erstelle Startbeleg (Österreich)","Create initial receipt (Austria)","Crear tiquet inicial (Austria)"]; var MAN_GOLIVE_WAIT_HINT = ["Bitte beachten Sie, dass diese Aktion auf langsamen Servern mehrere Minuten dauern kann. Schließen Sie diesen Dialog und warten Sie auf die Meldung, dass det Vorgang abgeschlossen wurde.","Please be aware that this action may take a while on slow servers. Please close this dialog and wait for the message that the process has completed.","Esta acción puede durar unos minutos. Por favor confirme este dialogo y espere por el mensaje que la acción esta completada."] +var MAN_CLOSING_TIME_LIMIT_ERROR = ["Ein Tagesabschluss wurde nicht erzeugt, weil zwischen zwei Tagesabschlüssen etwas Zeit (mind. 2 Min.) vergehen sollte.","No closure was created because between two clsoings there should be some time (at least 2 minutes).","No conclusión esta creado porque el tiempo entre dos conclusiones debe ser un rato (min, 2 minutos)."]; + var lang = 0; var generalVals = [12,2,0,3,0,1,1,0,0,1, 0,50,20,10,1,0,0,0,1,0,1,0,0,1,1]; @@ -354,6 +356,7 @@ var numberOfClosings = 0; var unpaidTables = ""; var version = ''; +var newerversionavailable = 0; var generalValuesSettings = [ ["usstval","MwSt","i",2,"Mehrwertsteuer ist kein Zahlenwert"], @@ -1378,9 +1381,8 @@ function binding() { $("#update_btn").off("click").on("click", function (e) { e.stopImmediatePropagation(); e.preventDefault(); - var availVersion = $("#availversion").html(); - if (availVersion == version) { - alert("Update not possible (versions do not differ): " + version); + if (newerversionavailable == 0) { + alert("Update not possible (version on server unknown or not newer): " + version); } else { doAjax("GET","php/updatehandler.php?command=updatecheck",null,handleUpdateCheckResult,"Skriptproblem"); } @@ -1475,6 +1477,7 @@ function insertAvailableUpdateVersion(answer) { $("#urlpath").val(answer.url); if (answer.status == "OK") { $("#availversion").html(answer.msg); + newerversionavailable = answer.neweravailable; } else { $("#availversion").html('?'); } @@ -1511,8 +1514,9 @@ function handleUpdateCheckResult(answer) { var millis=getMillis(); setTimeout(function(){ - document.location.href = "install.html?v=1.3.8&mode=onlyupdate&n=" + millis; + document.location.href = "install.html?v=1.3.9&mode=onlyupdate&n=" + millis; },250); + document.location.href = "install.html?v=1.3.9&mode=onlyupdate&n=" + millis; } function handleUpdateReplace(answer) { @@ -1685,7 +1689,11 @@ function createClosing(closingresult) { doAjax("GET","php/contenthandler.php?module=closing&command=getClosingSummary",{closingid: closingid},doPrintClosingSummary,"Druckproblem"); } } else { - alert("Fehler " + closingresult.code + ": " + closingresult.msg); + if (closingresult.code == 33) { + alert("Fehler: " + MAN_CLOSING_TIME_LIMIT_ERROR[lang]); + } else { + alert("Fehler " + closingresult.code + ": " + closingresult.msg); + } } } @@ -2842,15 +2850,15 @@ $(document).on("pageinit", "#admin-page", function () {
- +
- +
- +
@@ -3039,7 +3047,13 @@ $(document).on("pageinit", "#admin-page", function () { bekommt.
  • Steuersatz-Austria: Diese Einstellung ist für Österreichische Betriebe wichtig: 1: Steuersatz 'Normal', 2: Ermäßigt-1, 3: Ermäßigt-2, 4: Steuersatz 'Besonders'. Ist der Betriebsmodus 'Österreich' ausgewählt, so wird immer dieser Steuersatz verwendet.
  • Menge: Die verfügbare Menge. Bei jeder Bestellung wird die Anzahl um 1 vermindert. Kurz vor Erreichen der Anzahl 0 bekommt der Kellner einen Warnhinweis bei dem Produkt. - +
  • Einheit: + +
  • Tage: Man kann die Tage einschränken, an denen ein Produkt bestellt werden kann. 0=Sonntag, 1=Montag, usw. bis 6=Samstag. Wird ein Produkt an allen Tagen verkauft, ist keine Angabe erforderlich. Ein Produkt, welches nur an Wochenenden verkauft wird, muss mit '06' oder '60' ausgezeichnet werden. +

    Ein Produkteintrag mit weiteren Eigenschaften kann beispielsweise so aussehen:

    diff --git a/webapp/paydesk.html b/webapp/paydesk.html
    index c95b0ee..c908877 100644
    --- a/webapp/paydesk.html
    +++ b/webapp/paydesk.html
    @@ -5,7 +5,7 @@
         
          
     
    -	
    +	
     	
      	
       
    @@ -14,7 +14,7 @@
        
             
      
    +var CALC_TIP=0;var CALC_TOTAL=1;var lang=0;var receiptfontsize=12;var paymentconfig=0;var decpoint=".";var currency="";var osroombtnsize=0;var ostablebtnsize=0;var osprodbtnsize=0;var hasRooms=true;var cameFromOrdering=0;var billbrutto=0;var billnetto=0;var prodsToPayList=[];var prodsToPayListGrouping=[];var payTable="";var prodsOnReceiptList=[];var prodsOnReceiptListGrouping=[];var calcmodus=CALC_TOTAL;var workflowconfig=0;var digigopaysetready=1;var onlyReceiptShown=0;var prodsToPayList=null;function initializeMainMenu(a){$.ajax({type:"GET",dataType:"json",url:"php/contenthandler.php?module=admin&command=getJsonMenuItemsAndVersion",async:false,success:function(c){$("#versioninfo").html(c.version+" ");if(c.loggedin==1){$("#loggedinuser").html(" "+c.user);var b='
  • Hauptmenü
  • ';$.each(c.menu,function(g,f){var e=f.name;var h=f.link;if((e!="Abmelden")&&(e!="Log out")&&(e!="Adios")){b+='
  • '+e+"
  • "}else{b+='
  • '+e+"
  • "}});$(a).empty().append(b).promise().done(function(){$(a).listview("refresh")});$("#menuswitch").show()}else{$("#menuswitch").hide()}},error:function(b){alert("Kommunikationsproblem zum Server bei Modulabfrage!")}});$(".modulebutton").off("click").on("click",function(c){var b=$(this).attr("href");doAjax("POST","php/contenthandler.php?module=admin&command=setLastModuleOfUser",{view:b},null,"Problem Benutzerdatenpflege")});intervalGetPrinterStatus(5)}function intervalGetPrinterStatus(b){doAjax("GET","php/contenthandler.php?module=admin&command=isPrinterServerActive",null,setPrinterStatus,null,true);var a=setInterval(function(){doAjax("GET","php/contenthandler.php?module=admin&command=isPrinterServerActive",null,setPrinterStatus,null,true)},b*1000)}function setPrinterStatus(a){if(a.status==="OK"){if(a.msg===0){$(".printerstatus").show();return}}$(".printerstatus").hide()}function hideMenu(){$("#modulepanel").panel("close");$("#menuswitch").off("click").on("click",function(a){$("#menuswitch").trigger("mouseout");a.stopImmediatePropagation();a.preventDefault();$("#modulepanel").panel("open")})}function refreshList(a){if($(a).hasClass("ui-listview")){$(a).listview("refresh")}else{$(a).trigger("create")}}function doAjax(a,b,f,e,c,g){if(typeof g==="undefined"){g=false}$.ajax({type:a,url:b,dataType:"json",data:f,async:g,success:function(h){if(e!=null){e(h)}},error:function(l,h,i){if(c!=null){var k=c+", Status: "+h+", Error:"+i+", Msg: "+l.responseText+" ("+b+")";alert("Kommunikationsfehler zum Server: "+k)}}})}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(h,f,g){}})}function doAjaxTransmitData(a,b,g,f,e,c){$.ajax({type:a,url:b,dataType:"json",data:g,async:false,success:function(h){if(f!=null){f(h,c)}},error:function(l,h,i){if(e!=null){var k=e+", Status: "+h+", Error:"+i+", Msg: "+l.responseText+" ("+b+")";alert("Kommunikationsfehler zum Server: "+k)}}})}function doAjaxSuppressError(a,b,f,e,c){$.ajax({type:a,url:b,dataType:"json",data:f,async:false,success:function(g){if(e!=null){e(g)}},error:function(g){e("ERROR")}})}function doAjaxNonJsonNonCall(a,b,c){$.ajax({type:a,data:c,url:b,async:false,error:function(e){alert("Kommunikationsproblem zum Server")}})}function toHtml(a){if(typeof a==="string"){return(a.replace(/"/g,""").replace(//g,">"))}else{return a}}function createExtraParagraph(b){if((b==null)||(b=="")){return""}var c="";for(var a=0;a+ "+toHtml(b[a])+"

    "}return c}function checkForLogIn(){doAjax("GET","php/contenthandler.php?module=admin&command=isUserAlreadyLoggedIn",null,handleTestForLoggedIn,null)}function handleTestForLoggedIn(a){if(a!="YES"){setTimeout(function(){document.location.href="index.html"},250)}}function isInt(a){if(Math.floor(a)==a&&$.isNumeric(a)){return true}else{return false}}function isFloat(a){return Number(a)===a&&a%1!==0}function getMillis(){var a=new Date();var b=a.getTime();return b}var P_SUM=["Summe:","Sum:","Todo:"];var P_TOTAL=["Total","Total","Total"];var P_MWST=["MwSt","Tax","IVA"];var P_NETTO=["Netto","Net","Neto"];var P_BRUTTO=["Brutto","Gross","Bruto"];var P_ID=["Id:","Id:","Id:"];var P_TABLE=["Tisch:","Table:","Mesa:"];var P_WAITER=["Es bediente Sie:","Waiter:","Camarero:"];var P_NO=["Anz.","No.","Nú."];var P_DESCR=["Beschreibung","Description","Descripción"];var P_PRICE=["Preis","Price","Precio"];function createReceiptFooterFromDbTaxes(c,a,h,k,m){var b='style="border: solid black 0px;padding: 3px;text-align:right;vertical-align:bottom;"';var n='style="text-align:center;vertical-align:bottom;"';var f=" ";var l=f;l+=""+P_MWST[c]+"% "+P_MWST[c]+""+P_NETTO[c]+""+P_BRUTTO[c]+"";for(var g=0;g"+e.tax;l+=""+e.mwst.replace(".",m);l+=""+e.netto.replace(".",m);l+=""+e.brutto.replace(".",m);l+=""}l+=f;l+="   "+P_SUM[c]+'"+h.toFixed(2).replace(".",m)+"";l+=f;l+="
     
    ";l+=toHtml(a).replace(/(?:\r\n|\r|\n)/g,"
    ");l+="
    ";return l}function generateProdPart(k,b){var i=0;tablecontent="";for(i=0;i";return h}var tminfo=null;function insertTMInfo(a){tminfo=a}function Tablemap(b,a,c){this.tables=a;this.roomid=b;this.elem=c;this.selectedTableId=-1;if((a!=null)&&(a.length>0)){this.selectedTableId=a[0].id}}Tablemap.prototype.renderContent=function(){doAjaxTransmitData("GET","php/tablemap.php?command=getTableMap&roomid="+this.roomid,null,this.renderTableList,null,this);d=new Date();$("#mapimgpart").attr("src","php/tablemap.php?command=getTableMapImgAsPng&roomid="+this.roomid+"&tableid="+this.selectedTableId+"&"+d.getTime())};Tablemap.prototype.renderTableList=function(b,a){a.tables=b;var c=a.createList(b,"table_","tablebtn","c",a);$(a.elem).html(c);tmRefreshList(a.elem);a.binding(a)};Tablemap.prototype.createList=function(n,a,g,h,p){var m='
    ';for(var l=0;l'}m+="
    ";return m};Tablemap.prototype.binding=function(a){$(".tablebtn").off("click").on("click",function(b){b.stopImmediatePropagation();b.preventDefault();a.selectedTableId=this.id.split("_")[1];a.renderContent(a.elem)});$("#tmimgbtn").off("click").on("click",function(b){b.stopImmediatePropagation();b.preventDefault();a.uploadImg(a)});$("#mapimgpart").off("click").on("click",function(k){k.stopImmediatePropagation();k.preventDefault();var c=$("#mapimgpart").width();var b=$("#mapimgpart").height();var l=$(this).offset().top-$(window).scrollTop();var g=$(this).offset().left-$(window).scrollLeft();var i=Math.round((k.clientX-g));var h=Math.round((k.clientY-l));var f={tableid:a.selectedTableId,x:(100*i)/c,y:(100*h)/b};doAjaxTransmitData("POST","php/tablemap.php?command=setPosition",f,a.renderIfOk,null,a)})};Tablemap.prototype.createOverlay=function(y,h,o,v,f,k,u,n){if(typeof n==="undefined"){n=null}var q=[];var g="";if(u==0){g="overlaysize-0"}else{if(u==1){g="overlaysize-1"}else{if(u==2){g="overlaysize-2"}}}for(var x=0;x'+z;if(w!=0){r=''+z;if(o!=""){r+="
    ("+o+": "+l+")"}else{r+="
    ("+l+")"}}r+="
    ";q[q.length]=r}}return q};Tablemap.prototype.bindingForOverlaySelection=function(a,c,b,e){if(e!=null){$("#tablemapcontent:not(.overlaytxt)").off("click").on("click",function(f){f.stopImmediatePropagation();f.preventDefault();e()})}$("#tablemapcontent .overlaytxt").off("click").on("click",function(m){m.stopImmediatePropagation();m.preventDefault();var g=this.id.split("_")[1];var h="?";for(var f=0;f0)){var u=a[0].id;var n=a[0].name;var t=(100*100)+(100*100);for(var k=0;k'}k+="";return k};Tablemap.prototype.uploadImg=function(a){var b=new FormData($("#tablemapimgform")[0]);b.append("roomid",a.roomid);$.ajax({url:"php/tablemap.php?command=uploadimg",type:"POST",dataType:"json",xhr:function(){var c=$.ajaxSettings.xhr();if(c.upload){}return c},success:function(c){if(c.status!="OK"){a.imgNotUploaded(c)}else{a.imgUploaded(c,a)}},error:function(c){a.imgNotUploaded(c)},data:b,cache:false,contentType:false,processData:false})};Tablemap.prototype.imgUploaded=function(b,a){a.renderContent()};Tablemap.prototype.imgNotUploaded=function(a){alert("Bild konnte nicht hochgeladen werden. Ist es zu groß (> 1 MB)? Oder wurde der Dateiname nicht angegeben?")};function shallDisplayRoom(c){var a=tminfo;if(tminfo==null){return{show:false}}for(var b=0;b";b.src="data:text/html;charset=utf-8,"+encodeURI(a);document.body.appendChild(b)}function Grouping(b,a){this.set=b;this.sortedset=[];this.group=function(){this.sortedset=[];for(var g=0;g Bestellansicht","-> Order view","-> Vista de Orden"];var P_TO_PAY=["Zu zahlen: ","To pay: ","Pagar total: "];var P_PAY_RETURN=["Zurück: ","Return: ","Torna: "];var P_CALC_PAYBACK=["Berechne","Calculate","Calcular"];var P_HAS_PAID=["Bezahlt: ","Paid: ","Pagado: "];var P_TOGO=["Außer-Haus-Verkauf","Sale with Tax No 2","Venta IVA 2"];var P_TIP=["nur Trinkg.: ","Only tip: ","Solo prop.: "];var P_TOTAL_INCL_TIP=["Zielbetrag:","Target pay:","Quiere pagar:"];var CALC_TIP_TXT=["Angabe extra Trinkg.","Do Tip separate","Propina individual"];var CALC_TOTAL_TXT=["Angabe inkl.Trinkg.","Do Tip incl.","Propina incl."];var P_GUESTS=["Gäste","Guests","Habitaciones"];var showHostTemplate=false;var guests=[];var internalguests=[];var hotelinterface=0;var PAYMENT_HS3=7;var PAYMENT_GUEST=8;var currentPaymentId=7;function getGeneralConfigItems(){doAjax("GET","php/contenthandler.php?module=admin&command=getGeneralConfigItems",null,insertGeneralConfigItems,"Fehler Konfigurationsdaten")}function getPayments(a){doAjax("GET","php/contenthandler.php?module=admin&command=getPayments",null,a,"Fehler Zahlungswege")}function insertGeneralConfigItems(b){if(b.status=="OK"){var a=b.msg;decpoint=a.decpoint;$("#info-page").data("decpoint",a.decpoint);currency=a.currency;var e=a.tax;var c=e.replace(".",decpoint);$("#info-page").data("usstGerVal",c);$("#info-page").data("usst",e);e=a.togotax;c=e.replace(".",decpoint);$("#info-page").data("togoTaxGerVal",c);$("#info-page").data("togotax",e);$("#info-page").data("companyinfo",a.companyinfo);$("#info-page").data("payPrintType",a.payprinttype);$("#info-page").data("currency",a.currency);$("#info-page").data("billlanguage",a.billlanguage);$("#info-page").data("userlanguage",a.userlanguage);receiptfontsize=parseInt(a.receiptfontsize);$("#receiptpart").css("font-size",receiptfontsize+"px");paymentconfig=a.paymentconfig;$("#curtopay2").html(" "+a.currency);workflowconfig=a.workflowconfig;digigopaysetready=a.digigopaysetready;setLanguage(a.userlanguage)}else{$("#contentpart").hide();setTimeout(function(){document.location.href="index.html"},250)}}function addEntryOrIncreaseCount(a,f){var c=0;var g=false;var e=f.prodid+"-"+f.extras.join("_")+f.price+"-"+f.pricelevelname+"#"+f.tax+"_"+f.togo;for(c=0;cID:"+e+"";g+=' ";g+=""+c+"";g+=" ";if(l!=""){g+="Gast: "+toHtml(l)+"";g+=" "}g+=""+P_NO[b]+""+P_DESCR[b]+""+P_PRICE[b]+""+P_TOTAL[b]+"";return g}function genCreateReceiptFooterNoSum(c,e,b,a){return genCreateReceiptFooter(c,e,b,"","","",a)}function genCreateReceiptFooter(a,f,b,k,e,m,n){var c='style="border: solid black 0px;padding: 3px;text-align:right;vertical-align:bottom;"';var p='style="text-align:center;vertical-align:bottom;"';var h=" ";var o=h;o+=""+P_MWST[f]+"% "+P_MWST[f]+""+P_NETTO[f]+""+P_BRUTTO[f]+"";for(var l=0;l"+k+'"+e+'"+m+""}o+=h;o+="   "+P_SUM[f]+'"+m+"";o+=h;o+="
     
    ";o+=toHtml(b).replace(/(?:\r\n|\r|\n)/g,"
    ");o+="
    ";return o}function generateOneProdLine(k,g,i,a,n,f){var b='style="border: solid black 0px;padding: 3px;text-align:right;vertical-align:bottom;"';var h='style="border: solid black 0px;padding: 3px;text-align:center;vertical-align:bottom;"';var c=(parseFloat(i)).toFixed(2).replace(".",n);if(a!="A"){g+=" ("+a+")"}if(f==1){g="To-Go: "+g}var m=k*i;var l="";var e='style="white-space: nowrap;overflow: hidden;text-overflow:ellipsis;width: 60%;"';l+="'+k+""+g;l=l+""+c;l+=""+m.toFixed(2).replace(".",n)+"";return l}function generateProdPartByDbContent(f,e){var c=0;tablecontent="";for(c=0;c=0);var m=(p.toLowerCase().indexOf(g)>=0);if(l||m){i++;h=toHtml(k+" - "+p);if(!c){c=true;f+='"}else{f+='"}}});if(i===1){$("#hotelroomfoundguest").html(h);$("#hotelroomselection").html(f)}else{$("#hotelroomselection").html(f)}if(b){$("#hotelroomselection").selectmenu("refresh")}}function setLanguage(b){$("#roomsel").html(P_ROOMSEL[b]);$("#oben").listview("refresh");lang=b;var a='
  • '+P_PAYDESK_ACTIONS[lang]+'
  • '+P_BAR_INPUT[lang]+'
  • '+P_BAR_GET[lang]+'
  • '+P_BAR_SUM[lang]+"
  • ";$("#cashactions").html(a);$("#cashactions").listview("refresh");$("#navtitle").html(P_NAV[lang]);$("#nav2order").html(P_ORDER_ACTION[lang]);$("#navactions").listview("refresh");$("#paydesktitle").html(P_TITLE[lang]);$("#OnlyPayTxt").html(P_ONLY_PAY[lang]);$("#payprinttxt").html(P_PAY_PRINT[lang]);$("#payway").html(P_CHANGE_CALC[lang]);$("#choosepayway").html(P_CHOOSE_PAYWAY[lang]);$("#canceltxt").html(P_CANCEL[lang]);$("#cancelroomselectiontxt").html(P_CANCEL[lang]);$("#cashtakeouttxt").html(P_CASHTAKEOUT[lang]);$("#amounttxt").html(P_AMOUNT[lang]);$("#amounttxt2").html(P_AMOUNT[lang]);$("#cashtakeintxt").html(P_CASHTAKIN[lang]);$("#cashoverviewtxt").html(P_OVERVIEW[lang]);$("#putinact").html(P_PUT_IN[lang]);$("#takeoutact").html(P_TAKE_OUT[lang]);$("#overviewdetails").html(P_OVERV_DETAILS[lang]);$("#cashsum").html(P_CASH_SUM[lang]);$("#includeowncash").html(P_INCLUDE_OWN[lang]);$("#noelementstxt").html(P_NO_ELEM[lang]);$("#noelementsdetailstxt").html(P_NO_ELEM_DETAILS[lang]);$("#topaytxt").html(P_TO_PAY[lang]);$("#rettxt").html(P_PAY_RETURN[lang]);$("#calcreturn").html(P_CALC_PAYBACK[lang]);$("#haspaidtxt").html(P_HAS_PAID[lang]);$("#tableselimmaptxt").html(P_TABLE_SEL[lang]);setCalcModusBtn()}function getButtonSizes(){doAjax("GET","php/contenthandler.php?module=admin&command=getButtonSizes",null,fillButtonSizes,"Keine Buttongroesseninformation")}function fillButtonSizes(a){osroombtnsize=a.roombtnsize;ostablebtnsize=a.tablebtnsize;osprodbtnsize=a.prodbtnsize}function getProdSizeClass(){if(osprodbtnsize==1){return("osprod-1")}else{if(osprodbtnsize==2){return("osprod-2")}else{return""}}}function getTableSizeClass(){if(ostablebtnsize==1){return("ostable-1")}else{if(ostablebtnsize==2){return("ostable-2")}else{return""}}}function getRoomSizeClass(){if(osroombtnsize==1){return("osroom-1")}else{if(osroombtnsize==2){return("osroom-2")}else{return""}}}function insertPayments(f){var e=f.payments;hotelinterface=f.hotelinterface;guests=f.guests;internalguests=f.internalguests;var c="";var a=20;if(paymentconfig==1){a=2}var b=false;$.each(e,function(h,g){if(h'+g.name+"";if(!b){c+="


    ";b=true}}});c+=''+P_CANCEL[lang]+"";$("#paymentlist").html(c)}function hideReceiptPart(){$("#payWithoutPrint").hide();$("#payWithPrint").hide();$("#hostbutton").hide();$("#unten").hide()}function showReceiptPart(){$("#payWithoutPrint").show();$("#payWithPrint").show();$("#hostbutton").show();$("#unten").show();$("#tablemapcontent").hide();$("#togoarea").hide()}function getTableMapPreferences(){doAjax("GET","php/tablemap.php?command=getTableMapPreferences",null,insertTMInfoAndStartDisplayProc,"Keine TM-Information")}function insertTMInfoAndStartDisplayProc(a){tminfo=a;startDisplayProcess()}function handleClickInTablemap(a){checkForLogIn();$("#info-page").data("roomid",null);$("#info-page").data("tableviewactive",0);$("#info-page").data("tid",a.tableid);$("#info-page").data("tablename",a.tablename);$("#oben").show();getProdsToPayForTable(a.tableid,a.tablename)}function displayAllRooms(){checkForLogIn();$("#moneyToInsert").val("");$("#moneyToTakeOut").val("");$("#cashactions").show();$("#navactions").show();$("#remarkin").val("");$("#remarkout").val();hideReceiptPart();var a=$("#info-page").data("billlanguage");$("#prodlistinreceipt").empty().append(''+P_NO[a]+""+P_DESCR[a]+''+P_PRICE[a]+''+P_TOTAL[a]);$.getJSON("php/contenthandler.php?module=roomtables&command=getRooms",function(f){var g=f.roomstables;var c=f.takeawayprice;var h=g.length;if(h==1){$("#info-page").data("roomid",g[0]["id"]);displayTablesOfRoom(g[0],false);if(cameFromOrdering==1){$("#startpaypage").show()}else{$("#startpaypage").hide()}}else{var b="";var e=getRoomSizeClass();$.each(g,function(l,k){b+='
  • '+k.name+"
  • "});if(c!="0.00"){b+='
  • '+P_TOGO[a]+" ("+c+" "+currency+")
  • "}$("#startpaypage").hide();$("#oben").append(b).promise().done(function(){bindTogoOrdering();$(this).off("click").on("click","a",function(k){k.stopImmediatePropagation();k.preventDefault();var i=g[this.id];$("#info-page").data("roomid",i.id);$("#startpaypage").show();displayTablesOfRoom(i,true)});refreshList(this)})}})}function bindTogoOrdering(){$(".togoorder").off("click").on("click",function(a){a.stopImmediatePropagation();a.preventDefault();$("#info-page").data("roomid",null);$("#info-page").data("tableviewactive",0);$("#info-page").data("tid",0);$("#info-page").data("tablename",P_TOGO[lang]);$("#oben").show();getProdsToPayForTable(0,"")})}function displayTablesOfRoom(a,b){checkForLogIn();hasRooms=b;var c=$("#info-page").data("roomid");hideReceiptPart();displayUnpaidTables("Tischinfo nicht erhalten!")}$(document).ready(function(){checkForLogIn();var a=setInterval(function(){var b=$("#info-page").data("roomid");if(b!=null){displayUnpaidTables(null)}},10000);$.ajaxSetup({cache:false})});function displayUnpaidTables(a){doAjax("GET","php/contenthandler.php?module=roomtables&command=getUnpaidTables",{roomid:$("#info-page").data("roomid")},displayTables,a)}function displayTables(f){var i=f.tables;var e=f.takeawayprice;$("#info-page").data("tableviewactive",1);var a=$("#info-page").data("roomid");var g=shallDisplayRoom(a);if(g.show){$("#oben").hide();$("#tablemapcontent").show();$("#togoarea").show();d=new Date();$("#mapimgpart").attr("src","php/tablemap.php?command=getUnpaidTablesMapImgAsPng&showBubbles=0&roomid="+a+"&"+d.getTime());var b=new Tablemap(a,null,"");var c=b.createOverlay("#mapimgpart",g.pos,"",decpoint,currency,i,ostablebtnsize);$("#tableoverlay").html(c);b.bindingForOverlaySelection(handleClickInTablemap.bind(this),a,i,null);if(!hasRooms){if(e!="0.00"){var h='
  • '+P_TOGO[lang]+"
  • ";$("#tables-list-togo").html(h);$("#togoarea").show()}refreshList("#tables-list-togo");bindTogoOrdering()}}else{$("#oben").show();$("#tablemapcontent").hide();$("#togoarea").hide();var h='
  • '+P_TABLE_SEL[lang]+"
  • ";var k=getTableSizeClass();$.each(i,function(m,o){var n=o.pricesum.replace(".",decpoint);var l=o.name+"    ("+n+" "+currency+")";h+='
  • '+l+"
  • "});if(!hasRooms){if(e!="0.00"){h+='
  • '+P_TOGO[lang]+"
  • "}}$("#oben").empty().append(h).promise().done(function(){bindTogoOrdering();$(this).off("click").on("click",".info-go",function(n){n.stopImmediatePropagation();n.preventDefault();$("#info-page").data("roomid",null);$("#info-page").data("tableviewactive",0);var l=i[this.id]["id"];var m=i[this.id]["name"];$("#info-page").data("tid",l);$("#info-page").data("tablename",m);getProdsToPayForTable(l,m)});refreshList(this)})}}function getProdsToPayForTable(a,b){$("#startpaypage").show();if(a==0){b=P_TOGO[lang];$("#info-page").data("taxtype","togo")}else{$("#info-page").data("taxtype","normal")}$("#cashactions").hide();$("#navactions").hide();$.ajax({type:"GET",dataType:"json",data:{tableid:a},url:"php/contenthandler.php?module=queue&command=getJsonProductsOfTableToPay",async:false,success:function(e){var c=e.status;var f=e.msg;if(c!="ERROR"){showReceiptPart();prodsToPayList=f;$("#info-page").data("tableprods",f);bindPayButton(f,a,b);initiatePayableView(f,b)}else{alert("Fehler: "+f)}},error:function(c){alert("Sorry, there was a problem getting the products to pay for table!")}})}function initiatePayableView(a,b){$("#tableinreceipt").html(b+"
     ");clearUntenAndReceipt();createAllEntriesInReceipt();calcSum();prodsToPayList=a;payTable=b;displayProdsToPayForTable();bindingPressReceipt()}function bindingPressReceipt(){$(".receipttable").off("click").on("click",function(a){a.stopImmediatePropagation();a.preventDefault();if(onlyReceiptShown===1){$("#oben").show();$("#unten").show();$("#paybuttongroup").show();$("#hostbuttongroup").show();$(".receipttable").css("width","70%")}else{$("#oben").hide();$("#unten").hide();$("#paybuttongroup").hide();$("#hostbuttongroup").hide();$(".receipttable").css("width","100%")}onlyReceiptShown=1-onlyReceiptShown})}function displayProdsToPayForTable(){prodsToPayListGrouping=new Grouping(prodsToPayList,createHashOfPayableItem);prodsToPayListGrouping.group();var b=getProdSizeClass();var a='
  • '+P_NOT_PAID[lang]+payTable+"
  • ";a+='
  • '+P_ALL[lang]+"
  • ";var c=a+prodsToPayListGrouping.outputList(createPayableItemListElement);$("#oben").html(c);refreshList("#oben");$(".payable").off("click").on("click",function(h){h.stopImmediatePropagation();h.preventDefault();var g=$(this).closest("li");var i=$("#oben li").index(g)-2;var f=prodsToPayListGrouping.popSortedEntry(i);prodsOnReceiptList[prodsOnReceiptList.length]=f;displayProdsToPayForTable();displayProdsOnReceipt()});$("#payall").off("click").on("click",function(g){g.stopImmediatePropagation();g.preventDefault();for(var f=0;f0,00 '+currency+"

  • ";var c=a+prodsOnReceiptListGrouping.outputList(createOnReceiptItemListElement);$("#unten").html(c);refreshList("#unten");createAllEntriesInReceipt();$(".onreceipt").off("click").on("click",function(h){h.stopImmediatePropagation();h.preventDefault();var g=$(this).closest("li");var i=$("#unten li").index(g)-1;var f=prodsOnReceiptListGrouping.popSortedEntry(i);prodsToPayList[prodsToPayList.length]=f;displayProdsToPayForTable();displayProdsOnReceipt()})}function generateListItem(g,c,h,e,f){var b=getProdSizeClass();var a='
  • ';a+=''+e+"
  • ";return a}function createHashOfPayableItem(b){var a=b.longname;if(b.pricelevelname!="A"){a+=" ("+b.pricelevelname+")"}a+=" - "+(parseFloat(b.price).toFixed(2).replace(".",decpoint));if(b.togo==1){a="To-Go: "+a}var c=createExtraParagraph(b.extras);return toHtml(a)+c}function createPayableItemListElement(b){var a="";if("count" in b){if(b.count>1){a=b.count+"x "}}var c=generateListItem("c","plus","payable_"+b.id,a+createHashOfPayableItem(b),"payable");return c}function createOnReceiptItemListElement(b){var a="";if("count" in b){if(b.count>1){a=b.count+"x "}}var c=generateListItem("c","plus","payable_"+b.id,a+createHashOfPayableItem(b),"onreceipt");return c}function clearUntenAndReceipt(){var a='
  • ';a+=P_CONTENT_RECEIPT[lang]+':

    0,00 '+currency+"

  • ";$("#unten").empty().append(a).promise().done(function(){refreshList("#unten")});$("#prodlistinreceipt tr").each(function(){$(this).remove()});$("#thedate").html("

     
    ")}function createAllEntriesInReceipt(){var a=new Array();for(var e=0;e'+$("#receiptpart").html()+"";var q=$("#info-page").data("payPrintType");if(q=="s"){printBill(billid)}else{$("#oben").hide();var u=""+$(".receipttable").html()+"
    ";printContent(u)}}prodsOnReceiptList=[];getProdsToPayForTable(b,k);var i=$("#oben li").size()-2;if(i>0){}else{if(cameFromOrdering==1){goToUrl("waiter.html")}else{goToUrl("paydesk.html")}}}}else{alert("Fehler: "+s)}},error:function(i){alert("Sorry, there was a problem! "+i)}})}function goToUrl(a){setTimeout(function(){document.location.href=a},500)}function cashactions(){$(".cashaction").off("click").on("click",function(a){var b=$(this).attr("id");if(b=="cashtakeout"){startCashTakeOutProcess()}else{if(b=="cashinsert"){startCashInsertProcess()}else{if(b=="cashoverview"){startCashOverviewProcess()}}}})}function startCashInsertProcess(){$("#cashinsertdialog .sure-do").off("click").on("click",function(){$.mobile.changePage("#info-page");var a=$("#moneyToInsert").val().replace($("#info-page").data("decpoint"),".");var b=$("#remarkin").val();if(isNaN(a)){alert("Keine Zahl!")}else{if((parseFloat(a)>=0)&&(parseFloat(a)<=10000)){doCashInsert(a,b)}else{alert("Betrag muss positiv und kleiner als 10000 sein!")}}});$.mobile.changePage("#cashinsertdialog");removeInputValsCashIn()}function removeInputValsCashOut(){setTimeout(function(){$("#moneyToTakeOut").val("");$("#remarkout").val("")},1000)}function removeInputValsCashIn(){setTimeout(function(){$("#moneyToInsert").val("");$("#remarkin").val("")},1000)}function startCashTakeOutProcess(){$("#cashtakeoutdialog .sure-do").off("click").on("click",function(){$.mobile.changePage("#info-page");var a=$("#moneyToTakeOut").val().replace(decpoint,".");var b=$("#remarkout").val();if(isNaN(a)){alert("Keine Zahl!")}else{if((parseFloat(a)>=0)&&(parseFloat(a)<=10000)){doCashTakeOut(a,b)}else{alert("Betrag muss positiv und kleiner als 10000 sein!")}}});$.mobile.changePage("#cashtakeoutdialog");removeInputValsCashOut()}function doCashInsert(a,b){doAjax("POST","php/contenthandler.php?module=bill&command=doCashAction",{money:a,remark:b},handleCashActionResult,"Fehler Kassenaktion")}function doCashTakeOut(a,b){a=0-parseFloat(a);doAjax("POST","php/contenthandler.php?module=bill&command=doCashAction",{money:a,remark:b},handleCashActionResult,"Fehler Kassenaktion")}function startCashOverviewProcess(){doAjax("POST","php/contenthandler.php?module=bill&command=getCashOverviewOfUser",null,showCashOverview,"Fehler Kassenaktion")}function handleCashActionResult(a){if(a.status=="ERROR"){alert("Fehler "+a.code+": "+a.msg)}else{if(a.status=="OK"){alert(P_CASHACTION_OK[lang])}}}function showCashOverview(a){$("#cashbyguests").html((parseFloat(a.guestmoney).toFixed(2)).replace(".",decpoint));$("#cashtotal").html((parseFloat(a.total).toFixed(2)).replace(".",decpoint));$.mobile.changePage("#cashoverviewinfo")}function startDisplayProcess(){var b=location.search;if(b.indexOf("t=")<0){displayAllRooms()}else{var e="";var g=b.split(/&|\?/);for(var a=0;a diff --git a/webapp/php/admin.php b/webapp/php/admin.php index 43c5e8c..0624b49 100644 --- a/webapp/php/admin.php +++ b/webapp/php/admin.php @@ -393,6 +393,15 @@ class Admin { $pdo = DbUtils::openDbAndReturnPdoStatic(); $authenticated = false; + + $isLoginAllowed = self::checkIsLoginAllowed($pdo,$userid); + if (!$isLoginAllowed) { + Logger::logcmd("admin","authentication","Login with id $userid failed"); + echo json_encode(array("status" => "WAIT")); + return; + } + + $sql = "SELECT * FROM %user% WHERE id=? AND active='1'"; $stmt = $pdo->prepare(DbUtils::substTableAlias($sql)); $stmt->execute(array($userid)); @@ -533,14 +542,66 @@ class Admin { if ($authenticated) { Logger::logcmd("admin","authentication","Login $username successful"); + self::clearFailedLogins($pdo, $userid); $loginMessage = $this->getMessage(null,'loginmessage'); echo json_encode(array("status" => "YES","loginmessage" => $loginMessage, "timediff" => $timeDiff, "isadmin" => $zeile['is_admin'],"lang" => $_SESSION["language"])); } else { Logger::logcmd("admin","authentication","Login with id $userid failed"); + self::increaseFailedLogins($pdo,$userid); + echo json_encode(array("status" => "NO")); } } + private static function checkIsLoginAllowed($pdo,$userid) { + date_default_timezone_set(DbUtils::getTimeZone()); + $now = getdate(); + $serverTime = $now["0"]; + + $sql = "SELECT failedlogins FROM %user% WHERE id=?"; + $row = CommonUtils::getRowSqlObject($pdo, $sql, array($userid)); + if (is_null($row) || is_null($row->failedlogins)) { + return true; + } else { + $lastFailure = explode("_",$row->failedlogins)[0]; + $attempt = intval(explode("_",$row->failedlogins)[1]); + + if ($attempt >= 5) { + if (abs($serverTime - $lastFailure) > (60*3)) { + self::clearFailedLogins($pdo, $userid); + return true; + } else { + return false; + } + } else { + return true; + } + } + } + + private static function increaseFailedLogins($pdo,$userid) { + date_default_timezone_set(DbUtils::getTimeZone()); + $now = getdate(); + $serverTime = $now["0"]; + $lastFailure = (string) $serverTime . "_"; + + $sql = "SELECT failedlogins FROM %user% WHERE id=?"; + $row = CommonUtils::getRowSqlObject($pdo, $sql, array($userid)); + if (is_null($row) || is_null($row->failedlogins)) { + $lastFailure .= "1"; + } else { + $attempt = intval(explode("_",$row->failedlogins)[1]); + $lastFailure .= ($attempt + 1); + } + $sql = "UPDATE %user% SET failedlogins=? WHERE id=?"; + CommonUtils::execSql($pdo, $sql, array($lastFailure,$userid)); + } + + private static function clearFailedLogins($pdo,$userid) { + $sql = "UPDATE %user% SET failedlogins=? WHERE id=?"; + CommonUtils::execSql($pdo, $sql, array(null,$userid)); + } + private function getMessage($pdo,$messageType) { if (is_null($pdo)) { $pdo = DbUtils::openDbAndReturnPdoStatic(); @@ -1002,7 +1063,7 @@ class Admin { $view = "preferences.html"; } - echo json_encode($view . "?v=1.3.8"); + echo json_encode($view . "?v=1.3.9"); } } @@ -1204,25 +1265,25 @@ class Admin { if (!self::isOnlyRatingUser($rights, $right_rating, true)) { if ($_SESSION['modus'] == 0) { - if ($_SESSION['right_waiter']) { $mainMenu[] = array("name" => $waitertxt[$lang], "link" => "waiter.html?v=1.3.8"); }; + if ($_SESSION['right_waiter']) { $mainMenu[] = array("name" => $waitertxt[$lang], "link" => "waiter.html?v=1.3.9"); }; } else { - if ($_SESSION['right_waiter']) { $mainMenu[] = array("name" => $waiterdesktxt[$lang], "link" => "waiterdesktop.php?v=1.3.8"); }; + if ($_SESSION['right_waiter']) { $mainMenu[] = array("name" => $waiterdesktxt[$lang], "link" => "waiterdesktop.php?v=1.3.9"); }; } - if ($_SESSION['right_kitchen']) { $mainMenu[] = array("name" => $kitchentxt[$lang], "link" => "kitchen.html?v=1.3.8"); }; - if ($_SESSION['right_bar']) { $mainMenu[] = array("name" => "Bar", "link" => "bar.html?v=1.3.8"); }; - if ($_SESSION['right_supply']) { $mainMenu[] = array("name" => $supplytxt[$lang], "link" => "supplydesk.html?v=1.3.8"); }; + if ($_SESSION['right_kitchen']) { $mainMenu[] = array("name" => $kitchentxt[$lang], "link" => "kitchen.html?v=1.3.9"); }; + if ($_SESSION['right_bar']) { $mainMenu[] = array("name" => "Bar", "link" => "bar.html?v=1.3.9"); }; + if ($_SESSION['right_supply']) { $mainMenu[] = array("name" => $supplytxt[$lang], "link" => "supplydesk.html?v=1.3.9"); }; if ($_SESSION['modus'] == 0) { - if ($_SESSION['right_paydesk']) { $mainMenu[] = array("name" => $paydesktxt[$lang], "link" => "paydesk.html?v=1.3.8"); }; + if ($_SESSION['right_paydesk']) { $mainMenu[] = array("name" => $paydesktxt[$lang], "link" => "paydesk.html?v=1.3.9"); }; } - if ($_SESSION['right_statistics']) { $mainMenu[] = array("name" => $stattxt[$lang], "link" => "reports.html?v=1.3.8"); }; - if ($_SESSION['right_bill']) { $mainMenu[] = array("name" => $bontxt[$lang], "link" => "bill.html?v=1.3.8"); }; - if ($_SESSION['right_products']) { $mainMenu[] = array("name" => $prodtxt[$lang], "link" => "products.html?v=1.3.8"); }; - if ($_SESSION['right_reservation']) { $mainMenu[] = array("name" => $restxt[$lang], "link" => "reservation.html?v=1.3.8"); }; - if ($_SESSION['right_rating']) { $mainMenu[] = array("name" => $ratingtxt[$lang], "link" => "rating.html?v=1.3.8"); }; - if ($_SESSION['right_customers']) { $mainMenu[] = array("name" => $customerstxt[$lang], "link" => "customers.html?v=1.3.8"); }; - if ($_SESSION['right_manager'] || $_SESSION['is_admin'] || $_SESSION['right_closing']) { $mainMenu[] = array("name" => $admintxt[$lang], "link" => "manager.html?v=1.3.8"); }; - $mainMenu[] = array("name" => $settingtxt[$lang], "link" => "preferences.html?v=1.3.8"); - $mainMenu[] = array("name" => "Feedback", "link" => "feedback.html?v=1.3.8"); + if ($_SESSION['right_statistics']) { $mainMenu[] = array("name" => $stattxt[$lang], "link" => "reports.html?v=1.3.9"); }; + if ($_SESSION['right_bill']) { $mainMenu[] = array("name" => $bontxt[$lang], "link" => "bill.html?v=1.3.9"); }; + if ($_SESSION['right_products']) { $mainMenu[] = array("name" => $prodtxt[$lang], "link" => "products.html?v=1.3.9"); }; + if ($_SESSION['right_reservation']) { $mainMenu[] = array("name" => $restxt[$lang], "link" => "reservation.html?v=1.3.9"); }; + if ($_SESSION['right_rating']) { $mainMenu[] = array("name" => $ratingtxt[$lang], "link" => "rating.html?v=1.3.9"); }; + if ($_SESSION['right_customers']) { $mainMenu[] = array("name" => $customerstxt[$lang], "link" => "customers.html?v=1.3.9"); }; + if ($_SESSION['right_manager'] || $_SESSION['is_admin'] || $_SESSION['right_closing']) { $mainMenu[] = array("name" => $admintxt[$lang], "link" => "manager.html?v=1.3.9"); }; + $mainMenu[] = array("name" => $settingtxt[$lang], "link" => "preferences.html?v=1.3.9"); + $mainMenu[] = array("name" => "Feedback", "link" => "feedback.html?v=1.3.9"); } $mainMenu[] = array("name" => $logout[$lang], "link" => "logout.php"); @@ -1230,7 +1291,7 @@ class Admin { $waiterMessage = $this->getMessage(null, "waitermessage"); } - $mainMenuAndVersion = array ("version" => "OrderSprinter 1.3.8", + $mainMenuAndVersion = array ("version" => "OrderSprinter 1.3.9", "user" => $currentUser, "menu" => $mainMenu, "waitermessage" => $waiterMessage, diff --git a/webapp/php/closing.php b/webapp/php/closing.php index e6db29d..a0e3351 100644 --- a/webapp/php/closing.php +++ b/webapp/php/closing.php @@ -67,6 +67,45 @@ $row = $stmt->fetchObject(); return($row->setting); } +private function saveLastClosingCreation($pdo) { +date_default_timezone_set(DbUtils::getTimeZone()); +$date = new DateTime(); +$unixTimeStamp = $date->getTimestamp(); +$sql = "SELECT count(id) as countid FROM %work% WHERE item=?"; +$row = CommonUtils::getRowSqlObject($pdo, $sql, array('lastclosing')); +if ($row->countid == 0) { +$sql = "INSERT INTO %work% (item,value,signature) VALUES(?,?,?)"; +CommonUtils::execSql($pdo, $sql, array('lastclosing', $unixTimeStamp, null)); +} else { +$sql = "UPDATE %work% SET value=? WHERE item=?"; +CommonUtils::execSql($pdo, $sql, array($unixTimeStamp, 'lastclosing')); +} +} + +private function isClosingAllowed($pdo) { +$TIMEOUT = 120; + +$sql = "SELECT count(id) as countid FROM %work% WHERE item=?"; +$row = CommonUtils::getRowSqlObject($pdo, $sql, array('lastclosing')); +if ($row->countid == 0) { +return true; +} else { +$sql = "SELECT value FROM %work% WHERE item=?"; +$row = CommonUtils::getRowSqlObject($pdo, $sql, array('lastclosing')); +$lastaccess = $row->value; + +date_default_timezone_set(DbUtils::getTimeZone()); +$date = new DateTime(); +$currentTimeStamp = $date->getTimestamp(); + +if (($currentTimeStamp - $lastaccess) > $TIMEOUT) { +return true; +} else { +return false; +} +} +} + private function createClosing ($remark) { if (is_null($remark)) { $remark = ""; @@ -80,8 +119,16 @@ date_default_timezone_set(DbUtils::getTimeZone()); $closingTime = date('Y-m-d H:i:s'); $pdo = $this->dbutils->openDbAndReturnPdo(); + +if (!$this->isClosingAllowed($pdo)) { +echo json_encode(array("status" => "ERROR", "msg" => "Time between closings too short", "code" => ERROR_CLOSING_TIME_LIMIT)); +return; +} + $pdo->beginTransaction(); +$this->saveLastClosingCreation($pdo); + if (CommonUtils::callPlugin($pdo, "createClosing", "replace")) { return; } diff --git a/webapp/php/dbutils.php b/webapp/php/dbutils.php index dcb33f4..a8ba667 100644 --- a/webapp/php/dbutils.php +++ b/webapp/php/dbutils.php @@ -175,6 +175,8 @@ class DbUtils { array("col" => 'priceA', "hist" => 1, "property" => "priceA"), array("col" => 'priceB', "hist" => 1, "property" => "priceB"), array("col" => 'priceC', "hist" => 1, "property" => "priceC"), + array("col" => 'unit', "hist" => 1, "property" => "unit"), + array("col" => 'days', "hist" => 1, "property" => "days"), array("col" => 'tax', "hist" => 1, "property" => "tax"), array("col" => 'taxaustria', "hist" => 1, "property" => "taxaustria"), array("col" => 'amount', "hist" => 0, "property" => "amount"), diff --git a/webapp/php/globals.php b/webapp/php/globals.php index 0d49d28..afab1e2 100644 --- a/webapp/php/globals.php +++ b/webapp/php/globals.php @@ -99,4 +99,6 @@ define ( 'ERROR_COMMAND_ERROR', 31); define ( 'ERROR_COMMAND_ERROR_MSG', 'Kommando konnte nicht korrekt ausgeführt werden'); define ( 'ERROR_BILL_CUSTOMER_PAID', '32'); -define ( 'ERROR_BILL_CUSTOMER_PAID_MSG', 'Bon wurde schon von einem Gast bezahlt - siehe Gästeansicht'); \ No newline at end of file +define ( 'ERROR_BILL_CUSTOMER_PAID_MSG', 'Bon wurde schon von einem Gast bezahlt - siehe Gästeansicht'); + +define ( 'ERROR_CLOSING_TIME_LIMIT', 33); \ No newline at end of file diff --git a/webapp/php/products.php b/webapp/php/products.php index 1384510..e319055 100644 --- a/webapp/php/products.php +++ b/webapp/php/products.php @@ -146,15 +146,17 @@ class Products { array("id" => "id","get" => "%products%.id as id","histid" => "prodid","histget" => "prodid","histexportname" => "Produktid","isnumber" => "0"), array("id" => "shortname", "get" => "shortname","histid" => "shortname","histget" => "shortname","histexportname" => "Kurzname","isnumber" => "0"), array("id" => "longname", "get" => "longname","histid" => "longname","histget" => "longname","histexportname" => "Langname","isnumber" => "0"), - array("id" => "available", "get" => "available","histid" => "available","histget" => "available","histexportname" => "","histexportname" => "Verfügbarkeit","isnumber" => "0"), + array("id" => "available", "get" => "available","histid" => "available","histget" => "available","histexportname" => "","histexportname" => "Verfügbarkeit","isnumber" => "0", "exportvals" => array("default" => "Nein","1" => "Ja")), array("id" => "priceA", "get" => "priceA","histid" => "priceA","histget" => "priceA","histexportname" => "Preis (Stufe A)","isnumber" => "1"), array("id" => "priceB", "get" => "priceB","histid" => "priceB","histget" => "priceB","histexportname" => "Preis (Stufe B)","isnumber" => "1"), array("id" => "priceC", "get" => "priceC","histid" => "priceC","histget" => "priceC","histexportname" => "Preis (Stufe C)","isnumber" => "1"), + array("id" => "unit", "get" => "unit","histid" => "unit","histget" => "unit","histexportname" => "Einheit","isnumber" => "0", "exportvals" => array("default" => "Stück","1" => "Preiseingabe bei Bestellung")), + array("id" => "days", "get" => "days","histid" => "days","histget" => "days","histexportname" => "Tage","isnumber" => "0"), array("id" => "tax", "get" => "IF(tax is not null, tax, 'null') as tax","histid" => "tax","histget" => "tax","histexportname" => "Steuer","isnumber" => "1"), array("id" => "taxaustria", "get" => "IF(taxaustria is not null, taxaustria, 'null') as taxaustria","histid" => "","histget" => "","histexportname" => "","isnumber" => "0"), array("id" => "amount", "get" => "IF(amount is not null, amount, 'null') as amount","histid" => "","histget" => "","histexportname" => "","isnumber" => "0"), array("id" => "audio", "get" => "IF(audio is not null, audio, '') as audio","histid" => "","histget" => "","histexportname" => "","isnumber" => "0"), - array("id" => "favorite", "get" => "IF(favorite is not null, favorite, '') as favorite","histid" => "prodid","histget" => "favorite","histexportname" => "Favorit","isnumber" => "0"), + array("id" => "favorite", "get" => "IF(favorite is not null, favorite, '') as favorite","histid" => "prodid","histget" => "favorite","histexportname" => "Favorit","isnumber" => "0", "exportvals" => array("default" => "Nein","1" => "Ja")), array("id" => "type", "get" => "'p' as type","histid" => "","histget" => "","histexportname" => "","isnumber" => "0"), ); @@ -168,6 +170,13 @@ class Products { } private function getAllTypesAndAvailProds() { + date_default_timezone_set(DbUtils::getTimeZone()); + $date = new DateTime(); + $dayofweek = date('N'); + if ($dayofweek == 7) { + $dayofweek = 0; + } + $pdo = DbUtils::openDbAndReturnPdoStatic(); $pdo->beginTransaction(); @@ -197,10 +206,10 @@ class Products { $typeArray[] = array("id" => $row['id'], "name" => $row['name'], "ref" => $ref); } - $sql = "select id,shortname,longname,audio,category as ref,favorite,$priceTxt as price,IF(tax is not null, tax, 'null') as tax,IF(taxaustria is not null, taxaustria, 'null') as taxaustria,IF(amount is not null, amount, 'null') as amount from %products% where available='1' AND removed is null ORDER BY sorting"; - $stmt = $pdo->prepare($this->dbutils->resolveTablenamesInSqlString($sql)); - $stmt->execute(); - $result = $stmt->fetchAll(); + $sql = "select id,shortname,longname,audio,category as ref,favorite,$priceTxt as price,IF(unit is not null, unit, '0') as unit,IF(days is not null, days, '0123456') as days,IF(tax is not null, tax, 'null') as tax,IF(taxaustria is not null, taxaustria, 'null') as taxaustria,IF(amount is not null, amount, 'null') as amount "; + $sql .= " from %products% where available='1' AND removed is null AND (days is null OR days like ?) ORDER BY sorting"; + $result = CommonUtils::fetchSqlAll($pdo, $sql, array("%$dayofweek%")); + $prodArray = array(); foreach($result as $row) { $ref = $row['ref']; @@ -223,7 +232,7 @@ class Products { $stmt->execute(array($row['id'])); $extras = $stmt->fetchAll(PDO::FETCH_OBJ); - $prodArray[] = array("id" => $row['id'], "name" => $row['shortname'], "longname" => $row['longname'], "audio" => $audio, "ref" => $ref, "favorite" => $fav, "price" => $row['price'], "tax" => $row['tax'], "taxaustria" => $row['taxaustria'],"amount" => $row['amount'],"extras" => $extras); + $prodArray[] = array("id" => $row['id'], "name" => $row['shortname'], "longname" => $row['longname'], "audio" => $audio, "ref" => $ref, "favorite" => $fav, "price" => $row['price'], "unit" => $row['unit'],"days" => $row['days'],"tax" => $row['tax'], "taxaustria" => $row['taxaustria'],"amount" => $row['amount'],"extras" => $extras); } $pdo->commit(); @@ -515,10 +524,14 @@ class Products { $value = '-'; } $value = str_replace(".",$decpoint,$value); - } else if ($itemsql == 'available') { - $value = ($zeile['available'] == '1' ? "Ja" : "Nein"); - } else if ($itemsql == 'favorite') { - $value = ($zeile['favorite'] == '1' ? "Ja" : "Nein"); + } else if (isset($aProdDef["exportvals"])) { + $exportvals = $aProdDef["exportvals"]; + $value = $zeile[$itemsql]; + if (isset($exportvals[$value])) { + $value = $exportvals[$value]; + } else { + $value = $exportvals["default"]; + } } else { $isNumber = $aProdDef["isnumber"]; $value = $zeile[$aProdDef["histget"]]; @@ -537,7 +550,7 @@ class Products { function getSingleProdData($pdo,$id) { if (is_numeric($id)) { - $sql = "SELECT id,shortname,longname,priceA,priceB,priceC,IF(tax is not null, tax, 'null') as tax,available,audio,favorite from %products% where id=?"; + $sql = "SELECT id,shortname,longname,priceA,priceB,priceC,IF(unit is not null, unit, '0') as unit,IF(days is not null, days, '0123456') as days,IF(tax is not null, tax, 'null') as tax,available,audio,favorite from %products% where id=?"; $stmt = $pdo->prepare(DbUtils::substTableAlias($sql)); $stmt->execute(array($id)); diff --git a/webapp/php/updater.php b/webapp/php/updater.php index d24c1cb..6bdbc8d 100644 --- a/webapp/php/updater.php +++ b/webapp/php/updater.php @@ -117,11 +117,44 @@ class Updater { $infoFileLines = $infoFile["msg"]; if (count($infoFileLines) > 1) { - return array("status" => "OK","msg" => $infoFileLines[0],"url" => $url); + $checkIfNewerVersion = self::isV2Newer('1.3.9',trim($infoFileLines[0])); + return array("status" => "OK","msg" => $infoFileLines[0],"url" => $url,"neweravailable" => ($checkIfNewerVersion ? 1 : 0)); } else { return array("status" => "ERROR","msg" => "Info file not valid","url" => $url); } } + + private static function isV2Newer($v1,$v2) { + if (is_null($v1) || is_null($v2)) { + return false; + } + $v1key = self::genVerKey($v1); + $v2key = self::genVerKey($v2); + + if (is_null($v1key) || is_null($v2key)) { + return false; + } + + if ($v1key < $v2key) { + return true; + } else { + return false; + } + } + + private static function genVerKey($v) { + $vparts = split("\.",$v); + $len = count($vparts); + $key = 0; + try { + for ($i=0;$i<$len;$i++) { + $key += intval($vparts[$i]) * pow(1000,2-$i); + } + return $key; + } catch (Exception $e) { + return null; + } + } private static function doCheck($lineArr) { diff --git a/webapp/php/utilities/TypeAndProducts/ProductEntry.php b/webapp/php/utilities/TypeAndProducts/ProductEntry.php index 344ad6a..523dd9b 100644 --- a/webapp/php/utilities/TypeAndProducts/ProductEntry.php +++ b/webapp/php/utilities/TypeAndProducts/ProductEntry.php @@ -15,6 +15,8 @@ class ProductEntry { private $favorite = ""; private $audio = ""; private $category = null; + private $unit = null; + private $days = null; private static $PRICE_B = "PreisB"; private static $PRICE_C = "PreisC"; @@ -23,6 +25,8 @@ class ProductEntry { private static $AMOUNT = "Menge"; private static $SHORTNAME = "Kurzname"; private static $AVAILABLE = "vorhanden"; + private static $UNIT = "Einheit"; + private static $DAYS = "Tage"; private static $ID = "ID"; @@ -52,6 +56,16 @@ class ProductEntry { if (!is_numeric($this->priceC)) { $this->priceC = 0.00; } + if (!is_numeric($this->unit)) { + $this->unit = null; + } else { + if ($this->unit == 0) { + $this->unit = null; + } + } + if (is_null($this->days) || ($this->days == "")) { + $this->days = '0123456'; + } if ($this->tax == "null") { $this->tax = null; } @@ -67,17 +81,23 @@ class ProductEntry { } public function createProductInDb($pdo) { - $sql = "INSERT INTO `%products%` (`id`, `shortname`, `longname`, `priceA`, `priceB`, `priceC`, `tax`, `taxaustria`,`amount`,`category`,`favorite`,`available`,`audio`) VALUES (NULL,?,?,?,?,?,?,?,?,?,?,?,?)"; + $sql = "INSERT INTO `%products%` (`id`,`shortname`,`longname`,`priceA`,`priceB`,`priceC`,`unit`,`days`,`tax`,`taxaustria`,`amount`,`category`,`favorite`,`available`,`audio`) VALUES (NULL,?,?,?,?,?,?,?,?,?,?,?,?,?,?)"; $stmt = $pdo->prepare(DbUtils::substTableAlias($sql)); - $stmt->execute(array($this->shortName,$this->longName,$this->priceA,$this->priceB,$this->priceC,$this->tax,$this->taxaustria,$this->amount,$this->category,$this->favorite,$this->available,$this->audio)); + if ($this->days == '0123456') { + $this->days = null; + } + $stmt->execute(array($this->shortName,$this->longName,$this->priceA,$this->priceB,$this->priceC,$this->unit,$this->days,$this->tax,$this->taxaustria,$this->amount,$this->category,$this->favorite,$this->available,$this->audio)); return ($pdo->lastInsertId()); } public function applyProductInDb($pdo) { - $updateSql = "UPDATE %products% SET shortname=?, longname=?, priceA=?, priceB=?, priceC=?, tax=?, taxaustria=?, amount=?,available=?, audio=?, favorite=? WHERE id=?"; + $updateSql = "UPDATE %products% SET shortname=?, longname=?, priceA=?, priceB=?, priceC=?, unit=?, days=?, tax=?, taxaustria=?, amount=?,available=?, audio=?, favorite=? WHERE id=?"; $stmt = $pdo->prepare(DbUtils::substTableAlias($updateSql)); - $stmt->execute(array($this->shortName,$this->longName,$this->priceA,$this->priceB,$this->priceC,$this->tax,$this->taxaustria,$this->amount,$this->available,$this->audio,$this->favorite,$this->prodid)); + if ($this->days == '0123456') { + $this->days = null; + } + $stmt->execute(array($this->shortName,$this->longName,$this->priceA,$this->priceB,$this->priceC,$this->unit,$this->days,$this->tax,$this->taxaustria,$this->amount,$this->available,$this->audio,$this->favorite,$this->prodid)); } // @@ -91,6 +111,8 @@ class ProductEntry { $priceA = str_replace('.', $decpoint, $aProd['priceA']); $priceB = str_replace('.', $decpoint, $aProd['priceB']); $priceC = str_replace('.', $decpoint, $aProd['priceC']); + $unit = $aProd['unit']; + $days = $aProd['days']; $tax = str_replace('.', $decpoint, $aProd['tax']); $taxaustria = $aProd['taxaustria']; $amount = $aProd['amount']; @@ -122,6 +144,17 @@ class ProductEntry { if ($available == 0) { $extArr[] = self::$AVAILABLE . ":nein"; } + + if (!is_null($unit)) { + if ($unit == 1) { + $extArr[] = self::$UNIT . ":Eingabe"; + } + } + + if (!is_null($days)) { + $extArr[] = self::$DAYS . ":$days"; + } + if (!is_null($prodId)) { $extArr[] = self::$ID . ":" . $prodId; } @@ -145,6 +178,8 @@ class ProductEntry { $this->priceB = null; $this->priceC = null; + $this->unit = null; + $this->days = null; $this->shortName = null; $this->taxaustria = 0; @@ -169,6 +204,14 @@ class ProductEntry { } else { $this->available = 0; } + } else if ($identifier == self::$UNIT) { + if ($value == "Stück") { + $this->unit = null; + } else if ($value == "Eingabe") { + $this->unit = 1; + } + } else if ($identifier == self::$DAYS) { + $this->days = $value; } else if ($identifier == self::$TAX) { $this->tax = floatval(str_replace(",",".",(string) $value)); } else if ($identifier == self::$SHORTNAME) { @@ -216,7 +259,14 @@ class ProductEntry { function getPriceC() { return $this->priceC; } + + function getUnit() { + return $this->unit; + } + function getDays() { + return $this->days; + } function getTax() { return $this->tax; } diff --git a/webapp/php/utilities/TypeAndProducts/TypeAndProductFileManager.php b/webapp/php/utilities/TypeAndProducts/TypeAndProductFileManager.php index 1864d06..32436d9 100644 --- a/webapp/php/utilities/TypeAndProducts/TypeAndProductFileManager.php +++ b/webapp/php/utilities/TypeAndProducts/TypeAndProductFileManager.php @@ -351,6 +351,8 @@ class TypeAndProductFileManager { $priceA = $product->getPriceA(); $priceB = $product->getPriceB(); $priceC = $product->getPriceC(); + $unit = $product->getUnit(); + $days = $product->getDays(); $tax = $product->getTax(); $taxaustria = trim($product->getTaxAustria()); if (($taxaustria == "") || ($taxaustria == 0)) { @@ -387,15 +389,15 @@ class TypeAndProductFileManager { } } if ($isNewProd) { - $sql = "INSERT INTO `%products%` (`id`, `shortname`, `longname`, `priceA`, `priceB`, `priceC`, `tax`, `taxaustria`, `amount`, `category`,`available`,`favorite`,`sorting`) VALUES (NULL,"; - $sql = $sql . "?,?,?,?,?,?,?,?,?,?,?,?)"; + $sql = "INSERT INTO `%products%` (`id`, `shortname`, `longname`, `priceA`, `priceB`, `priceC`, `unit`,`days`, `tax`, `taxaustria`, `amount`, `category`,`available`,`favorite`,`sorting`) VALUES (NULL,"; + $sql = $sql . "?,?,?,?,?,?,?,?,?,?,?,?,?,?)"; $stmt = $pdo->prepare(DbUtils::substTableAlias($sql)); - $stmt->execute(array($shortName,$longName,$priceA,$priceB,$priceC,$tax, $taxaustria, $amount, $category,$available,$favorite,$sorting)); + $stmt->execute(array($shortName,$longName,$priceA,$priceB,$priceC,$unit,$days,$tax, $taxaustria, $amount, $category,$available,$favorite,$sorting)); $prodid = $pdo->lastInsertId(); HistFiller::createProdInHist($pdo, $prodid); } else { - $sql = "SELECT shortname,longname,priceA,priceB,priceC,tax,taxaustria,amount,available,category FROM %products% WHERE id=?"; + $sql = "SELECT shortname,longname,priceA,priceB,priceC,unit,days,tax,taxaustria,amount,available,category FROM %products% WHERE id=?"; $stmt = $pdo->prepare(DbUtils::substTableAlias($sql)); $stmt->execute(array($prodid)); $row = $stmt->fetchObject(); @@ -405,15 +407,17 @@ class TypeAndProductFileManager { || ($row->priceA != $priceA) || ($row->priceB != $priceB) || ($row->priceC != $priceC) + || ($row->unit != $unit) + || ($row->days != $days) || ($row->available != $available) || ($row->tax != $tax) || ($row->taxaustria != $taxaustria) || ($row->amount != $amount)); if ($changed) { - $sql = "UPDATE %products% SET shortname=?,longname=?,priceA=?,priceB=?,priceC=?,tax=?,taxaustria=?,amount=?,available=?,sorting=? WHERE id=?"; + $sql = "UPDATE %products% SET shortname=?,longname=?,priceA=?,priceB=?,priceC=?,unit=?,days=?,tax=?,taxaustria=?,amount=?,available=?,sorting=? WHERE id=?"; $stmt = $pdo->prepare(DbUtils::substTableAlias($sql)); - $stmt->execute(array($shortName,$longName,$priceA,$priceB,$priceC,$tax,$taxaustria,$amount,$available,$sorting,$prodid)); + $stmt->execute(array($shortName,$longName,$priceA,$priceB,$priceC,$unit,$days,$tax,$taxaustria,$amount,$available,$sorting,$prodid)); HistFiller::updateProdInHist($pdo, $prodid); } else { $sql = "UPDATE %products% SET sorting=? WHERE id=?"; diff --git a/webapp/php/utilities/basedb.php b/webapp/php/utilities/basedb.php index 526575d..a0af21f 100644 --- a/webapp/php/utilities/basedb.php +++ b/webapp/php/utilities/basedb.php @@ -216,6 +216,7 @@ class Basedb { `prefertablemap` INT(1) NULL, `keeptypelevel` INT(1) NOT NULL, `extrasapplybtnpos` INT(1) NOT NULL, + `failedlogins` VARCHAR(20) NULL, `active` INT (2) NOT NULL ) CHARACTER SET utf8 COLLATE utf8_general_ci ENGINE = InnoDb ; "; @@ -377,6 +378,8 @@ class Basedb { `priceA` " . DECIMALSMALL . " NULL, `priceB` " . DECIMALSMALL . " NULL, `priceC` " .DECIMALSMALL . " NULL, + `unit` INT(2) NULL, + `days` VARCHAR(20) NULL, `tax` " . DECIMALSMALL . " NULL, `taxaustria` INT(1) NULL, `amount` INT(5) NULL, @@ -611,6 +614,8 @@ class Basedb { `priceA` " . DECIMALSMALL . " NULL, `priceB` " . DECIMALSMALL . " NULL, `priceC` " . DECIMALSMALL . " NULL, + `unit` INT(2) NULL, + `days` VARCHAR(20) NULL, `tax` " . DECIMALSMALL . " NULL, `taxaustria` INT(1) NULL, `sorting` INT(2) NULL, diff --git a/webapp/php/utilities/pdfexport.php b/webapp/php/utilities/pdfexport.php index c23dc2f..78f22c0 100644 --- a/webapp/php/utilities/pdfexport.php +++ b/webapp/php/utilities/pdfexport.php @@ -187,7 +187,10 @@ class PdfExport extends FPDF { $host = ($zeile['host'] == 1 ? "x" : "-"); if (!$commonUtils->verifyBillByValues(null,$billdate, $brutto_orig, $netto_orig, $tax_orig, $userid, $signature)) { - echo "Database is inconsistent!"; + echo "Database is inconsistent! Bill $billid "; + if ($zeile['status'] == "c") { + echo '- a cash operation ("Bareinlage/Barauslage"). '; + } return null; } diff --git a/webapp/preferences.html b/webapp/preferences.html index 90aa613..a8aa749 100644 --- a/webapp/preferences.html +++ b/webapp/preferences.html @@ -5,7 +5,7 @@ - + diff --git a/webapp/products.html b/webapp/products.html index 0179369..add1555 100644 --- a/webapp/products.html +++ b/webapp/products.html @@ -7,7 +7,7 @@ - + @@ -28,6 +28,8 @@ var PROD_NO = ["Nein","No","No"]; var PROD_NEW_PROD = ["Neues Produkt","New product","Nuevo producto"]; var PROD_NO_TONE = ["Kein Ton","No audio","Ningún sonido"]; var PROD_PRICE = ["Preis","Price","Precio"]; +var PROD_UNIT = ["Einheit","Unit","Unidad"]; +var PROD_DAYS = ["Tage","Days","Dias"]; var PROD_TAX = ["Steuersatz immer","Tax always","Impuesto siempre"]; var PROD_TAXAUSTRIA = ["Steuersatz Österreich","Tax Austria","Impuesto Austria"]; var PROD_AMOUNT = ["Verfügbare Menge","Available amount","Cuanto hay"]; @@ -163,13 +165,21 @@ function setLanguage(language) { var i=0; for (i=0;i - + diff --git a/webapp/reports.html b/webapp/reports.html index 766d787..fd9b6b4 100644 --- a/webapp/reports.html +++ b/webapp/reports.html @@ -7,7 +7,7 @@ - + diff --git a/webapp/reservation.html b/webapp/reservation.html index 1695b65..177d3c3 100644 --- a/webapp/reservation.html +++ b/webapp/reservation.html @@ -5,7 +5,7 @@ - + diff --git a/webapp/supplydesk.html b/webapp/supplydesk.html index 7194c47..c47704c 100644 --- a/webapp/supplydesk.html +++ b/webapp/supplydesk.html @@ -5,7 +5,7 @@ - + diff --git a/webapp/utilities.js b/webapp/utilities.js index dc08232..81409e5 100644 --- a/webapp/utilities.js +++ b/webapp/utilities.js @@ -200,6 +200,10 @@ function isInt(value) { } } +function isFloat(n){ + return Number(n) === n && n % 1 !== 0; +} + function getMillis() { var d = new Date(); var n = d.getTime(); diff --git a/webapp/waiter.html b/webapp/waiter.html index 6e5183c..8d95357 100644 --- a/webapp/waiter.html +++ b/webapp/waiter.html @@ -4,7 +4,8 @@ - + + @@ -23,7 +24,7 @@ } @media print { - #waiterui,#thefooter3,#header3,#info-page,#tables-page,#modulemenu-room,#modulemenu-table,#modulemenu-prod,#discard_new_orders_no,#searchField,#searchResult {display: none;} + #waiterui,#thefooter3,#header3,#info-page,#tables-page,#modulemenu-room,#modulemenu-table,#modulemenu-prod,#discard_new_orders_no,#discard_priceenter,#discard_new_orders_yes,#enterpricefield,#enterpriceheader,#enterpricedlg,#searchField,#searchResult {display: none;} } @media print { @@ -32,7 +33,7 @@ +var W_TABLES=["Tische","Tables","Mesas"];var W_ATABLE=["Tisch","Table","Mesa"];var W_ROOMS=["Räume","Rooms","Espacios"];var W_SELECTION=["Auswahl","Selection","Selección"];var W_LAST_SELECTED=["zuletzt","last","seleccionado"];var W_FAVS=["Favoriten","Favorites","Favoritos"];var W_NEW_ORDER=["Neue Order","New Orders","Ordenes nuevas"];var W_KIT_BAR=["nicht serviert/unbezahlt","unserved/unpaid","no servido/impagado"];var W_OTHER_PROD=["Auswahl Produktkategorie","Select product categroy","Categoría diferente"];var W_WORK_TICKET=["Arbeitsbon","Work ticket","Tique de trabajar"];var W_NOTE=["Bemerkung","Comment","Comentario"];var W_SEND_ORDERS=["Bestellung senden","Send orders","Enviar Ordenes"];var W_TO_PAYDESK=["-> Kasse","-> Paydesk","-> Caja"];var W_TABLECHANGE=["Tischwechsel","Change table","Cambiar mesa"];var W_ROOMTABLE=["Raum-Tisch","Room-Table","Espacio-Mesa"];var W_TABLE_SEL=["Tischauswahl","Select table","Qué mesa?"];var W_UNDELIV_INFO=["Liste enthält die Produkte die noch in der Küchen-/Baransicht sind, sowie unbezahlte Produkte, die die Bereitstellungsansicht nicht durchlaufen.","List contains the products which are still in kitchen or bar view, as well as unpaid products that do not pass the supplydesk view.","La lista contiene los productos que estan todavía en modulo de cocina/bar, también productos impagados que no pasan vista de productos preparados."];var W_REMOVE_ERROR=["Ansicht nicht mehr aktuell - Liste wird neu geladen.","View is obsolete - List will be reloaded.","Vista no esta actual - vamos a actualisar la lista."];var W_FOOD_FOR=["Speisen für","Food for","Comidas para"];var W_DRINKS_FOR=["Getränke für","Beverage for","Bebidas para"];var W_ACT_NEW_ORD_EL=["Aktion auswählen","Select action","Que acción?"];var W_ACT_CHANGE=["Ändern","Modify","Modificar"];var W_ACT_CHANGE_ALL=["Alle Ändern","Modify all","Modificar todo"];var W_ACT_CHANGE_ONE=["Einen Artikel ändern","Modify one item","Modificar un artículo"];var W_APPLY=["Anwenden","Apply","Aplicar"];var W_CANCEL=["Abbrechen","Cancel","Cancelar"];var W_STILL_UNSENT_ORDERS=["Es sind noch ungesendete Orders vorhanden!","There are unsent orders in the list","Hay elementos in la liste que no han enviados"];var W_EXTRAS=["Extras/Optionen","Add-ons/Options","Opciones"];var W_OPEN_PANEL=["Extras-Auswahl noch offen","Add-ons selection still open","Selección de opciones todavía abierta"];var W_DEL=["Löschen","Delete","Removar"];var W_MSG=["Nachricht","Message","Mensaje"];var W_CHANGE_PRICE=["Neuer Preis: ","New price: ","Cambiar precio: "];var W_PRICE=["Preis","Price","Precio"];var W_WRONG_FORMAT=["Falsches Zahlenformat","Wrong number format","Formato de precio incorecto"];var W_TOGO=["Außer-Haus-Verkauf","Sale with Tax No 2","Venta IVA 2"];var W_YES=["Ja","Yes","Si"];var W_NO=["Nein","No","No"];var W_DISCARD_NO_ASK=["Es sind noch ungesendete Orders vorhanden! Sollen diese verworfen werden?","There are still unsent orders. Do you want to discard them?","Hay todavía ordenes non-enviados. Removarlos?"];var W_DISCARD_HEADER=["Neue Orders verwerfen?","Discard new orders?","Removar ordenes nuevos?"];var W_SEARCH=["Produktsuche","Product search","Buscar producto"];var W_SEARCHRESULTS=["Suchergebnis","Search Result","Encontrado"];var W_WRONG_PIN=["Falscher Stornocode","Wrong cancel code","Codigo falso"];var W_NO_ORDERS=["Keine gebuchten Orders vorhanden!","No orders available!","No hay ningún orden!"];var W_TO_PAY=["offen","to pay","a pagar"];var W_MOVE_PRODS=["Produkte verschieben","Move products","Productos a otra mesa"];var W_NO_PRODS_SELECTED=["Es wurden keine Produkte ausgewählt!","You have not chosen any products!","No ha seleccionado ningún producto!"];var W_MAX_PRICE_EXCEEDED=["Der Maximalwert für den Preis wurde überschritten!","The max. value for the price is exceeded!","El valor del precio es más que el maximum!"];var W_REORDER=["Nachbestellen","Reorder","Order una vez mas"];var W_REMOVE=["Entfernen","Remove","Removar"];var W_SELALL=["Alles auswählen","Select all","Elegir todo"];var W_UNSELALL=["Alles abwählen","Unselect all","No elegir nada"];var W_ONLY=["noch","only","sólo"];var W_DEL_ALL_UNDELIVERED=["Entferne alles","Remove all","Borrar todo"];var W_DEL_ALL_ASSIGNED_PRODS=["Alle Produkte löschen?","Delete all products?","Removar todos los productos?"];var W_NO_VALID_PRICE=["Keine gültige Preiseingabe","No valid price","Precio no valido"];var W_NO_REORDER_VAR_PRICE=["Produkt mit variablem Preis kann nicht auf diese Weise nachbestellt werden.","Produkt with variable price cannot be reordered this way.","Producto con un precio variable no se puede reordenado asi."];var CHANGE_ALL=0;var CHANGE_ONE=1;var WORKFLOW_DIGI_WORK=0;var WORKFLOW_DIGI=1;var WORKFLOW_WORK=2;var WORKFLOW_WORK_SEND=3;function Grouping(b,a){this.set=b;this.sortedset=[];this.group=function(){this.sortedset=[];for(var g=0;g/g,">"))}function setLanguage(h){lang=h;$("#roomtableheader2").html(W_ROOMTABLE[lang]);$("#tableselection").html(W_TABLE_SEL[lang]);$("#actiontxt").html(W_ACT_NEW_ORD_EL[lang]);$("#actdeltxt").html(W_DEL[lang]);$("#discard_new_orders_yes").html(W_YES[lang]);$("#discard_new_orders_no").html(W_NO[lang]);$("#discardnewordersask").html(W_DISCARD_NO_ASK[lang]);$("#discardnoheader").html(W_DISCARD_HEADER[lang]);$("#moveprods").html(W_MOVE_PRODS[lang]);var f="";if(prominentsearch==0){f+='
    '}else{f+='
    '}f+="
    ";var e='
    ';if(prominentsearch==0){$("#searchposition-normal").html(f)}else{$("#searchposition-prominent").html(f)}var b=e;if((workflowconfig==WORKFLOW_DIGI_WORK)||(workflowconfig==WORKFLOW_DIGI)||(workflowconfig==WORKFLOW_WORK_SEND)){b+=''+W_SEND_ORDERS[lang]+""}if((workflowconfig==WORKFLOW_DIGI_WORK)||(workflowconfig==WORKFLOW_WORK)||(workflowconfig==WORKFLOW_WORK_SEND)){b+=''+W_WORK_TICKET[lang]+""}if(cashenabled==1){b+=''+W_TO_PAYDESK[lang]+""}b+='';$("#commandbuttons").html(b);$("#waiterui").trigger("create");var c='
    ';$("#actremark").html(c);if(rightchangeprice==1){var a='';$("#actchangepricesection").html(a);var g='
    ';g+=getDiscountButton("discount1","a",discount1,discountname1);g+=getDiscountButton("discount2","b",discount2,discountname2);g+=getDiscountButton("discount3","c",discount3,discountname3);g+="
    ";$("#actdiscount").html(g)}$("#actionneworderconfirm_all").html(W_ACT_CHANGE_ALL[lang]);$("#actionneworderconfirm_one").html(W_ACT_CHANGE_ONE[lang]);$("#actionnewordercancel").html(W_CANCEL[lang]);$("#select-comment").off("click").on("click",function(k){k.stopImmediatePropagation();k.preventDefault();var i=$("#select-comment").find(":selected").val();$("#optionfield").val(i)});$("#act-select-comment").off("click").on("click",function(k){k.stopImmediatePropagation();k.preventDefault();var i=$("#act-select-comment").find(":selected").val();$("#act-optionfield").val(i)});$("#discard_new_orders_no").off("click").on("click",function(i){i.stopImmediatePropagation();i.preventDefault();parent.history.back()});$("#discard_priceenter").off("click").on("click",function(i){i.stopImmediatePropagation();i.preventDefault();$("#enterpricedlg").dialog("close")});$("#discard_new_orders_yes").off("click").on("click",function(i){i.stopImmediatePropagation();i.preventDefault();neworders=[];gotoOtherPage($("#discardnewordersdlg").data("link"))});$("#prodbackbtn").off("click").on("click",function(i){if(neworders.length!=0){i.stopImmediatePropagation();i.preventDefault();hideMenuProd();$("#discardnewordersdlg").data("link","back_table");$.mobile.changePage("#discardnewordersdlg")}else{parent.history.back()}});$("#searchField").off("keyup").on("keyup",function(i){generateSearchResults()})}function getDiscountButton(f,e,c,a){var b='";if(a.trim()!=""){b='"}return b}function generateSearchResults(){var e=$("#searchField").val().trim().toLowerCase();if(e.length<3){$("#searchResult").html("")}else{var c=getProdSizeClass();var b='";$("#searchResult").html(b);$("#searchResult").trigger("create");$(".srinfo").off("click").on("click",function(i){i.stopImmediatePropagation();i.preventDefault();var f=this.id.split("_")[1];var h=getProdEntry(f);var g=h.price;alert(W_PRICE[lang]+": "+g+" "+currency)});$(".srplus").off("click").on("click",function(h){h.stopImmediatePropagation();h.preventDefault();var g=this.id.split("_")[1];var f=getSearchProdCount(g);$("#srprodcount_"+g).html(f+1)});$(".srminus").off("click").on("click",function(h){h.stopImmediatePropagation();h.preventDefault();var g=this.id.split("_")[1];var f=getSearchProdCount(g);if(f==2){$("#srprodcount_"+g).html("");selectedProdCount=1}else{if(f>2){$("#srprodcount_"+g).html(f-1)}}});$(".searchresult").off("click").on("click",function(g){g.stopImmediatePropagation();g.preventDefault();favOrSearchWasClicked=true;var f=this.id.split("_")[1];selectedProdCount=getSearchProdCount(f);clearSearchAndGoToHigherTypeIfExtrasOpen();levelOneType=0;handleClickOnProd(f)})}}function fillGenCommentsList(f){if(f.status!="OK"){alert("Fehler "+f.code+": "+f.msg);return}var b='';var e=f.msg;var c=0;for(c=0;c'+a+""}htmlComments=b;predefinedComments=b;$("#select-comment").html(b);$("#select-comment").selectmenu("refresh")}function initializeMainMenu(a,h,e,i,g){$("#"+e).html(" "+a.user);$("#"+i).html(a.version+" ");var k='
  • Module
  • ';$.each(a.menu,function(n,m){var l=m.name;var o=m.link;if(g){k+='
  • '+l+"
  • "}else{k+='
  • '+l+"
  • "}});$(h).empty().append(k).promise().done(function(){refreshList(h)});if(h=="#modulemenu-room"){var c=a.waitermessage;if(c!=""){$("#waitermessage").show();var b='
  • '+W_MSG[lang]+"
  • ";var f='
  • '+toHtml(c)+"
  • ";$("#waitermessage").html(b+f);refreshList("#waitermessage")}else{$("#waitermessage").hide()}}$(".modulebutton").off("click").on("click",function(m){var l=$(this).attr("href");doJsonAjaxAsync("POST","php/contenthandler.php?module=admin&command=setLastModuleOfUser",{view:l},null,"Problem Benutzerdatenpflege",false)})}function refreshList(a){if($(a).hasClass("ui-listview")){$(a).listview("refresh")}else{$(a).trigger("create")}}function gotoOtherPage(a){var b=a.split("_");if(b[0]=="menu"){doJsonAjax("POST","php/contenthandler.php?module=admin&command=setLastModuleOfUser",{view:b[1]},null,null);setTimeout(function(){document.location.href=b[1]},250)}else{if(b[0]=="back"){$("#discardnewordersdlg").dialog("close");parent.history.back()}}}function moduleForward(a){if(neworders.length==0){gotoOtherPage(a)}else{hideMenuProd();$("#discardnewordersdlg").data("link",a);$.mobile.changePage("#discardnewordersdlg")}}function getPayPrintType(){doJsonAjax("GET","php/contenthandler.php?module=admin&command=getPayPrintType",null,insertPayPrintType,"Fehler Druckkonfiguration")}function insertPayPrintType(a){$("#workprintarea").data("payPrintType",a)}function getUserHasRightForPaydesk(){doJsonAjax("GET","php/contenthandler.php?module=admin&command=hasUserPaydeskRight",null,hasUserPaydeskRight,"Fehler Kassenberechtigung")}function hasUserPaydeskRight(a){$("#gopaydesk_btn").data("allowed",a)}function hideMenuRoom(){$("#modulepanel-room").panel("close");$("#menuswitch").off("click").on("click",function(a){a.stopImmediatePropagation();a.preventDefault();$("#modulepanel-room").panel("open")})}function hideMenuTable(){$("#modulepanel-table").panel("close");$("#menuswitchtable").off("click").on("click",function(a){a.stopImmediatePropagation();a.preventDefault();$("#modulepanel-table").panel("open")})}function hideMenuProd(){$("#modulepanel-prod").panel("close");$("#menuswitchprod").off("click").on("click",function(a){a.stopImmediatePropagation();a.preventDefault();$("#modulepanel-prod").panel("open")})}function calcTotalPriceOfProdAndExtras(b,e){var a=parseFloat(b);if(e!=null){for(var c=0;c";var l=groupedNewOrders.count.length;for(f=0;f1){k=""+g.toString()+"x "+k}var e=groupedNewOrders.prodids[f];if(h!=""){h="

    "+toHtml(h)+"

    "}var b=groupedNewOrders.changedPrices[f];var a=groupedNewOrders.togos[f];var n="";var c=groupedNewOrders.extras[f];if((c!=null)&&(c!="")){n=""+c+""}if(b!="NO"){b=b.replace(".",decpoint);if(a!=0){m+='
  • '+k+h+n+" ("+b+" - To-Go)
  • "}else{m+='
  • '+k+h+n+" ("+b+")
  • "}}else{if(a!=0){m+='
  • '+k+h+n+" - To-Go
  • "}else{m+='
  • '+k+h+n+"
  • "}}}$("#neworders").html(m);refreshList("#neworders");binding_neworderelem()}function getProdSizeClass(){if(osprodbtnsize==1){return("osprod-1")}else{if(osprodbtnsize==2){return("osprod-2")}}return""}function binding_neworderelem(){$(".neworder_el").off("click").on("click",function(c){c.stopImmediatePropagation();c.preventDefault();var b=$("#neworders li").index($(this).closest("li"))-1;var a={count:groupedNewOrders.count[b],name:groupedNewOrders.name[b],price:groupedNewOrders.price[b],option:groupedNewOrders.option[b],extras:groupedNewOrders.extras[b],prodid:groupedNewOrders.prodids[b],origidxs:groupedNewOrders.origidxs[b],changedPrices:groupedNewOrders.changedPrices[b],togos:groupedNewOrders.togos[b]};$("#actiononneworderel").data("entry",a);$("#actiononneworderel").data("newcount",a.count);$("#actiononneworderel").data("groupedListIndex",b);$("#act-optionfield").val(a.option);$("#togocheckbox").prop("checked",a.togos==1?true:false);actionSelOnNewOrderElem()})}function sendNewOrders(c,f,a){var g=$("#typprodpage").data("table-info");var b=g[1];if(neworders.length!=0){var e={tableid:b,prods:neworders,print:(c?1:0),payprinttype:f};$("#typprodpage").data("neworders",[]);if(f=="s"){doJsonAjax("POST","php/contenthandler.php?module=queue&command=addProductListToQueue",e,a,"Fehler bei Produktversand")}else{doJsonAjax("POST","php/contenthandler.php?module=queue&command=addProductListToQueue",e,fillPrintAreaAndPrint,"Fehler bei Produktversand")}}else{if(c&¬DeliveredProdsAvailable){}}}function reloadPage(){tableListActive=false;setTimeout(function(){document.location.href="waiter.html"},250)}function gotoTablePage(){var a=$("#tables-page").data("allroomtables");var b=a.length;if(!isTogoOrderSelected||(b==1)){$.mobile.changePage("#tables-page")}else{reloadPage()}}function removeProductFromQueue(a,c,f,e,b,g){if(typeof g==="undefined"){g=true}if(!b){alert(W_WRONG_PIN[lang]);return}$.ajax({type:"POST",dataType:"json",url:"php/contenthandler.php?module=queue&command=removeProductFromQueue",data:{queueid:a,isPaid:c,isCooking:f,isReady:e},async:false,success:function(l){if(l.status!="OK"){alert(W_REMOVE_ERROR[lang])}var k=$("#typprodpage").data("table-info");var h=k[1];var i="php/contenthandler.php?module=queue&command=getJsonLongNamesOfProdsForTableNotDelivered&tableid="+h;if(g){fillNotDeliveredProductsOfATable(i)}},error:function(h){alert("Sorry, Fehler bei Produktentfernung!")}})}function reorderProduct(f,b,g){var a=getProdProperties(f);if(a.unit!=0){alert(W_NO_REORDER_VAR_PRICE[lang]);return}var e=[];for(var c=0;c'+k.name+""});a+='
  • '+W_TOGO[lang];var f=h.takeawayprice;var c=f.replace(".",decpoint)+" "+currency;if(f!=0){a+=" ("+W_TO_PAY[lang]+": "+c+")"}a+=createServeInfo(null,h.takeawayprodcount,h.takeawayprodready);a+="
  • ";$("#room-list").append(a).promise().done(function(){bindTogoOrdering();bindServeClick();$(this).off("click").on("click","a",function(l){l.stopImmediatePropagation();l.preventDefault();var k=b[this.id];currentRoomIndex=this.id;isTogoOrderSelected=false;$("#tables-page").data("roomdetail",k);nextPage="tables-page";$.mobile.changePage("#tables-page")});refreshList(this)})}})}function handleClickInTablemap(a){forwardDisplayToProductView.call(this,a.roomid,a.tableid,a.tablename)}$(document).on("pagebeforeshow","#tables-page",function(){lastSelectedProduct="";tableListActive=true;if(nextPage==""){reloadPage()}hideMenuTable();checkForLogIn();$("#searchField").val("");generateSearchResults();$("#tableselbackbtn").off("click").on("click",function(a){a.stopImmediatePropagation();a.preventDefault();tableListActive=false;$.mobile.changePage("#info-page")});updateTableList()});$(document).on("pagebeforeshow","#changetablewhatdialog",function(){var a=$("#changetablewhatdialog").data("fromtableid");doJsonAjax("GET","php/contenthandler.php?module=queue&command=getProdsForTableChange",{tableId:a},insertProductsToChangeTableDlg,"Tischartikel")});function insertProductsToChangeTableDlg(a){if(a.status!="OK"){alert("Fehler");return}prodsToMove=a.msg;allselected=1;updateProdToMoveList();$("#selectallnothing").off("click").on("click",function(f){f.stopImmediatePropagation();f.preventDefault();allselected=1-allselected;for(var c=0;c"+c.productname+b+"";a+="
  • "+g+"
  • "}$("#productsToMoveList").html(a);refreshList("#productsToMoveList");handleClickOnMoveableProd()}function handleClickOnMoveableProd(){$(".prodToMoveEl").off("click").on("click",function(f){f.stopImmediatePropagation();f.preventDefault();var b=this.id.split("_")[1];var a=prodsToMove[b];var c=a["class"];if(c=="unselecteditem"){a["class"]="selecteditem"}else{a["class"]="unselecteditem"}updateProdToMoveList()});$("#moveprods").off("click").on("click",function(k){k.stopImmediatePropagation();k.preventDefault();var g=[];for(var f=0;f'+W_TOGO[lang]+"";$("#tables-list-togo").html(k);$("#togoarea").show();refreshList("#tables-list-togo");bindTogoOrdering();bindServeClick()}}else{$(h).show();$("#togoarea").hide();$("#tablemapcontent").hide();var k='
  • '+W_TABLES[lang]+"
  • ";var f="";if(ostablebtnsize==1){f="ostable-1"}else{if(ostablebtnsize==2){f="ostable-2"}}$.each(l,function(p,s){var r=s.pricesum;var n=r.replace(".",decpoint)+" "+currency;var o=s.prodcount;var m=s.prodready;var q=s.readyQueueIds;if(r!=0){k+='
  • '+s.name+" ("+W_TO_PAY[lang]+": "+n+")"+createServeInfo(s.id,o,m)+"
  • "}else{k+='
  • '+s.name+createServeInfo(s.id,o,m)+"
  • "}});if(c=="t"){k+='
  • '+W_TOGO[lang]+"
  • "}$(h).empty().append(k).promise().done(function(){bindTogoOrdering();bindServeClick();$(this).off("click").on("click",".info-go",function(p){p.stopImmediatePropagation();p.preventDefault();var o=g;var m=l[this.id]["id"];var n=l[this.id]["name"];forwardDisplayToProductView.call(this,a,m,n)});refreshList(this)})}}function bindServeClick(){$(".prodreadyicon").off("click").on("click",function(l){l.stopImmediatePropagation();l.preventDefault();var f=this.id.split("_")[1];var h=queueIdsOfTakeAway;if((f!=null)&&(f!="n")){var a=$("#tables-page").data("roomdetail");var c=a.tables;for(var b=0;b0){var k=h.join();doJsonAjax("POST","php/contenthandler.php?module=queue&command=declareMultipleProductsDelivered",{queueids:k},updateAfterDelivery,"Bereitstellung")}})}function updateAfterDelivery(a){if(tableListActive){updateTableList()}else{reloadPage()}}function bindTogoOrdering(){$(".togoorder").off("click").on("click",function(a){a.stopImmediatePropagation();a.preventDefault();isTogoOrderSelected=true;forwardDisplayToProductView.call(this,0,0,W_TOGO[lang])})}function forwardDisplayToProductView(b,a,c){neworders=[];updateNewOrdersGui();var e=new Array(b,a,c);$("#typprodpage").data("table-info",e);nextPage="typprodpage";$.mobile.changePage("#typprodpage");neworders=[];updateNewOrdersGui()}function attachAndDisplayFirstRefTypes(e){$("#typprodpage").data("types_prods",e);var a=e.prods;var c=[];for(var b=0;b";if(applyExtraBtnPos!=1){k+='
  • '+W_APPLY[lang]+"
  • "}for(var f=0;f=0){b="f";h="check"}k+='
  • '+toHtml(g)+"
  • "}if(requestPriceInExtras!=false){k+='
  • '}if(applyExtraBtnPos!=2){k+='
  • '+W_APPLY[lang]+"
  • "}k+=createHigherLine(l);return k}function bindExtrasSel(){$(".extrasel").off("click").on("click",function(n){n.stopImmediatePropagation();n.preventDefault();var a=this.id.split("_");var b=a[1];var f=a[2];if((b=="abottom")||(b=="atop")){var l=getProdEntry(f);var c=l.extras;var o=[];for(var h=0;h=0){o[o.length]={id:b,name:m,price:g.price}}}if(requestPriceInExtras){var k=$("#enterpriceextrasfield").val();k=k.trim();k=k.replace(decpoint,".");if((k!="")&&($.isNumeric(k))){requestPriceInExtras=false;presetPriceInExtras="";addProductToNewOrdersList(f,o,k)}else{alert(W_NO_VALID_PRICE[lang])}}else{addProductToNewOrdersList(f,o)}}else{if(w_extras.indexOf(b)>=0){w_extras.splice(w_extras.indexOf(b),1)}else{w_extras[w_extras.length]=b}if(requestPriceInExtras!==false){presetPriceInExtras=$("#enterpriceextrasfield").val()}var p=listOfExtras(f);$("#typeproducts-list").html(p);refreshList("#typeproducts-list");bindExtrasSel();bindHigherButtons()}})}function lastSelectedProdToStr(){return" ("+W_LAST_SELECTED[lang]+": "+lastSelectedProduct+")"}function listOfTypesProds(e){var a='
  • '+W_SELECTION[lang]+"";if(lastSelectedProduct!=""){a+=lastSelectedProdToStr()}a+="
  • ";var b=$("#typprodpage").data("types_prods");var c=getProdSizeClass();$.each(b.types,function(g,f){if(parseInt(f.ref)==e){a+='
  • '+toHtml(f.name)+"
  • "}});$.each(b.prods,function(f,g){if(parseInt(g.ref)==e){a+='
  • '+toHtml(g.name);if((g.amount!="null")&&(g.amount<11)){a+=" ("+W_ONLY[lang]+" "+g.amount+")"}a+=createProdInfoTxt(g.id);a+="
  • "}});if(e!=0){a+=createHigherLine(c)}return a}function createHigherLine(b){var a='
  • ';a+='
    ';a+='
    ';a+='
    ';a+="
    ";a+="
  • ";return a}function createProdInfoTxt(b){var a="";a+="
    ";a+="
    ";a+="
    ";return a}function createSearchProdInfoTxt(b){var a="";a+="
    ";a+="
    ";a+="
    ";return a}function createServeInfo(e,c,b){if(supplyright==0){return""}if(e==null){e="n"}if(b>0){var a=""+b+"("+c+")";if(b>=c){a+="
    "}else{a+="
    "}return a}else{return""}}function getProdEntry(e){var b=$("#typprodpage").data("types_prods");var c=0;var a=b.prods;for(c=0;c";var b=$("#typprodpage").data("types_prods");var e=getProdSizeClass();var a=false;var c=[];$.each(b.prods,function(g,h){if(parseInt(h.favorite)==1){a=true;c[c.length]={id:h.id,longname:h.longname}}});c.sort(prodcompare);$.each(c,function(g,h){f+='
  • '+toHtml(h.longname);f+=createProdInfoTxt(h.id);f+="
  • "});f+="";if(a){$("#favarea").html(f);$("#favarea").trigger("create")}else{$("#favarea").html("");$("#favarea").trigger("create")}}function bindFavEvent(){$(".fav").off("click").on("click",function(b){b.stopImmediatePropagation();b.preventDefault();favOrSearchWasClicked=true;levelOneType=0;var a=this.id.split("_")[1];selectedProdCount=getProdCount(a);handleClickOnProd(a)})}function displayTypesProds(c,b){window.scrollTo(0,0);if(c==0){fillFavArea();bindFavEvent()}else{$("#favarea").html("")}var a=null;if(b==null){idOfHigherType=c;a=listOfTypesProds(parseInt(c));extrasMenuOpen=false}else{a=listOfExtras(parseInt(c));extrasMenuOpen=true}$("#typeproducts-list").empty().append(a).promise().done(function(){refreshList("#typeproducts-list");$(this).off("click").on("click","a",function(i){i.stopImmediatePropagation();i.preventDefault();favOrSearchWasClicked=false;$("#searchField").val("");generateSearchResults();var g=this.id;var f=g.split("_");if(f[0]=="t"){if(c==0){levelOneType=f[1];c=f[1]}displayTypesProds(f[1],null)}else{var h=f[1];selectedProdCount=getProdCount(h);handleClickOnProd(h)}});bindHigherButtons()});$(".prodinfo").off("click").on("click",function(i){i.stopImmediatePropagation();i.preventDefault();var f=this.id.split("_")[1];var h=getProdEntry(f);var g=h.price;alert(W_PRICE[lang]+": "+g+" "+currency)});$(".prodplus").off("click").on("click",function(h){h.stopImmediatePropagation();h.preventDefault();var g=this.id.split("_")[1];var f=getProdCount(g);$("#prodcount_"+g).html(f+1)});$(".prodminus").off("click").on("click",function(h){h.stopImmediatePropagation();h.preventDefault();var g=this.id.split("_")[1];var f=getProdCount(g);if(f==2){$("#prodcount_"+g).html("");selectedProdCount=1}else{if(f>2){$("#prodcount_"+g).html(f-1)}}})}function getHigherType(){var c=$("#typprodpage").data("types_prods");var b=c.types;var f=0;if(!extrasMenuOpen){for(var e=0;e0)){w_extras=[];w_allextras=a;idOfHigherType=c.ref;if(c.unit==1){requestPriceInExtras=true;presetPriceInExtras=""}else{requestPriceInExtras=false}displayTypesProds(b,a);bindExtrasSel()}else{if(c.unit==1){hideMenuProd();enterpricedlgshown=true;$("#enterpricedlg").data("prodid",b);$("#enterpricefield").val("");$.mobile.changePage("#enterpricedlg");bindEnterPriceNumbers()}else{addProductToNewOrdersList(b,null)}}}function bindEnterPriceNumbers(){$(".numfield td").off("click").on("click",function(b){b.stopImmediatePropagation();b.preventDefault();var f=$(this).html();var a=$(this).attr("class");if(a!="keyboardapply"){var c=String($("#enterpricefield").val());$("#enterpricefield").val(c+f)}});$("#apply_priceenter").off("click").on("click",function(c){c.stopImmediatePropagation();c.preventDefault();var a=$("#enterpricedlg").data("prodid");var b=$("#enterpricefield").val();b=b.trim();b=b.replace(decpoint,".");if((b!="")&&($.isNumeric(b))){$("#enterpricedlg").dialog("close");addProductToNewOrdersList(a,null,b)}else{alert(W_NO_VALID_PRICE[lang])}})}function addProductToNewOrdersList(b,c,f){var g=$("#typprodpage").data("table-info");var a=g[1];addProductToQueue(b,c,"NO",0,f);var h=getProdAudio(parseInt(b));var e=parseInt($("#typprodpage").data("ordervolume"))/10;if(h!=""){var k="customer/"+h;if(h.match(/mp3$/)){$("#audiofile").html('')}else{if(h.match(/ogg$/)){$("#audiofile").html('')}else{if(h.match(/wav$/)){$("#audiofile").html('')}}}document.getElementById("audiofile").load();document.getElementById("audiofile").volume=e;document.getElementById("audiofile").play()}else{if(e>0.5){beep()}}var i="php/contenthandler.php?module=queue&command=getJsonLongNamesOfProdsForTableNotDelivered&tableid="+a;fillNotDeliveredProductsOfATable(i);if((keeptypelevel==0)||(favOrSearchWasClicked)){displayTypesProds(levelOneType,null)}else{if(extrasMenuOpen){displayTypesProds(idOfHigherType,null)}}allowPrintAndOrderBtn=true;refreshList("#typeproducts-list")}function beep(){var a=new Audio("data:audio/wav;base64,//uQRAAAAWMSLwUIYAAsYkXgoQwAEaYLWfkWgAI0wWs/ItAAAGDgYtAgAyN+QWaAAihwMWm4G8QQRDiMcCBcH3Cc+CDv/7xA4Tvh9Rz/y8QADBwMWgQAZG/ILNAARQ4GLTcDeIIIhxGOBAuD7hOfBB3/94gcJ3w+o5/5eIAIAAAVwWgQAVQ2ORaIQwEMAJiDg95G4nQL7mQVWI6GwRcfsZAcsKkJvxgxEjzFUgfHoSQ9Qq7KNwqHwuB13MA4a1q/DmBrHgPcmjiGoh//EwC5nGPEmS4RcfkVKOhJf+WOgoxJclFz3kgn//dBA+ya1GhurNn8zb//9NNutNuhz31f////9vt///z+IdAEAAAK4LQIAKobHItEIYCGAExBwe8jcToF9zIKrEdDYIuP2MgOWFSE34wYiR5iqQPj0JIeoVdlG4VD4XA67mAcNa1fhzA1jwHuTRxDUQ//iYBczjHiTJcIuPyKlHQkv/LHQUYkuSi57yQT//uggfZNajQ3Vmz+Zt//+mm3Wm3Q576v////+32///5/EOgAAADVghQAAAAA//uQZAUAB1WI0PZugAAAAAoQwAAAEk3nRd2qAAAAACiDgAAAAAAABCqEEQRLCgwpBGMlJkIz8jKhGvj4k6jzRnqasNKIeoh5gI7BJaC1A1AoNBjJgbyApVS4IDlZgDU5WUAxEKDNmmALHzZp0Fkz1FMTmGFl1FMEyodIavcCAUHDWrKAIA4aa2oCgILEBupZgHvAhEBcZ6joQBxS76AgccrFlczBvKLC0QI2cBoCFvfTDAo7eoOQInqDPBtvrDEZBNYN5xwNwxQRfw8ZQ5wQVLvO8OYU+mHvFLlDh05Mdg7BT6YrRPpCBznMB2r//xKJjyyOh+cImr2/4doscwD6neZjuZR4AgAABYAAAABy1xcdQtxYBYYZdifkUDgzzXaXn98Z0oi9ILU5mBjFANmRwlVJ3/6jYDAmxaiDG3/6xjQQCCKkRb/6kg/wW+kSJ5//rLobkLSiKmqP/0ikJuDaSaSf/6JiLYLEYnW/+kXg1WRVJL/9EmQ1YZIsv/6Qzwy5qk7/+tEU0nkls3/zIUMPKNX/6yZLf+kFgAfgGyLFAUwY//uQZAUABcd5UiNPVXAAAApAAAAAE0VZQKw9ISAAACgAAAAAVQIygIElVrFkBS+Jhi+EAuu+lKAkYUEIsmEAEoMeDmCETMvfSHTGkF5RWH7kz/ESHWPAq/kcCRhqBtMdokPdM7vil7RG98A2sc7zO6ZvTdM7pmOUAZTnJW+NXxqmd41dqJ6mLTXxrPpnV8avaIf5SvL7pndPvPpndJR9Kuu8fePvuiuhorgWjp7Mf/PRjxcFCPDkW31srioCExivv9lcwKEaHsf/7ow2Fl1T/9RkXgEhYElAoCLFtMArxwivDJJ+bR1HTKJdlEoTELCIqgEwVGSQ+hIm0NbK8WXcTEI0UPoa2NbG4y2K00JEWbZavJXkYaqo9CRHS55FcZTjKEk3NKoCYUnSQ0rWxrZbFKbKIhOKPZe1cJKzZSaQrIyULHDZmV5K4xySsDRKWOruanGtjLJXFEmwaIbDLX0hIPBUQPVFVkQkDoUNfSoDgQGKPekoxeGzA4DUvnn4bxzcZrtJyipKfPNy5w+9lnXwgqsiyHNeSVpemw4bWb9psYeq//uQZBoABQt4yMVxYAIAAAkQoAAAHvYpL5m6AAgAACXDAAAAD59jblTirQe9upFsmZbpMudy7Lz1X1DYsxOOSWpfPqNX2WqktK0DMvuGwlbNj44TleLPQ+Gsfb+GOWOKJoIrWb3cIMeeON6lz2umTqMXV8Mj30yWPpjoSa9ujK8SyeJP5y5mOW1D6hvLepeveEAEDo0mgCRClOEgANv3B9a6fikgUSu/DmAMATrGx7nng5p5iimPNZsfQLYB2sDLIkzRKZOHGAaUyDcpFBSLG9MCQALgAIgQs2YunOszLSAyQYPVC2YdGGeHD2dTdJk1pAHGAWDjnkcLKFymS3RQZTInzySoBwMG0QueC3gMsCEYxUqlrcxK6k1LQQcsmyYeQPdC2YfuGPASCBkcVMQQqpVJshui1tkXQJQV0OXGAZMXSOEEBRirXbVRQW7ugq7IM7rPWSZyDlM3IuNEkxzCOJ0ny2ThNkyRai1b6ev//3dzNGzNb//4uAvHT5sURcZCFcuKLhOFs8mLAAEAt4UWAAIABAAAAAB4qbHo0tIjVkUU//uQZAwABfSFz3ZqQAAAAAngwAAAE1HjMp2qAAAAACZDgAAAD5UkTE1UgZEUExqYynN1qZvqIOREEFmBcJQkwdxiFtw0qEOkGYfRDifBui9MQg4QAHAqWtAWHoCxu1Yf4VfWLPIM2mHDFsbQEVGwyqQoQcwnfHeIkNt9YnkiaS1oizycqJrx4KOQjahZxWbcZgztj2c49nKmkId44S71j0c8eV9yDK6uPRzx5X18eDvjvQ6yKo9ZSS6l//8elePK/Lf//IInrOF/FvDoADYAGBMGb7FtErm5MXMlmPAJQVgWta7Zx2go+8xJ0UiCb8LHHdftWyLJE0QIAIsI+UbXu67dZMjmgDGCGl1H+vpF4NSDckSIkk7Vd+sxEhBQMRU8j/12UIRhzSaUdQ+rQU5kGeFxm+hb1oh6pWWmv3uvmReDl0UnvtapVaIzo1jZbf/pD6ElLqSX+rUmOQNpJFa/r+sa4e/pBlAABoAAAAA3CUgShLdGIxsY7AUABPRrgCABdDuQ5GC7DqPQCgbbJUAoRSUj+NIEig0YfyWUho1VBBBA//uQZB4ABZx5zfMakeAAAAmwAAAAF5F3P0w9GtAAACfAAAAAwLhMDmAYWMgVEG1U0FIGCBgXBXAtfMH10000EEEEEECUBYln03TTTdNBDZopopYvrTTdNa325mImNg3TTPV9q3pmY0xoO6bv3r00y+IDGid/9aaaZTGMuj9mpu9Mpio1dXrr5HERTZSmqU36A3CumzN/9Robv/Xx4v9ijkSRSNLQhAWumap82WRSBUqXStV/YcS+XVLnSS+WLDroqArFkMEsAS+eWmrUzrO0oEmE40RlMZ5+ODIkAyKAGUwZ3mVKmcamcJnMW26MRPgUw6j+LkhyHGVGYjSUUKNpuJUQoOIAyDvEyG8S5yfK6dhZc0Tx1KI/gviKL6qvvFs1+bWtaz58uUNnryq6kt5RzOCkPWlVqVX2a/EEBUdU1KrXLf40GoiiFXK///qpoiDXrOgqDR38JB0bw7SoL+ZB9o1RCkQjQ2CBYZKd/+VJxZRRZlqSkKiws0WFxUyCwsKiMy7hUVFhIaCrNQsKkTIsLivwKKigsj8XYlwt/WKi2N4d//uQRCSAAjURNIHpMZBGYiaQPSYyAAABLAAAAAAAACWAAAAApUF/Mg+0aohSIRobBAsMlO//Kk4soosy1JSFRYWaLC4qZBYWFRGZdwqKiwkNBVmoWFSJkWFxX4FFRQWR+LsS4W/rFRb/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////VEFHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAU291bmRib3kuZGUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMjAwNGh0dHA6Ly93d3cuc291bmRib3kuZGUAAAAAAAAAACU=");a.play()}function fetchTypeProdsFromServer(){doJsonAjaxAsync("GET","php/contenthandler.php?module=products&command=getAllTypesAndAvailProds",null,attachAndDisplayFirstRefTypes,true)}var waitProdTimer=null;function fillTypeProdList(b){var a=$("#typprodpage").data("types_prods");if(a!=undefined){displayTypesProds(b,null)}else{waitProdTimer=setInterval(function(){var c=$("#typprodpage").data("types_prods");if(c!=undefined){clearInterval(waitProdTimer);displayTypesProds(b,null)}},200)}}function fillTypeProdList_(a){displayTypesProds(a,null)}function createTxtAssignedProd(e){var b="";if(e.option!=""){b=" ("+toHtml(e.option)+")"}var c=e.longname;if(e.togo==1){c="To-Go: "+c}if(e.pricechanged==1){c+=" - "+e.price.replace(".",decpoint)}var a="";if(e.isready=="1"){a+=" ☞"}if(e.isCooking=="1"){a+=" ♨"}if(e.isPaid=="1"){a+=" ☑"}return toHtml(c)+b+a+"
    "+createExtraParagraph(e.extras)}function createListElOfAssignedProd(b){var a="";if("count" in b){if(b.count>1){a=b.count+"x "}}if(b.isready=="0"){return'
  • '+a+createTxtAssignedProd(b)+"
  • "}else{return'
  • '+a+createTxtAssignedProd(b)+"
  • "}}function fillAssignedProdList(b){if(b.length>0){notDeliveredProdsAvailable=true}else{notDeliveredProdsAvailable=false}$("#cancelcodefield").val("");if(cancelunpaidcode!=""){if(b.length>0){$("#cancelcodearea").show()}else{$("#cancelcodearea").hide()}}else{$("#cancelcodearea").hide()}var c=new Grouping(b,createTxtAssignedProd);c.group();var a='
  • '+W_KIT_BAR[lang]+"
  • ";a+=c.outputList(createListElOfAssignedProd);if(notDeliveredProdsAvailable){a+='
  • '+W_DEL_ALL_UNDELIVERED[lang]+"
  • "}$("#orderedprod-list-0").html(a);refreshList("#orderedprod-list-0");$("#undeliveredheader").off("click").on("click",function(f){f.stopImmediatePropagation();f.preventDefault();alert(W_UNDELIV_INFO[lang])});bindingOfAssignedProds(c);bindDelAllUndeliveredProds(b)}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
    +
    +
    +

    Preis

    +

    +

    + + + + + + + +
    789
    456
    123
    0,
    Anwenden
    + +
    + +
    +
    +
    + \ No newline at end of file diff --git a/webapp/waiterdesktop.php b/webapp/waiterdesktop.php index 4b998fd..31ddfdf 100644 --- a/webapp/waiterdesktop.php +++ b/webapp/waiterdesktop.php @@ -16,6 +16,7 @@ + @@ -26,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()})}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+='
    '+g.name+"
    "}});var e=roominfo.takeawayprice.replace(".",decpoint)+" "+currency;if(e!=""){e='
    '+e+"
    "}if(selectedroomindex<0){a+='
    ';a+='
    Zum Mitnehmen
    ';a+=e;a+="
    "}else{a+='
    ';a+='
    Zum Mitnehmen
    ';a+=e;a+="
    "}$("#roompanel").html(a);$("#tablepanelcontent").html("");showRoomTableTextInfo();showTablesForRoomIndex();bindingRoom()}function getRoomsForDialog(){var b=roominfo.roomstables;var a="";$.each(b,function(e,c){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();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"){startProductDisplay()}}}else{changeRoom(a);goPayDesk()}})}function discardChangeRoom(a){neworders=[];groupedNewOrders=null;showNewOrders();changeRoom(a)}function changeRoom(a){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+='
    '}a+='
    '+g.name+"
    ";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(){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"){$("#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)&&(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(e){var b="";if(e.option!=""){b="

    "+toHtml(e.option)+""}var f="";var c=toHtml(e.longname);if(e.togo==1){f="To-Go: "}c='

    '+f+''+c+"
    ";if(e.pricechanged==1){c+=" - "+e.price.replace(".",decpoint)}var a="";if(e.isready=="1"){a+=" ☞"}if(e.isCooking=="1"){a+=" ♨"}if(e.isPaid=="1"){a+=" ☑"}return c+'
    '+b+a+createExtraParagraphForOrderedEl(e.extras)+"
    "}function createListElOfAssignedProd(c){var b="";if("count" in c){if(c.count>1){b='
    '+c.count+"x
    "}}var a="
    "+b+createTxtAssignedProd(c)+"
    ";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(e,f){a+='
    '+f.name;if((f.amount!="null")&&(f.amount<11)){a+=" ("+W_ONLY[lang]+" "+f.amount+")"}a+="
    "})}$("#productspanel").html(a);bindProduct();bindRemark()}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"+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;b0){b+="

    "+p.join("
    ")}else{b=""}var r=A+"-"+o+"-"+b;if(f!="NO"){r=A+"-"+o+"-"+b+f}if(l==1){r+=" - To-Go"}var k=z.joinedvals.indexOf(r);if(k>=0){z.count[k]=z.count[k]+1;idxarr=z.origidxs[k];idxarr[idxarr.length]=v;z.origidxs[k]=idxarr}else{var n=z.count.length;z.count[n]=1;z.joinedvals[n]=r;z.name[n]=A;z.price[n]=t;z.option[n]=o;z.extras[n]=b;z.prodids[n]=q;z.changedPrices[n]=f;z.togos[n]=l;z.origidxs[n]=[v]}}return z}function showNewOrders(){groupedNewOrders=group(neworders);var h="";var n=groupedNewOrders.count.length;for(var g=n-1;g>=0;g--){var m=toHtml(groupedNewOrders.name[g]);var l=groupedNewOrders.option[g];var k=groupedNewOrders.count[g];if(k>1){m=""+k.toString()+"x "+m}var f=groupedNewOrders.prodids[g];if(l!=""){l="

    "+toHtml(l)+"

    "}var c=groupedNewOrders.changedPrices[g];var b=groupedNewOrders.togos[g];var o="";var e=groupedNewOrders.extras[g];if((e!=null)&&(e!="")){o=""+e+""}var a="";if(c!="NO"){if(b!=0){a="
    ("+c.replace(".",decpoint)+" "+currency+" - To-Go)"}else{a="
    ("+c.replace(".",decpoint)+" "+currency+")"}}else{if(b!=0){a="
    (To-Go)"}}h+='
    '+m+l+o+a+"
    "}$("#neworders").html(h);$("#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 supplyright=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 enterpricedlgshown=false;var requestPriceInExtras=false;var presetPriceInExtras="";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 Preiseingabe","No valid price","Precio no valido"];var W_NO_REORDER_VAR_PRICE=["Produkt mit variablem Preis kann nicht auf diese Weise nachbestellt werden.","Produkt with variable price cannot be reordered this way.","Producto con un precio variable no se puede reordenado asi."];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();intervalGetPrinterStatus(5);intervalGetGeneralCommentsAndTablePref(10);intervalGetWaiterMessage(20);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 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;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;if((b.cancelunpaidcode!=null)&&(b.cancelunpaidcode!="")){cancelunpaidcode=b.cancelunpaidcode}else{cancelunpaidcode=""}osroombtnsize=c.buttonsizes.roombtnsize;ostablebtnsize=c.buttonsizes.tablebtnsize;osprodbtnsize=c.buttonsizes.prodbtnsize;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)})})}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();$("#productspanel").show();$("#remarkpanel").show();$("#ordered").show();$("oben").html("");$("#oben").hide();$("#unten").html("");$("#unten").hide();$("#receiptpanel").hide();$("#paybuttonpanel").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();if(panelMode==="waiter"){if((rightpaydesk==1)&&(cashenabled==1)){$("#paydeskbtn").show()}$("#hostbutton").hide();$("#cashbutton").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()}}else{$("#paydeskbtn").hide();if(restaurantmode==1){$("#hostbutton").show()}$("#cashbutton").show();if(prodsaccounted.length>0){$("#paydeskcash").show();$("#paydeskprint").show();$("#goorderbtn").show()}$("#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'}for(var e=0;e"+toHtml(c)+""}else{a+="
  • "+toHtml(c)+"
  • "}}a+="";$("#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;e0){actcount--}}else{if(b==="actplusbtn"){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{actprice=g;$("#actpricefield").val("")}}}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 q=a[0];var l=neworders[q].prodid;var g=neworders[q].changedPrice;var e=neworders[q].togo;var n=neworders[q].option;var k=neworders[q].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'+f.name+"";if(!b){c+="


    ";b=true}}});c+='
    '+P_CANCEL[lang]+"
    ";$("#selectiondialog").html(c);var e=600;if(paymentconfig==1){e=380}$("#selectiondialog").dialog({autoOpen:false,modal:true,height:e,buttons:{Abbrechen:function(){$(this).dialog("close")}}});$("#selectiondialog").dialog("open");bindPayment()}function bindPayment(){$(".paymentcancel").off("click").on("click",function(a){a.stopImmediatePropagation();a.preventDefault();$("#selectiondialog").dialog("close")});$(".paymentitem").off("click").on("click",function(a){a.stopImmediatePropagation();a.preventDefault();var b=this.id.split("_")[1];currentPaymentId=b;$("#selectiondialog").dialog("close");if((currentPaymentId==PAYMENT_HS3)||(currentPaymentId==PAYMENT_GUEST)){$("#hoteldialog").dialog({autoOpen:false,modal:true,height:400,width:500,buttons:{Abbrechen:function(){$(this).dialog("close")}}});$("#hoteldialog").dialog("open");$("#roomguesttextfield").val("");bindhotelinterface(currentPaymentId);return}else{startPayProcess(b,"","","")}})}function bindhotelinterface(a){generateGuestResult($("#roomguesttextfield").val(),false,a);$("#roomguesttextfield").off("keyup").on("keyup",function(b){generateGuestResult($("#roomguesttextfield").val(),false,a)});$("#paym_hotel").off("click").on("click",function(h){h.stopImmediatePropagation();h.preventDefault();var f=$("#hotelroomfoundguest").data("reservation");var c=$("#hotelroomfoundguest").data("guest");var b=$("#hotelroomselection").find(":selected").val();if(b!=undefined){var c=guests[b];var g="";if(currentPaymentId==PAYMENT_GUEST){c=internalguests[b];g=c.id}startPayProcess(currentPaymentId,c.reservationid,c.object+" - "+c.guest,g);$("#hoteldialog").dialog("close")}else{alert("Kein Gast ausgewählt")}})}function generateGuestResult(c){c=c.trim().toLowerCase();if(c==""){$("#hotelroomselection").html("");return}var b="";var a=false;$.each(guests,function(h,k){var e=k.object;var l=k.guest;var f=(e.toLowerCase().indexOf(c)>=0);var g=(l.toLowerCase().indexOf(c)>=0);if(f||g){if(!a){a=true;b+='"}else{b+='"}}});$("#hotelroomselection").html(b)}function updateAccounted(c,a,b){if(a===b){$("#"+c).removeClass("paystillopen");$("#"+c).removeClass("payallaccounted");$("#"+c).addClass("payallaccounted")}else{$("#"+c).removeClass("paystillopen");$("#"+c).removeClass("payallaccounted");$("#"+c).addClass("paystillopen")}if(a===0){$("#"+c+" .payitemaccounted").html("")}else{$("#"+c+" .payitemaccounted").html(a)}}function getProdAccountedEntry(c){var f=createHashOfPayableItem(c);for(var a=0;a1){f=g.count+"x ";c=g.count}}var b=false;var a=getProdAccountedEntry(g);var h="";if(a!==null){if(a.count!=0){h=a.count}if(a.count==c){b=true}}var e="";if(b){e='
    '+f+createHashOfPayableItem(g)+"
    "+h+"
    "}else{e='
    '+f+createHashOfPayableItem(g)+"
    "+h+"
    "}return e}function createOnReceiptItemListElement(c){var b="";if("count" in c){if(c.count>1){b=c.count+"x "}}var a='
    '+b+createHashOfPayableItem(c)+"
    ";return a}function getProdOfAllProdsWithHash(e){var b=prodsToPayListGrouping.sortedset;for(var a=0;a";$("#receiptpanel").html(c);calcSum();var k=$("#receiptpart").html();$("#info-page").data("receipthtml",k);displayRightButtons()}function getTableName(){if(selectedtableindex!=null){var a=roominfo.roomstables[selectedroomindex].tables[selectedtableindex];return a.name}else{if(selectedroomindex=="-1"){return"Zum Mitnehmen"}else{return null}}}function createReceiptHeader(){var a=genCreateReceiptHeader(0,"",getTableName(),loggedinUser,currency);return a}function createReceiptFooter(b,c,a){var e=genCreateReceiptFooterNoSum(b,0,"",a);return e}function getQueueIdsDueToCountOfItem(g){var e=[];var h=g.hash;var f=g.count;for(var b=0;b=f){break}}}return e}function startPayProcess(t,o,r,l){var n=getTableName();var f=0;if(selectedroomindex!=-1){if(selectedtableindex!=null){var k=roominfo.roomstables[selectedroomindex].tables[selectedtableindex];f=k.id}else{f=0}}var h=$("#info-page").data("usst");if($("#info-page").data("taxtype")=="togo"){h=$("#info-page").data("togotax")}checkForLogIn();var e=[];var s=prodsOnReceiptList;var q=prodsaccounted;var p=prodsOnReceiptListGrouping;for(var m=0;m";printContent(v)}}startCashProcess()}}else{alert("Fehler: "+c)}},error:function(a){alert("Sorry, there was a problem! "+a)}})}var P_DESCR=["Beschreibung","Description","Descripción"];var P_PRICE=["Preis","Price","Precio"];var P_TOTAL=["Total","Total","Total"];var P_ID=["Id:","Id:","Id:"];var P_ROOMSEL=["Raumauswahl","Room selection","Selección de espacio"];var P_PAYDESK_ACTIONS=["Kassenaktionen","Paydesk actions","Acciones de caja"];var P_BAR_INPUT=["Bareinlage","Input money","Insertar dinero"];var P_BAR_GET=["Barentnahme","Take money","Sacar dinero"];var P_BAR_SUM=["Einnahmen","Revenue","Cobro"];var P_TITLE=["Kasse","Paydesk","Caja"];var P_TABLE=["Tisch","Table","Mesa"];var P_TABLE_SEL=["Tischauswahl","Select table","Qué mesa?"];var P_NOT_PAID=["Ausstehend für ","Not paid for ","Impagado para "];var P_ALL=["Alles","All","Todo"];var P_CONTENT_RECEIPT=["Inhalt Kassenbon","Content of receipt","Contenido del tique"];var P_ONLY_PAY=["Nur Zahlung","Only pay","Solo pagar"];var P_PAY_PRINT=["Bondruck","Pay+Print","Pagar+Imprimir"];var P_CHANGE_CALC=["Wechselgeldrechner:","Change Calculator:","Calculadora de Cambio:"];var P_CHOOSE_PAYWAY=["Auswahl der Zahlungsart:","Selection of method of payment:","Selección del modo de pago:"];var P_CANCEL=["Abbrechen","Cancel","Cancelar"];var P_CASHTAKEOUT=["Barentnahme aus der Kasse","Cash take-out","Sacar dinero"];var P_CASHTAKIN=["Bareinlage in die Kasse","Cash insert","Insertar dinero"];var P_AMOUNT=["Betrag:","Amount:","Valor:"];var P_OVERVIEW=["Übersicht Kellnerkasse","Overview waiter purse","Resumen cartera de bolsillo"];var P_PUT_IN=["Einlegen","Insert","Insertar"];var P_TAKE_OUT=["Entnehmen","Take out","Sacar"];var P_OVERV_DETAILS=["Diese Übersicht enthält die Bar-Bewirtungseinnahme durch den Kellner seit der letzten Tageslosung sowie als weiteren Wert den Kassenstand unter Berücksichtigung der eigenen Eingaben und Entnahmen.","This overview contains the cash amount of money of this waiter since the last closing as well as the total amount of money including the own cash insert and take-out actions.","Este resumen contiene todo el dinero al contado por cobro para el camarero, y también el dinero incluido con acciones de insertar y sacar."];var P_CASH_SUM=["Bewirtungseinnahmen:","Cash by payment:","Cobro:"];var P_INCLUDE_OWN=["inkl. eigener Kassen-Eingaben/Entnahmen:","incl. own cash insert/take-outs:","incl. tomas y entradas proprias:"];var P_NO_ELEM=["Keine Rechnungselemente","No items selected","Ningún producto selecionado"];var P_NO_ELEM_DETAILS=["Es wurden keine abrechenbaren Produkte festgelegt (der Bon ist leer!).","There are no selected items. The receipt is empty!","No hay ningún elemento seleccionado para pagar."];var P_CASHACTION_OK=["Kassenaktion abgeschlossen.","Action completed.","Acción terminado."];var P_NAV=["Navigation","Navigation","Navigación"];var P_ORDER_ACTION=["-> Bestellansicht","-> Order view","-> Vista de Orden"];var P_TO_PAY=["Zu zahlen: ","To pay: ","Pagar total: "];var P_PAY_RETURN=["Zurück: ","Return: ","Torna: "];var P_CALC_PAYBACK=["Berechne","Calculate","Calcular"];var P_HAS_PAID=["Bezahlt: ","Paid: ","Pagado: "];var P_TOGO=["Außer-Haus-Verkauf","Sale with Tax No 2","Venta IVA 2"];var P_TIP=["nur Trinkg.: ","Only tip: ","Solo prop.: "];var P_TOTAL_INCL_TIP=["Zielbetrag:","Target pay:","Quiere pagar:"];var CALC_TIP_TXT=["Angabe extra Trinkg.","Do Tip separate","Propina individual"];var CALC_TOTAL_TXT=["Angabe inkl.Trinkg.","Do Tip incl.","Propina incl."];var P_GUESTS=["Gäste","Guests","Habitaciones"];var showHostTemplate=false;var guests=[];var internalguests=[];var hotelinterface=0;var PAYMENT_HS3=7;var PAYMENT_GUEST=8;var currentPaymentId=7;function getGeneralConfigItems(){doAjax("GET","php/contenthandler.php?module=admin&command=getGeneralConfigItems",null,insertGeneralConfigItems,"Fehler Konfigurationsdaten")}function getPayments(a){doAjax("GET","php/contenthandler.php?module=admin&command=getPayments",null,a,"Fehler Zahlungswege")}function insertGeneralConfigItems(b){if(b.status=="OK"){var a=b.msg;decpoint=a.decpoint;$("#info-page").data("decpoint",a.decpoint);currency=a.currency;var e=a.tax;var c=e.replace(".",decpoint);$("#info-page").data("usstGerVal",c);$("#info-page").data("usst",e);e=a.togotax;c=e.replace(".",decpoint);$("#info-page").data("togoTaxGerVal",c);$("#info-page").data("togotax",e);$("#info-page").data("companyinfo",a.companyinfo);$("#info-page").data("payPrintType",a.payprinttype);$("#info-page").data("currency",a.currency);$("#info-page").data("billlanguage",a.billlanguage);$("#info-page").data("userlanguage",a.userlanguage);receiptfontsize=parseInt(a.receiptfontsize);$("#receiptpart").css("font-size",receiptfontsize+"px");paymentconfig=a.paymentconfig;$("#curtopay2").html(" "+a.currency);workflowconfig=a.workflowconfig;digigopaysetready=a.digigopaysetready;setLanguage(a.userlanguage)}else{$("#contentpart").hide();setTimeout(function(){document.location.href="index.html"},250)}}function addEntryOrIncreaseCount(a,f){var c=0;var g=false;var e=f.prodid+"-"+f.extras.join("_")+f.price+"-"+f.pricelevelname+"#"+f.tax+"_"+f.togo;for(c=0;cID:"+e+"";g+=' ";g+=""+c+"";g+=" ";if(l!=""){g+="Gast: "+toHtml(l)+"";g+=" "}g+=""+P_NO[b]+""+P_DESCR[b]+""+P_PRICE[b]+""+P_TOTAL[b]+"";return g}function genCreateReceiptFooterNoSum(c,e,b,a){return genCreateReceiptFooter(c,e,b,"","","",a)}function genCreateReceiptFooter(a,f,b,k,e,m,n){var c='style="border: solid black 0px;padding: 3px;text-align:right;vertical-align:bottom;"';var p='style="text-align:center;vertical-align:bottom;"';var h=" ";var o=h;o+=""+P_MWST[f]+"% "+P_MWST[f]+""+P_NETTO[f]+""+P_BRUTTO[f]+"";for(var l=0;l"+k+'"+e+'"+m+""}o+=h;o+="   "+P_SUM[f]+'"+m+"";o+=h;o+="
     
    ";o+=toHtml(b).replace(/(?:\r\n|\r|\n)/g,"
    ");o+="
    ";return o}function generateOneProdLine(k,g,i,a,n,f){var b='style="border: solid black 0px;padding: 3px;text-align:right;vertical-align:bottom;"';var h='style="border: solid black 0px;padding: 3px;text-align:center;vertical-align:bottom;"';var c=(parseFloat(i)).toFixed(2).replace(".",n);if(a!="A"){g+=" ("+a+")"}if(f==1){g="To-Go: "+g}var m=k*i;var l="";var e='style="white-space: nowrap;overflow: hidden;text-overflow:ellipsis;width: 60%;"';l+="'+k+""+g;l=l+""+c;l+=""+m.toFixed(2).replace(".",n)+"";return l}function generateProdPartByDbContent(f,e){var c=0;tablecontent="";for(c=0;c=0);var m=(p.toLowerCase().indexOf(g)>=0);if(l||m){i++;h=toHtml(k+" - "+p);if(!c){c=true;f+='"}else{f+='"}}});if(i===1){$("#hotelroomfoundguest").html(h);$("#hotelroomselection").html(f)}else{$("#hotelroomselection").html(f)}if(b){$("#hotelroomselection").selectmenu("refresh")}};