From e6c5c607b04c006246de0c262cc1e080d46106b0 Mon Sep 17 00:00:00 2001 From: Geno Date: Thu, 19 Nov 2020 22:59:50 +0100 Subject: [PATCH] OrderSprinter 1.2.1 --- printserver/OrderSprinterPrintserver.exe | Bin 267776 -> 267776 bytes webapp/OrderSprinterPrintserver.exe | Bin 267776 -> 267776 bytes webapp/bar.html | 2 +- webapp/bill.html | 4 +- webapp/feedback.html | 2 +- webapp/index.html | 4 +- webapp/install.html | 2 +- webapp/install/installer.php | 33 +++++++++++-- webapp/kitchen.html | 2 +- webapp/manager.html | 58 ++++++++++++++++++++++- webapp/paydesk.html | 4 +- webapp/php/admin.php | 40 +++++++++------- webapp/php/printqueue.php | 26 ++++++++-- webapp/preferences.html | 2 +- webapp/products.html | 2 +- webapp/rating.html | 2 +- webapp/reports.html | 2 +- webapp/reservation.html | 2 +- webapp/supplydesk.html | 2 +- webapp/waiter.html | 2 +- 20 files changed, 147 insertions(+), 44 deletions(-) diff --git a/printserver/OrderSprinterPrintserver.exe b/printserver/OrderSprinterPrintserver.exe index c9285f00d807604315aa09b236a4c6c4481cbd62..66aa48a272ecd35aee16f47ee45402811323c112 100644 GIT binary patch delta 716 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 - + diff --git a/webapp/bill.html b/webapp/bill.html index 12a721d..bfb63b4 100644 --- a/webapp/bill.html +++ b/webapp/bill.html @@ -5,7 +5,7 @@ - + @@ -349,7 +349,7 @@ function getBillWithId(id) { function printBill(billid) { doAjax("POST","php/contenthandler.php?module=printqueue&command=queueReceiptPrintJob", - {billid : billid }, null, "Druckfehler"); + {billid : billid , useaddrecprinter: 0}, null, "Druckfehler"); } function areYouSure(text1, text2, button, callback) { diff --git a/webapp/feedback.html b/webapp/feedback.html index 5426a1b..748ef88 100644 --- a/webapp/feedback.html +++ b/webapp/feedback.html @@ -4,7 +4,7 @@ - + diff --git a/webapp/index.html b/webapp/index.html index 7532fe3..3c7af42 100644 --- a/webapp/index.html +++ b/webapp/index.html @@ -7,8 +7,8 @@ - - + + diff --git a/webapp/install.html b/webapp/install.html index 432b0bb..c784530 100644 --- a/webapp/install.html +++ b/webapp/install.html @@ -679,7 +679,7 @@ $(document).ready(function() {   - +   diff --git a/webapp/install/installer.php b/webapp/install/installer.php index 2335d6e..8c46f78 100644 --- a/webapp/install/installer.php +++ b/webapp/install/installer.php @@ -1232,6 +1232,29 @@ return true; } catch (PDOException $e) { return false; } +} + +function updateUserTable1200_1201($prefix, $version, $dbname) { +$pdo = $this->pdo; +try { +if ($version != "1.2.0") { +$ret = $this->updateUserTable1130_1200($prefix, $version, $dbname); +if (!$ret) { +return false; +} +} + +DbUtils::overrulePrefix($prefix); + +$sql = "INSERT INTO `%config%` (`id` , `name`, `setting`) VALUES (NULL,?,?)"; +$stmt = $pdo->prepare($this->basedb->resolveTablenamesInSqlString($sql)); +$stmt->execute(array('addreceipttoprinter',null)); + +$this->updateVersion($pdo, '1.2.1'); +return true; +} catch (PDOException $e) { +return false; +} } function setVersion($prefix,$theVersion) { @@ -1318,7 +1341,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.2.0')"); +$this->basedb->doSQL($pdo,"INSERT INTO `%config%` (`id` , `name`, `setting`) VALUES (NULL , 'version', '1.2.1')"); $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')"); @@ -1328,6 +1351,7 @@ $this->basedb->doSQL($pdo,"INSERT INTO `%config%` (`id` , `name`, `setting`) VAL $this->basedb->doSQL($pdo,"INSERT INTO `%config%` (`id` , `name`, `setting`) VALUES (NULL , 'bigfontworkreceipt', '0')"); $this->basedb->doSQL($pdo,"INSERT INTO `%config%` (`id` , `name`, `setting`) VALUES (NULL , 'prominentsearch', '0')"); $this->basedb->doSQL($pdo,"INSERT INTO `%config%` (`id` , `name`, `setting`) VALUES (NULL , 'groupworkitems', '1')"); +$this->basedb->doSQL($pdo,"INSERT INTO `%config%` (`id` , `name`, `setting`) VALUES (NULL , 'addreceipttoprinter', null)"); $this->basedb->doSQL($pdo,"INSERT INTO `%config%` (`id` , `name`, `setting`) VALUES (NULL , 'smtphost', '')"); $this->basedb->doSQL($pdo,"INSERT INTO `%config%` (`id` , `name`, `setting`) VALUES (NULL , 'smtpauth', '1')"); @@ -1682,7 +1706,7 @@ $zones[] = $timezone_identifiers[$i]; } echo json_encode($zones); } else if ($command == 'update') { -$installerVersion = "1.2.0"; +$installerVersion = "1.2.1"; $admin = new InstallAdmin(); $pdo = $admin->openDbAndReturnPdo($_POST['host'],$_POST['db'],$_POST['user'],$_POST['password']); @@ -1711,7 +1735,8 @@ $supportedVersions = array("1.0.22","1.0.23","1.0.24","1.0.25","1.0.26","1.0.27" "1.0.30","1.0.31","1.0.32","1.0.33","1.0.34","1.0.35","1.0.36","1.0.37","1.0.38","1.0.39", "1.0.40","1.0.41","1.0.42","1.0.43", "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.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" ); if (!in_array($version, $supportedVersions)) { @@ -1719,7 +1744,7 @@ echo json_encode("Quellversion nicht unterstützt"); return; } -$ret = $admin->updateUserTable1130_1200($_POST['prefix'], $version, $_POST['db']); +$ret = $admin->updateUserTable1200_1201($_POST['prefix'], $version, $_POST['db']); if(session_id() == '') { session_start(); diff --git a/webapp/kitchen.html b/webapp/kitchen.html index be18a9a..d427a74 100644 --- a/webapp/kitchen.html +++ b/webapp/kitchen.html @@ -5,7 +5,7 @@ - + diff --git a/webapp/manager.html b/webapp/manager.html index b45da11..cafb3bd 100644 --- a/webapp/manager.html +++ b/webapp/manager.html @@ -5,7 +5,7 @@ - + @@ -131,6 +131,7 @@ var MAN_TABLE_LABEL = ["Tische","Tables","Mesas"]; var MAN_LANG_OF_RECEIPT = ["Bonsprache","Receipt language","Idioma de tique"]; var MAN_PRINT_CONCEPT = ["Druckkonzept","Print concept","Concepto de impresión"]; var MAN_PAYMENT_CONFIG = ["Menü Zahlungsweg","Menu Payment Type","Selección tipo de pagar"]; +var MAN_ADD_RECPRINTER = ["Kassenbon zusätzlich auf","Receipt additionally on","Imprimir tiques también a"]; var MAN_WORKFONT_CONFIG = ["Arbeitsbon Schriftgröße","Font size work receipt","Tamaño de letras en tiques de trabajo"]; var MAN_PROMINENT_SEARCH = ["Prominente Produktsuche","Prominent Product search","Buscar de productos ariba"]; var MAN_DISCOUNT1 = ["Rabatt 1 (%)","Discount 1 (%)","Descuento 1 (%)"]; @@ -145,6 +146,9 @@ var MAN_WAITER_GOPAY_PRINT = ["Bestell-Kassenbutton druckt Arbeitsbons","Waiter' var MAN_WAITER_GOPAY_DESCR = ["Im Arbeitsablauf 'nur Arbeitsbons' bestimmt diese Einstellung, ob bei Druck auf den Button 'Kasse' Arbeitsbons gedruckt werden sollen.", "In the 'only work receipts' workflow this setting specifies if after pressing the 'paydesk' button in the waiter's view work receipts shall be printed.", "En el modus 'solo tiques de trabajar' este boton especifica se debe imprimido el tique de trabajar despues el click en el boton 'caja' en la vista de camarero."]; +var MAN_ADD_RECPRINTER_DESCR = ["Wird hier ein weiterer Drucker angegeben, so werden alle Kassenbons beim Druck über die Kassenansicht zusätzlich auf diesem Drucker ausgedruckt.", + "If a printer is set every print job that is invoked on the paydesk view will be printed also on the specified printer", + "Si esta seleccionado una imprimadora aquí cada tiquet va a ser imprimido en la imprimidora también"]; var MAN_GROUP_WORK_ITEMS = ["Artikelzusammenfassung Arbeitsbon","Summary articels on work receipt", "Agrupación articulos tique d. tr." ]; var MAN_RES_NOTE = ["Reservierungsbestätigung","Confirmation reservation","Text de email para reservación"]; var MAN_CHANGE_CONFIG_HEAD = ["Konfiguration ändern?","Change configuration?","Modificar configuración?"]; @@ -280,7 +284,7 @@ var MAN_CONFIRM_GO_LIVE = ["Die Umsatz- und Logdaten wurden gelöscht und nur di "La configuración esta re-creado. Entonces es necesario registrar de nuevo."]; var lang = 0; -var generalVals = [12,2,0,3,0,1,1,0,0,1, 0,50,20,10,1,0]; +var generalVals = [12,2,0,3,0,1,1,0,0,1, 0,50,20,10,1,0,""]; var numberOfClosings = 0; @@ -309,6 +313,7 @@ var generalValuesSettings = [ ["austria",MAN_AUSTRIA[lang],"s",10], ["digigopaysetready",MAN_DIGI_GOPAY_SET_READY[lang],"s",14], ["waitergopayprint",MAN_WAITER_GOPAY_PRINT[lang],"s",15], + ["addreceipttoprinter",MAN_ADD_RECPRINTER[lang],"s",16], ["workflowconfig",MAN_WORKFLOW[lang],"s",4], ["receiptfontsize",MAN_RECEIPT_FONTSIZE[lang],"s",0], ["billlanguage",MAN_LANG_OF_RECEIPT[lang],"s",2], @@ -384,6 +389,7 @@ function setLanguage(l) { $("#austriahint").html(MAN_AUSTRIA_INCOMPLETE[l]); $("#digigopaysetreadyhint").html("

" + MAN_DIGI_GOPAY_DESCR[l] + "

"); $("#waitergopayprinthint").html("

" + MAN_WAITER_GOPAY_DESCR[l] + "

"); + $("#addrecprinterhint").html("

" + MAN_ADD_RECPRINTER_DESCR[l] + "

"); $("#aeskeytxt").html(MAN_AESKEY[l]); $("#certificatesntxt").html(MAN_CERTIFICATE_SN[l]); @@ -503,9 +509,11 @@ function insertGeneralConfigItems(configResult) { } generalVals[3] = values.paymentconfig; generalVals[4] = values.workflowconfig; + generalVals[16] = values.addreceipttoprinter; $("#partOfPayPrintType").html(createPayPrintTypePart(payPrintType)); $("#partOfPaymentConfig").html(createPaymentConfigPart(values.paymentconfig)); + $("#partOfAddRecPrinter").html(createAddRecPrinterPart(values.addreceipttoprinter)); $("#partOfWorkflowConfig").html(createWorkflowConfigPart(values.workflowconfig)); $("#partOfBigFontWorkReceipt").html(createBigFontWorkReceiptPart(values.bigfontworkreceipt)); $("#partOfProminentSearch").html(createProminentSearchPart(values.prominentsearch)); @@ -613,6 +621,26 @@ function createPaymentConfigPart(payment) { return html; } +function createAddRecPrinterPart(value) { + var html = '
'; + html += ''; + html += '
'; + return html; +} + function createBigFontWorkReceiptPart(theValue) { var html = '
'; html += ''; @@ -1165,6 +1193,7 @@ function binding() { e.preventDefault(); setVisibilityOfAustriaButtons(); setVisibilityDueToWorkflow(); + setVisibilityDueToPrintType(); }); bindSelectionsWithActions(); @@ -1190,6 +1219,15 @@ function bindSelectionsWithActions() { $("#configpart").trigger("create"); bindSelectionsWithActions(); }); + $("#payprinttype").off("change").on("change", function (e) { + e.stopImmediatePropagation(); + e.preventDefault(); + var newval = $("#payprinttype").find(":selected").val(); + $("#partOfPayPrintType").html(createPayPrintTypePart(newval)); + setVisibilityDueToPrintType(); + $("#configpart").trigger("create"); + bindSelectionsWithActions(); + }); } function setVisibilityOfAustriaButtons() { @@ -1216,6 +1254,16 @@ function setVisibilityDueToWorkflow() { } } +function setVisibilityDueToPrintType() { + // partAddrecPrinterIfServerPrint + var payprinttype = $("#payprinttype").find(":selected").val(); + if (payprinttype == 2) { + $("#partAddrecPrinterIfServerPrint").show(); + } else { + $("#partAddrecPrinterIfServerPrint").hide(); + } +} + function confirmMsg (result) { if (result.status != 'OK') { var code = result.code; @@ -2336,6 +2384,12 @@ $(document).on("pageinit", "#admin-page", function () {
+ +
+
+ +
+
diff --git a/webapp/paydesk.html b/webapp/paydesk.html index 80c1ba2..cb67bb5 100644 --- a/webapp/paydesk.html +++ b/webapp/paydesk.html @@ -5,7 +5,7 @@ - + @@ -13,7 +13,7 @@ +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 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 tminfo=null;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;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='
  • Module
  • ';$.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")})}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}}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 genCreateReceiptHeader(b,e,h,f,k){var a='style="border: solid black 0px;padding: 3px;text-align:right;vertical-align:bottom;"';var i=P_TABLE[b]+" "+h;var c=P_WAITER[b]+" "+f;var g="";g+=" ";g+=""+i+' ID:"+e+"";g+=' ";g+=""+c+"";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 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 generateOneProdLine(l,h,k,a,o,f){var b='style="border: solid black 0px;padding: 3px;text-align:right;vertical-align:bottom;"';var i='style="border: solid black 0px;padding: 3px;text-align:center;vertical-align:bottom;"';var c=(parseFloat(k)).toFixed(2).replace(".",o);if(a!="A"){h+=" ("+a+")"}if(f==1){h="To-Go: "+h}var n=l*k;var g=n.toFixed(2).replace(".",o);var m="";var e='style="white-space: nowrap;overflow: hidden;text-overflow:ellipsis;width: 60%;"';m+="'+l+""+h;m=m+""+c;m+=""+n.toFixed(2).replace(".",o)+"";return m}function generateProdPart(k,b){var i=0;tablecontent="";for(i=0;i";return m}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(w,g,m,s,e,h,r){var o=[];var f="";if(r==0){f="overlaysize-0"}else{if(r==1){f="overlaysize-1"}else{if(r==2){f="overlaysize-2"}}}for(var v=0;v'+x;if(u!=0){p=''+x;if(m!=""){p+="
    ("+m+": "+k+")"}else{p+="
    ("+k+")"}}p+="
    ";o[o.length]=p}}return o};Tablemap.prototype.bindingForOverlaySelection=function(a,c,b){$(".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 closePrint(){document.body.removeChild(this.__container__)}function setAndStartPrint(){this.contentWindow.__container__=this;this.contentWindow.onbeforeunload=closePrint;this.contentWindow.onafterprint=closePrint;this.contentWindow.focus();this.contentWindow.print()}function printContent(c){var b=document.createElement("iframe");b.setAttribute("id","printiframe");b.onload=setAndStartPrint;b.style.visibility="hidden";b.style.position="fixed";b.style.right="0";b.style.bottom="0";var a=""+c+"";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
  • '+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]);$("#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(e){var c="";var a=20;if(paymentconfig==1){a=2}var b=false;$.each(e,function(g,f){if(g'+f.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,insertTMInfo,"Keine TM-Information")}function insertTMInfo(a){tminfo=a;startDisplayProcess()}function shallDisplayRoom(b){for(var a=0;a'+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);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();$("#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()}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 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;c"+$("#info-page").data("receipthtml")+"";var e=$("#info-page").data("escposheader");var p=$("#info-page").data("escposprods");var n=$("#info-page").data("escposfooter");var r=new Array(e,p,n,$("#info-page").data("hosting"));var g=cameFromOrdering;if(cameFromOrdering==1){if(workflowconfig==1){g=digigopaysetready}}$.ajax({type:"POST",dataType:"json",data:{ids:a,brutto:billbrutto,netto:billnetto,tableid:c,paymentid:q,tax:h,decpoint:decpoint,declareready:g,host:$("#info-page").data("hosting")},url:"php/contenthandler.php?module=queue&command=declarePaidCreateBillReturnBillId",async:false,success:function(w){var u=w.status;var v=w.msg;if(u!="ERROR"){billid=v.billid;billdate=v.date;if(billid<0){alert("Error! Bitte erneut versuchen. Error code: "+billid);window.location.reload(false)}else{var y=$("#info-page").data("billlanguage");$("#billid").html(P_ID[y]+billid);$("#billdate").html(billdate);if(o){var z=''+$("#receiptpart").html()+"
    ";var t=$("#info-page").data("payPrintType");if(t=="s"){printBill(billid)}else{$("#oben").hide();var x=""+$(".receipttable").html()+"
    ";printContent(x)}}prodsOnReceiptList=[];getProdsToPayForTable(c,m);var i=$("#oben li").size()-2;if(i>0){}else{if(cameFromOrdering==1){goToUrl("waiter.html")}else{goToUrl("paydesk.html")}}}}else{alert("Fehler: "+v)}},error:function(i){alert("Sorry, there was a problem! "+i)}})}function goToUrl(a){setTimeout(function(){document.location.href=a},500)}function printBill(a){doAjax("POST","php/contenthandler.php?module=printqueue&command=queueReceiptPrintJob",{billid:a,useaddrecprinter:1},null,"Druckfehler")}function bindHostButton(){$("#hostbutton").off("click").on("click",function(b){b.stopImmediatePropagation();b.preventDefault();var a=$("#info-page").data("billlanguage");if(a==0){var c=$("#info-page").data("hosting");if(c=="0"){$("#info-page").data("hosting","1")}else{$("#info-page").data("hosting","0")}createAllEntriesInReceipt()}else{if(lang==0){alert("Bewirtungsbeleg steht nur für deutsche Kassenbons zur Verfügung.")}else{if(lang==1){alert("Bewirtungsbeleg is only possible for German receipts.")}else{if(lang==2){alert("Bewirtungsbeleg se puedo usar solo para tiques alemanes.")}}}}})}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"),".");if(isNaN(a)){alert("Keine Zahl!")}else{if((parseFloat(a)>=0)&&(parseFloat(a)<=10000)){doCashInsert(a)}else{alert("Betrag muss positiv und kleiner als 10000 sein!")}}});$.mobile.changePage("#cashinsertdialog")}function startCashTakeOutProcess(){$("#cashtakeoutdialog .sure-do").off("click").on("click",function(){$.mobile.changePage("#info-page");var a=$("#moneyToTakeOut").val().replace(decpoint,".");if(isNaN(a)){alert("Keine Zahl!")}else{if((parseFloat(a)>=0)&&(parseFloat(a)<=10000)){doCashTakeOut(a)}else{alert("Betrag muss positiv und kleiner als 10000 sein!")}}});$.mobile.changePage("#cashtakeoutdialog")}function doCashInsert(a){doAjax("POST","php/contenthandler.php?module=bill&command=doCashAction",{money:a},handleCashActionResult,"Fehler Kassenaktion")}function doCashTakeOut(a){a=0-parseFloat(a);doAjax("POST","php/contenthandler.php?module=bill&command=doCashAction",{money:a},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 f2da86d..91c0dac 100644 --- a/webapp/php/admin.php +++ b/webapp/php/admin.php @@ -841,6 +841,7 @@ class Admin { $paymentconfig = $this->getConfigItemOrDefault("paymentconfig", $stmt, 0); $workflowconfig = $this->getConfigItemOrDefault("workflowconfig", $stmt, 0); + $addreceipttoprinter = $this->getConfigItemOrDefault("addreceipttoprinter", $stmt, ""); $smtphost = ""; $smtpauth = 1; @@ -889,7 +890,7 @@ class Admin { "smtphost" => $smtphost,"smtpauth" => $smtpauth,"smtpuser" => $smtpuser,"smtppass" => $smtppass,"smtpsecure" => $smtpsecure,"smtpport" => $smtpport, "webimpressum" => $webimpressum, "cancelunpaidcode" => $cancelunpaidcode, "discount1" => $discount1,"discount2" => $discount2,"discount3" => $discount3, "austria" => $austria, "digigopaysetready" => $digigopaysetready, "waitergopayprint" => $waitergopayprint, - "paydeskid" => $paydeskid, "aeskey" => $aeskey, "certificatesn" => $certificatesn + "paydeskid" => $paydeskid, "aeskey" => $aeskey, "certificatesn" => $certificatesn, "addreceipttoprinter" => $addreceipttoprinter ); if ($forHtml) { @@ -986,7 +987,7 @@ class Admin { $view = "preferences.html"; } - echo json_encode($view . "?v=1.2.0"); + echo json_encode($view . "?v=1.2.1"); } } @@ -1200,19 +1201,19 @@ class Admin { $right_rating = $_SESSION['right_rating']; if (!self::isOnlyRatingUser($rights, $right_rating, true)) { - if ($_SESSION['right_waiter']) { $mainMenu[] = array("name" => $waitertxt[$lang], "link" => "waiter.html?v=1.2.0"); }; - if ($_SESSION['right_kitchen']) { $mainMenu[] = array("name" => $kitchentxt[$lang], "link" => "kitchen.html?v=1.2.0"); }; - if ($_SESSION['right_bar']) { $mainMenu[] = array("name" => "Bar", "link" => "bar.html?v=1.2.0"); }; - if ($_SESSION['right_supply']) { $mainMenu[] = array("name" => $supplytxt[$lang], "link" => "supplydesk.html?v=1.2.0"); }; - if ($_SESSION['right_paydesk']) { $mainMenu[] = array("name" => $paydesktxt[$lang], "link" => "paydesk.html?v=1.2.0"); }; - if ($_SESSION['right_statistics']) { $mainMenu[] = array("name" => $stattxt[$lang], "link" => "reports.html?v=1.2.0"); }; - if ($_SESSION['right_bill']) { $mainMenu[] = array("name" => $bontxt[$lang], "link" => "bill.html?v=1.2.0"); }; - if ($_SESSION['right_products']) { $mainMenu[] = array("name" => $prodtxt[$lang], "link" => "products.html?v=1.2.0"); }; - if ($_SESSION['right_reservation']) { $mainMenu[] = array("name" => $restxt[$lang], "link" => "reservation.html?v=1.2.0"); }; - if ($_SESSION['right_rating']) { $mainMenu[] = array("name" => $ratingtxt[$lang], "link" => "rating.html?v=1.2.0"); }; - if ($_SESSION['right_manager'] || $_SESSION['is_admin'] || $_SESSION['right_closing']) { $mainMenu[] = array("name" => $admintxt[$lang], "link" => "manager.html?v=1.2.0"); }; - $mainMenu[] = array("name" => $settingtxt[$lang], "link" => "preferences.html?v=1.2.0"); - $mainMenu[] = array("name" => "Feedback", "link" => "feedback.html?v=1.2.0"); + if ($_SESSION['right_waiter']) { $mainMenu[] = array("name" => $waitertxt[$lang], "link" => "waiter.html?v=1.2.1"); }; + if ($_SESSION['right_kitchen']) { $mainMenu[] = array("name" => $kitchentxt[$lang], "link" => "kitchen.html?v=1.2.1"); }; + if ($_SESSION['right_bar']) { $mainMenu[] = array("name" => "Bar", "link" => "bar.html?v=1.2.1"); }; + if ($_SESSION['right_supply']) { $mainMenu[] = array("name" => $supplytxt[$lang], "link" => "supplydesk.html?v=1.2.1"); }; + if ($_SESSION['right_paydesk']) { $mainMenu[] = array("name" => $paydesktxt[$lang], "link" => "paydesk.html?v=1.2.1"); }; + if ($_SESSION['right_statistics']) { $mainMenu[] = array("name" => $stattxt[$lang], "link" => "reports.html?v=1.2.1"); }; + if ($_SESSION['right_bill']) { $mainMenu[] = array("name" => $bontxt[$lang], "link" => "bill.html?v=1.2.1"); }; + if ($_SESSION['right_products']) { $mainMenu[] = array("name" => $prodtxt[$lang], "link" => "products.html?v=1.2.1"); }; + if ($_SESSION['right_reservation']) { $mainMenu[] = array("name" => $restxt[$lang], "link" => "reservation.html?v=1.2.1"); }; + if ($_SESSION['right_rating']) { $mainMenu[] = array("name" => $ratingtxt[$lang], "link" => "rating.html?v=1.2.1"); }; + if ($_SESSION['right_manager'] || $_SESSION['is_admin'] || $_SESSION['right_closing']) { $mainMenu[] = array("name" => $admintxt[$lang], "link" => "manager.html?v=1.2.1"); }; + $mainMenu[] = array("name" => $settingtxt[$lang], "link" => "preferences.html?v=1.2.1"); + $mainMenu[] = array("name" => "Feedback", "link" => "feedback.html?v=1.2.1"); } $mainMenu[] = array("name" => $logout[$lang], "link" => "logout.php"); @@ -1221,7 +1222,7 @@ class Admin { $waiterMessage = $this->getMessage(null, "waitermessage"); } // CAUTION: change version also in config.txt!!! - $mainMenuAndVersion = array ("version" => "OrderSprinter 1.2.0", + $mainMenuAndVersion = array ("version" => "OrderSprinter 1.2.1", "user" => $currentUser, "menu" => $mainMenu, "waitermessage" => $waiterMessage, @@ -1437,6 +1438,7 @@ class Admin { "receiveremail" => array("dbcol" => "receiveremail","checknum" => 0), "payprinttype" => array("dbcol" => "payprinttype","checknum" => 0), "paymentconfig" => array("dbcol" => "paymentconfig","checknum" => 0), + "addreceipttoprinter" => array("dbcol" => "addreceipttoprinter", "checknum" => 0), "bigfontworkreceipt" => array("dbcol" => "bigfontworkreceipt","checknum" => 0), "prominentsearch" => array("dbcol" => "prominentsearch","checknum" => 0), "discount1" => array("dbcol" => "discount1","checknum" => 0), @@ -1479,6 +1481,12 @@ class Admin { } } + if ($name == 'addreceipttoprinter') { + if ((((string)$aVal) == "0") || (!is_numeric($aVal))) { + $aVal = null; + } + } + if ($name == "remoteaccesscode") { if (((string)$aVal) == "") { $aVal = null; diff --git a/webapp/php/printqueue.php b/webapp/php/printqueue.php index 6439009..5d8bdf4 100644 --- a/webapp/php/printqueue.php +++ b/webapp/php/printqueue.php @@ -47,7 +47,11 @@ class PrintQueue { } else if ($command == 'deletePrintJob') { $this->deletePrintJob($_POST['pass'],$_POST['id']); } else if ($command == 'queueReceiptPrintJob') { - $this->queueReceiptPrintJob($_POST['billid']); + if (isset($_POST['useaddrecprinter'])) { + $this->queueReceiptPrintJob($_POST['billid'],$_POST['useaddrecprinter']); + } else { + $this->queueReceiptPrintJob($_POST['billid'],0); + } } else if ($command == 'queueClosingSummary') { $this->queueClosingSummary($_GET['closingid']); } else if ($command == 'testConnection') { @@ -112,8 +116,8 @@ class PrintQueue { $jobs = array(); for ($printer=1;$printer<7;$printer++) { - // bills: - $sql = "SELECT count(id) as count FROM %printjobs% WHERE printer=?"; + // REM* bills: + $sql = "SELECT count(id) as count FROM %printjobs% WHERE printer=? AND type != '1' AND type != '2'"; $stmt = $pdo->prepare(DbUtils::substTableAlias($sql)); $stmt->execute(array($printer)); $result = $stmt->fetchObject(); @@ -186,7 +190,7 @@ class PrintQueue { } } - function queueReceiptPrintJob($billid) { + function queueReceiptPrintJob($billid,$useaddrecprinter) { // waiter, or manager, bill, admin rights required if (!($this->userrights->hasCurrentUserRight('right_paydesk')) && !($this->userrights->hasCurrentUserRight('right_manager')) && @@ -207,15 +211,27 @@ class PrintQueue { // now get receipt info from bill table $pdo = $this->dbutils->openDbAndReturnPdo(); + // REM* check if the receipt shall be printed to an additional printer + $sql = "SELECT setting FROM %config% WHERE name=?"; + $stmt = $pdo->prepare(DbUtils::substTableAlias($sql)); + $stmt->execute(array("addreceipttoprinter")); + $row = $stmt->fetchObject(); + $addprinter = $row->setting; + + // REM* insert to normal queue: $printInsertSql = "INSERT INTO `%printjobs%` (`id` , `content`,`type`,`printer`) VALUES ( NULL,?,?,?)"; $stmt = $pdo->prepare($this->dbutils->resolveTablenamesInSqlString($printInsertSql)); $stmt->execute(array((string)($billid),'3',$printer)); + + if (!is_null($addprinter) && ($useaddrecprinter == 1)) { + // REM* schedule also to the additional receipt printer + $stmt->execute(array((string)($billid),'3',$addprinter)); + } echo json_encode("OK"); } } - public function queueClosingSummary($closingid) { if (!($this->userrights->hasCurrentUserRight('right_paydesk')) && !($this->userrights->hasCurrentUserRight('right_manager')) && diff --git a/webapp/preferences.html b/webapp/preferences.html index e982f59..1f8a2df 100644 --- a/webapp/preferences.html +++ b/webapp/preferences.html @@ -5,7 +5,7 @@ - + diff --git a/webapp/products.html b/webapp/products.html index 1bb6691..e53a211 100644 --- a/webapp/products.html +++ b/webapp/products.html @@ -7,7 +7,7 @@ - + diff --git a/webapp/rating.html b/webapp/rating.html index 37c02e4..8ca2b8a 100644 --- a/webapp/rating.html +++ b/webapp/rating.html @@ -7,7 +7,7 @@ - + diff --git a/webapp/reports.html b/webapp/reports.html index 673198c..8da5554 100644 --- a/webapp/reports.html +++ b/webapp/reports.html @@ -7,7 +7,7 @@ - + diff --git a/webapp/reservation.html b/webapp/reservation.html index ff6ddae..58ee398 100644 --- a/webapp/reservation.html +++ b/webapp/reservation.html @@ -5,7 +5,7 @@ - + diff --git a/webapp/supplydesk.html b/webapp/supplydesk.html index c60d199..3637dc0 100644 --- a/webapp/supplydesk.html +++ b/webapp/supplydesk.html @@ -5,7 +5,7 @@ - + diff --git a/webapp/waiter.html b/webapp/waiter.html index b331b45..b2ddad4 100644 --- a/webapp/waiter.html +++ b/webapp/waiter.html @@ -4,7 +4,7 @@ - +