diff --git a/javaprinter/javaprinter.jar b/javaprinter/javaprinter.jar index 79cd452..1d17852 100644 Binary files a/javaprinter/javaprinter.jar and b/javaprinter/javaprinter.jar differ diff --git a/printserver/OrderSprinterPrintserver.exe b/printserver/OrderSprinterPrintserver.exe index 66aa48a..30d16de 100644 Binary files a/printserver/OrderSprinterPrintserver.exe and b/printserver/OrderSprinterPrintserver.exe differ diff --git a/webapp/OrderSprinterPrintserver.exe b/webapp/OrderSprinterPrintserver.exe index 66aa48a..30d16de 100644 Binary files a/webapp/OrderSprinterPrintserver.exe and b/webapp/OrderSprinterPrintserver.exe differ diff --git a/webapp/bar.html b/webapp/bar.html index e9104de..3838ce9 100644 --- a/webapp/bar.html +++ b/webapp/bar.html @@ -5,7 +5,7 @@ - + diff --git a/webapp/bill.html b/webapp/bill.html index bfb63b4..c28aeff 100644 --- a/webapp/bill.html +++ b/webapp/bill.html @@ -5,7 +5,7 @@ - + diff --git a/webapp/feedback.html b/webapp/feedback.html index 748ef88..cc40268 100644 --- a/webapp/feedback.html +++ b/webapp/feedback.html @@ -4,7 +4,7 @@ - + diff --git a/webapp/img/printerstatus.png b/webapp/img/printerstatus.png new file mode 100644 index 0000000..9a780a5 Binary files /dev/null and b/webapp/img/printerstatus.png differ diff --git a/webapp/index.html b/webapp/index.html index 3c7af42..b6fb938 100644 --- a/webapp/index.html +++ b/webapp/index.html @@ -7,8 +7,8 @@ - - + + diff --git a/webapp/install.html b/webapp/install.html index c784530..a3516cd 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 8c46f78..9cc00c2 100644 --- a/webapp/install/installer.php +++ b/webapp/install/installer.php @@ -1132,8 +1132,7 @@ return false; $adminCl = new Admin(); DbUtils::overrulePrefix($prefix); -$rect = $this->getDefaultCustomRecTemplate(); - +$rect = $this->getDefaultCustomRecTemplate(); $sql = "INSERT INTO `%config%` (`id` , `name`, `setting`) VALUES (NULL,?,?)"; $stmt = $pdo->prepare($this->basedb->resolveTablenamesInSqlString($sql)); $stmt->execute(array('rectemplate',$rect)); @@ -1255,6 +1254,35 @@ return true; } catch (PDOException $e) { return false; } +} + +function updateUserTable1201_1202($prefix, $version, $dbname) { +$pdo = $this->pdo; +try { +if ($version != "1.2.1") { +$ret = $this->updateUserTable1200_1201($prefix, $version, $dbname); +if (!$ret) { +return false; +} +} + +DbUtils::overrulePrefix($prefix); + +$foodTemplate = $this->getDefaultWorkTemplateFood(); +$sql = "INSERT INTO `%config%` (`id` , `name`, `setting`) VALUES (NULL,?,?)"; +$stmt = $pdo->prepare($this->basedb->resolveTablenamesInSqlString($sql)); +$stmt->execute(array('foodtemplate',$foodTemplate)); + +$drinkTemplate = $this->getDefaultWorkTemplateDrinks(); +$sql = "INSERT INTO `%config%` (`id` , `name`, `setting`) VALUES (NULL,?,?)"; +$stmt = $pdo->prepare($this->basedb->resolveTablenamesInSqlString($sql)); +$stmt->execute(array('drinktemplate',$drinkTemplate)); + +$this->updateVersion($pdo, '1.2.2'); +return true; +} catch (PDOException $e) { +return false; +} } function setVersion($prefix,$theVersion) { @@ -1283,6 +1311,30 @@ $rect .= "f: ; E_Summe:llllllllllllllllllll;\n\nj:l;"; return $rect; } +function getDefaultWorkTemplateFood() { +$rect = "SS:Speisen\nt:v\nz:v\n"; +$rect .= "\n"; +$rect .= "START_WORK\n"; +$rect .= "f:-;\n"; +$rect .= "N:v;\ns: ;b:v;\n"; +$rect .= "e:v\n"; +$rect .= "END_WORK\n"; +$rect .= "f:-"; +return $rect; +} + +function getDefaultWorkTemplateDrinks() { +$rect = "SS:Getränke\nt:v\nz:v\n"; +$rect .= "\n"; +$rect .= "START_WORK\n"; +$rect .= "f:-;\n"; +$rect .= "N:v;\ns: ;b:v;\n"; +$rect .= "e:v\n"; +$rect .= "END_WORK\n"; +$rect .= "f:-"; +return $rect; +} + function createTables($decpoint,$billlanguage,$currency,$timezone) { $pdo = $this->pdo; @@ -1318,6 +1370,8 @@ $this->basedb->createExtrasprodsTable($pdo); $this->basedb->createQueueExtrasTable($pdo); $rect = $this->getDefaultCustomRecTemplate(); +$foodtemplate = $this->getDefaultWorkTemplateFood(); +$drinktemplate = $this->getDefaultWorkTemplateDrinks(); $printpass = md5("123"); @@ -1332,6 +1386,8 @@ $this->basedb->doSQL($pdo,"INSERT INTO `%config%` (`id` , `name`, `setting`) VAL $this->basedb->doSQL($pdo,"INSERT INTO `%config%` (`id` , `name`, `setting`) VALUES (NULL , 'printpass', '$printpass')"); $this->basedb->doSQL($pdo,"INSERT INTO `%config%` (`id` , `name`, `setting`) VALUES (NULL , 'companyinfo', 'Musterrestaurant\nBeispielstrasse 123\n12345 Musterort')"); $this->basedb->doSQL($pdo,"INSERT INTO `%config%` (`id` , `name`, `setting`) VALUES (NULL , 'rectemplate', '$rect')"); +$this->basedb->doSQL($pdo,"INSERT INTO `%config%` (`id` , `name`, `setting`) VALUES (NULL , 'foodtemplate', '$foodtemplate')"); +$this->basedb->doSQL($pdo,"INSERT INTO `%config%` (`id` , `name`, `setting`) VALUES (NULL , 'drinktemplate', '$drinktemplate')"); $resTxt = 'Vielen Dank für Ihre Reservierung am DATUM um ZEIT Uhr für ANZAHL Personen.\n\nWir freuen uns auf Ihren Besuch!\n\nBETRIEBSINFO'; $this->basedb->doSQL($pdo,"INSERT INTO `%config%` (`id` , `name`, `setting`) VALUES (NULL , 'reservationnote', '$resTxt')"); $this->basedb->doSQL($pdo,"INSERT INTO `%config%` (`id` , `name`, `setting`) VALUES (NULL , 'serverurl', '')"); @@ -1341,7 +1397,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.1')"); +$this->basedb->doSQL($pdo,"INSERT INTO `%config%` (`id` , `name`, `setting`) VALUES (NULL , 'version', '1.2.2')"); $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')"); @@ -1612,15 +1668,15 @@ $stmt->execute(array(6,76,22)); if ($workflow == 2) { // only receipts - no views kitchen,bar,supply -$this->insertUser($waiterTxt[$lang],$adminpass,0,1,0,0,0,1,0,1,0,0,0,1,0,$lang,1); +$this->insertUser($waiterTxt[$lang],$adminpass,0,1,0,0,0,1,0,1,0,0,0,0,1,0,$lang,1); if ($level == 3) { -$this->insertUser($bossTxt[$lang],$adminpass ,0,1,0,0,0,1,1,1,1,1,1,1,1,$lang,1); +$this->insertUser($bossTxt[$lang],$adminpass ,0,1,0,0,0,1,1,1,1,1,1,1,1,1,$lang,1); } } else { -$this->insertUser($waiterTxt[$lang],$adminpass,0,1,0,0,1,1,0,1,0,0,0,1,0,$lang,1); +$this->insertUser($waiterTxt[$lang],$adminpass,0,1,0,0,1,1,0,1,0,0,0,0,1,0,$lang,1); if ($level == 3) { -$this->insertUser($cookTxt[$lang],$adminpass ,0,0,1,1,1,0,0,0,0,0,0,0,0,$lang,1); -$this->insertUser($bossTxt[$lang],$adminpass ,0,1,1,1,1,1,1,1,1,1,1,1,1,$lang,1); +$this->insertUser($cookTxt[$lang],$adminpass ,0,0,1,1,1,0,0,0,0,0,0,0,0,0,$lang,1); +$this->insertUser($bossTxt[$lang],$adminpass ,0,1,1,1,1,1,1,1,1,1,1,1,1,1,$lang,1); } } @@ -1677,7 +1733,7 @@ echo json_encode("Fehler: Ist OpenSSL richtig installiert?"); return; } -$admin->insertUser("admin",$_POST['adminpass'],1,0,0,0,0,0,0,0,0,1,1,0,0,$_POST['lang'],1); +$admin->insertUser("admin",$_POST['adminpass'],1,0,0,0,0,0,0,0,0,1,1,1,0,0,$_POST['lang'],1); $admin->writeConfigFile($_POST['host'],$_POST['db'],$_POST['user'],$_POST['password'],$_POST['prefix']); if(session_id() == '') { session_start(); @@ -1706,7 +1762,7 @@ $zones[] = $timezone_identifiers[$i]; } echo json_encode($zones); } else if ($command == 'update') { -$installerVersion = "1.2.1"; +$installerVersion = "1.2.2"; $admin = new InstallAdmin(); $pdo = $admin->openDbAndReturnPdo($_POST['host'],$_POST['db'],$_POST['user'],$_POST['password']); @@ -1736,7 +1792,7 @@ $supportedVersions = array("1.0.22","1.0.23","1.0.24","1.0.25","1.0.26","1.0.27" "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.2.0" +"1.2.0","1.2.1" ); if (!in_array($version, $supportedVersions)) { @@ -1744,7 +1800,7 @@ echo json_encode("Quellversion nicht unterstützt"); return; } -$ret = $admin->updateUserTable1200_1201($_POST['prefix'], $version, $_POST['db']); +$ret = $admin->updateUserTable1201_1202($_POST['prefix'], $version, $_POST['db']); if(session_id() == '') { session_start(); diff --git a/webapp/kitchen.html b/webapp/kitchen.html index d427a74..661034f 100644 --- a/webapp/kitchen.html +++ b/webapp/kitchen.html @@ -5,7 +5,7 @@ - + diff --git a/webapp/manager.html b/webapp/manager.html index cafb3bd..8398bd1 100644 --- a/webapp/manager.html +++ b/webapp/manager.html @@ -5,7 +5,7 @@ - + @@ -197,6 +197,12 @@ var MAN_WORKFLOW_WR_AND_TRANSFER_HLP = ["Hinweis: 'Arbeitsbons mit Serverübermi var MAN_RECTEMPLATE_HINT = ["Hinweis: Die Anpassung der Bonvorlage ist in der Anleitung und auf der Produktwebseite beschrieben.", "Hint: The customization of the receipt template is described in the manual and on the product home page.", "Nota: La adapción del template esta explicada en la página web y el manual."]; +var MAN_FOODTEMPLATE_HINT = ["Hinweis: Die Anpassung der Bonvorlage ist in der Anleitung und auf der Produktwebseite beschrieben.", + "Hint: The customization of the receipt template is described in the manual and on the product home page.", + "Nota: La adapción del template esta explicada en la página web y el manual."]; +var MAN_DRINKTEMPLATE_HINT = ["Hinweis: Die Anpassung der Bonvorlage ist in der Anleitung und auf der Produktwebseite beschrieben.", + "Hint: The customization of the receipt template is described in the manual and on the product home page.", + "Nota: La adapción del template esta explicada en la página web y el manual."]; var MAN_NO_ADMIN = ["Um Admin-Rechte zu bearbeiten, muss der Benutzer selbst Adminrechte besitzen.", "Modifying admin rights require that the changing user has also admin rights.", "Necesitas derecho de admin para modificar derecho de admin para otros usarios."]; var MAN_NO_ADMIN_CREATE = ["Nur Admin-Benutzer können andere Admin-Benutzer anlegen", "Only admin users can create other admin users", @@ -284,7 +290,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,0]; var numberOfClosings = 0; @@ -296,7 +302,9 @@ var generalValuesSettings = [ ["stornocode","Stornocode","i",1,"Stornocode wurde nicht angegeben!"], ["printpass","Printcode","i",1,"Printcode wurde nicht angegeben"], ["companyinfo","Betriebsinfo","i",0], - ["rectemplate","Bonvorlage","i",0], + ["rectemplate","Bonvorlage ","i",0], + ["foodtemplate","Arb.bonvorlage Speisen","i",0], + ["drinktemplate","Arb.bonvorlage Getränke","i",0], ["serverUrl","Serveradresse","i",0], ["email","Emailadresse","i",0], ["emailbadrating","Emailadresse schlechte Bewertung","i",0], @@ -432,6 +440,8 @@ function setLanguage(l) { $("#taxusage").html("(" + MAN_TAX_USE[l] + ")"); $("#rectemplatehint").html(MAN_RECTEMPLATE_HINT[l]); + $("#foodtemplatehint").html(MAN_FOODTEMPLATE_HINT[l]); + $("#drinktemplatehint").html(MAN_DRINKTEMPLATE_HINT[l]); } function createMonthSelection(label) { @@ -495,6 +505,8 @@ function insertGeneralConfigItems(configResult) { $("#companyinfo").val(values.companyinfo); $("#rectemplate").val(values.rectemplate); + $("#foodtemplate").val(values.foodtemplate); + $("#drinktemplate").val(values.drinktemplate); $("#reservationnote").val(values.reservationnote); @@ -510,6 +522,9 @@ function insertGeneralConfigItems(configResult) { generalVals[3] = values.paymentconfig; generalVals[4] = values.workflowconfig; generalVals[16] = values.addreceipttoprinter; + if ((values.addreceipttoprinter == "") || (values.addreceipttoprinter == null)) { + generalVals[16] = 0; + } $("#partOfPayPrintType").html(createPayPrintTypePart(payPrintType)); $("#partOfPaymentConfig").html(createPaymentConfigPart(values.paymentconfig)); @@ -625,7 +640,7 @@ function createAddRecPrinterPart(value) { var html = '
'; html += ''; html += ' Hinweis: siehe Anleitung
+
+ + + Hinweis: siehe Anleitung +
+
+ + + Hinweis: siehe Anleitung +
diff --git a/webapp/paydesk.html b/webapp/paydesk.html index cb67bb5..54a8331 100644 --- a/webapp/paydesk.html +++ b/webapp/paydesk.html @@ -5,7 +5,7 @@ - + diff --git a/webapp/php/admin.php b/webapp/php/admin.php index 91c0dac..b7fec7e 100644 --- a/webapp/php/admin.php +++ b/webapp/php/admin.php @@ -716,6 +716,14 @@ class Admin { $row = $stmt->fetchObject(); $rectemplate = $row->setting; + $stmt->execute(array("foodtemplate")); + $row = $stmt->fetchObject(); + $foodtemplate = $row->setting; + + $stmt->execute(array("drinktemplate")); + $row = $stmt->fetchObject(); + $drinktemplate = $row->setting; + $stmt->execute(array("decpoint")); $row = $stmt->fetchObject(); $decpoint = $row->setting; @@ -879,7 +887,8 @@ class Admin { date_default_timezone_set(DbUtils::getTimeZone()); $now = getdate(); - $retVal = array("companyinfo" => $companyInfo, "rectemplate" => $rectemplate, "version" => $version, "decpoint" => $decpoint, + $retVal = array("companyinfo" => $companyInfo, "rectemplate" => $rectemplate, "foodtemplate" => $foodtemplate, "drinktemplate" => $drinktemplate, + "version" => $version, "decpoint" => $decpoint, "serverurl" => $serverurl, "email" => $email, "receiveremail" => $receiveremail, "billlanguage" => $billlanguage, "payprinttype" => $payprinttype, "tax" => $tax, "togotax" => $togotax, "currency" => $currency, "userlanguage" => $userlang, "receiptprinter" => $receiptprinter, @@ -987,7 +996,7 @@ class Admin { $view = "preferences.html"; } - echo json_encode($view . "?v=1.2.1"); + echo json_encode($view . "?v=1.2.2"); } } @@ -1201,19 +1210,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.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"); + if ($_SESSION['right_waiter']) { $mainMenu[] = array("name" => $waitertxt[$lang], "link" => "waiter.html?v=1.2.2"); }; + if ($_SESSION['right_kitchen']) { $mainMenu[] = array("name" => $kitchentxt[$lang], "link" => "kitchen.html?v=1.2.2"); }; + if ($_SESSION['right_bar']) { $mainMenu[] = array("name" => "Bar", "link" => "bar.html?v=1.2.2"); }; + if ($_SESSION['right_supply']) { $mainMenu[] = array("name" => $supplytxt[$lang], "link" => "supplydesk.html?v=1.2.2"); }; + if ($_SESSION['right_paydesk']) { $mainMenu[] = array("name" => $paydesktxt[$lang], "link" => "paydesk.html?v=1.2.2"); }; + if ($_SESSION['right_statistics']) { $mainMenu[] = array("name" => $stattxt[$lang], "link" => "reports.html?v=1.2.2"); }; + if ($_SESSION['right_bill']) { $mainMenu[] = array("name" => $bontxt[$lang], "link" => "bill.html?v=1.2.2"); }; + if ($_SESSION['right_products']) { $mainMenu[] = array("name" => $prodtxt[$lang], "link" => "products.html?v=1.2.2"); }; + if ($_SESSION['right_reservation']) { $mainMenu[] = array("name" => $restxt[$lang], "link" => "reservation.html?v=1.2.2"); }; + if ($_SESSION['right_rating']) { $mainMenu[] = array("name" => $ratingtxt[$lang], "link" => "rating.html?v=1.2.2"); }; + if ($_SESSION['right_manager'] || $_SESSION['is_admin'] || $_SESSION['right_closing']) { $mainMenu[] = array("name" => $admintxt[$lang], "link" => "manager.html?v=1.2.2"); }; + $mainMenu[] = array("name" => $settingtxt[$lang], "link" => "preferences.html?v=1.2.2"); + $mainMenu[] = array("name" => "Feedback", "link" => "feedback.html?v=1.2.2"); } $mainMenu[] = array("name" => $logout[$lang], "link" => "logout.php"); @@ -1222,7 +1231,7 @@ class Admin { $waiterMessage = $this->getMessage(null, "waitermessage"); } // CAUTION: change version also in config.txt!!! - $mainMenuAndVersion = array ("version" => "OrderSprinter 1.2.1", + $mainMenuAndVersion = array ("version" => "OrderSprinter 1.2.2", "user" => $currentUser, "menu" => $mainMenu, "waitermessage" => $waiterMessage, @@ -1431,6 +1440,8 @@ class Admin { "printpass" => array("dbcol" => "printpass","checknum" => 0), "companyinfo" => array("dbcol" => "companyinfo","checknum" => 0), "rectemplate" => array("dbcol" => "rectemplate","checknum" => 0), + "foodtemplate" => array("dbcol" => "foodtemplate","checknum" => 0), + "drinktemplate" => array("dbcol" => "drinktemplate","checknum" => 0), "serverUrl" => array("dbcol" => "serverurl","checknum" => 0), "email" => array("dbcol" => "email","checknum" => 0), "emailbadrating" => array("dbcol" => "emailbadrating","checknum" => 0), diff --git a/webapp/php/printqueue.php b/webapp/php/printqueue.php index 5d8bdf4..4f980b4 100644 --- a/webapp/php/printqueue.php +++ b/webapp/php/printqueue.php @@ -18,13 +18,12 @@ class PrintQueue { } function handleCommand($command) { + $fl = null; + if (isset($_GET['fl'])) { + $fl = $_GET['fl']; + } // these command are only allowed for user with waiter rights if ($command == 'getNextReceiptPrintJobs') { - // REM* feature level - $fl = null; - if (isset($_GET['fl'])) { - $fl = $_GET['fl']; - } if(isset($_GET['printers'])) { $this->getNextReceiptPrintJobs($_POST['pass'],$_GET['language'],$_GET['printers'],$fl); } else { @@ -34,15 +33,15 @@ class PrintQueue { $this->getNextClosingPrintJobs($_POST['pass'],$_GET['language']); } else if ($command == 'getNextFoodWorkPrintJobs') { if (isset($_GET['printer'])) { - $this->getNextFoodWorkPrintJobs($_GET['printer'],$_POST['pass']); + $this->getNextFoodWorkPrintJobs($_GET['printer'],$_POST['pass'],$fl); } else { - $this->getNextFoodWorkPrintJobs(null,$_POST['pass']); + $this->getNextFoodWorkPrintJobs(null,$_POST['pass'],$fl); } } else if ($command == 'getNextDrinkWorkPrintJobs') { if (isset($_GET['printer'])) { - $this->getNextDrinkWorkPrintJobs($_GET['printer'],$_POST['pass']); + $this->getNextDrinkWorkPrintJobs($_GET['printer'],$_POST['pass'],$fl); } else { - $this->getNextDrinkWorkPrintJobs(null,$_POST['pass']); + $this->getNextDrinkWorkPrintJobs(null,$_POST['pass'],$fl); } } else if ($command == 'deletePrintJob') { $this->deletePrintJob($_POST['pass'],$_POST['id']); @@ -98,7 +97,6 @@ class PrintQueue { public static function queueWorkPrintJob($pdo,$table,$timestamp,$prods,$kind,$printer,$username) { $table .= " ($username)"; - // REM* now create the work print job $content = json_encode(array("table" => $table, "time" => $timestamp, "products" => $prods)); $printInsertSql = "INSERT INTO `%printjobs%` (`id` , `content`,`type`,`printer`) VALUES ( NULL,?,?,?)"; @@ -116,7 +114,6 @@ class PrintQueue { $jobs = array(); for ($printer=1;$printer<7;$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)); @@ -136,7 +133,6 @@ class PrintQueue { echo json_encode(array("status" => "OK", "msg" => $jobs)); } - // REM* delete all printjobs function clearprintjobs($pdo) { if (!($this->userrights->hasCurrentUserRight('right_manager')) && !($this->userrights->hasCurrentUserRight('is_admin')) @@ -161,7 +157,6 @@ class PrintQueue { if(!($this->userrights->hasCurrentUserRight('right_bill'))) { echo json_encode(array("status" => "ERROR", "code" => ERROR_BILL_NOT_AUTHOTRIZED, "msg" => ERROR_BILL_NOT_AUTHOTRIZED_MSG)); } else { - // REM* sort it that start is <= end job id if ($start > $end) { $tmp = $end; $end = $start; @@ -174,13 +169,11 @@ class PrintQueue { $pdo = DbUtils::openDbAndReturnPdoStatic(); for($jobId=$start;$jobId <= $end;$jobId++) { - // REM* check if bill id exists $sql = "SELECT count(id) as countid FROM %bill% WHERE id=?"; $stmt = $pdo->prepare(DbUtils::substTableAlias($sql)); $stmt->execute(array($jobId)); $row =$stmt->fetchObject(); if ($row->countid == 1) { - // REM* yes, print $printInsertSql = "INSERT INTO `%printjobs%` (`id` , `content`,`type`,`printer`) VALUES ( NULL,?,?,?)"; $stmt = $pdo->prepare(DbUtils::substTableAlias($printInsertSql)); $stmt->execute(array($jobId,'3',$printer)); @@ -211,20 +204,17 @@ 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)); } @@ -382,6 +372,14 @@ class PrintQueue { } } + function getTemplate($pdo,$templatekey) { + $sql = "SELECT setting FROM %config% WHERE name=?"; + $stmt = $pdo->prepare(DbUtils::substTableAlias($sql)); + $stmt->execute(array($templatekey)); + $row =$stmt->fetchObject(); + return $row->setting; + } + function getNextReceiptPrintJobs($md5pass,$language,$printers,$fl) { $isCorrect = $this->isPasswordCorrect($md5pass,false); if ($isCorrect) { @@ -390,12 +388,7 @@ class PrintQueue { $pdo = $this->dbutils->openDbAndReturnPdo(); - // REM* get the template - $sql = "SELECT setting FROM %config% WHERE name=?"; - $stmt = $pdo->prepare(DbUtils::substTableAlias($sql)); - $stmt->execute(array("rectemplate")); - $row =$stmt->fetchObject(); - $template = $row->setting; + $template = $this->getTemplate($pdo, "rectemplate"); if (intval($language) > 2) { $genInfo = $this->admin->getGeneralConfigItems(false,$pdo); @@ -419,9 +412,8 @@ class PrintQueue { if (in_array($printer, $printersArr)) { if (is_null($fl)) { - // REM* no feature level -> do not sent template $receiptJob = array("id" => $printJobId,"bill" => $bill->getBillWithId($pdo,$aBillId,$language,$printer)); - } else if ($fl == 1) { + } else if ($fl >= 1) { $receiptJob = array("id" => $printJobId,"bill" => $bill->getBillWithId($pdo,$aBillId,$language,$printer), "template" => $template); } $billarray[] = $receiptJob; @@ -434,21 +426,27 @@ class PrintQueue { } } - function getNextFoodWorkPrintJobs($printer,$md5pass) { - $this->getNextWorkPrintJobs($md5pass,1,$printer); + function getNextFoodWorkPrintJobs($printer,$md5pass,$fl) { + $this->getNextWorkPrintJobs($md5pass,1,$printer,$fl); } - function getNextDrinkWorkPrintJobs($printer,$md5pass) { - $this->getNextWorkPrintJobs($md5pass,2,$printer); + function getNextDrinkWorkPrintJobs($printer,$md5pass,$fl) { + $this->getNextWorkPrintJobs($md5pass,2,$printer,$fl); } - function getNextWorkPrintJobs($md5pass,$theType,$printer) { + function getNextWorkPrintJobs($md5pass,$theType,$printer,$fl) { $isCorrect = $this->isPasswordCorrect($md5pass,false); if ($isCorrect) { $pdo = $this->dbutils->openDbAndReturnPdo(); $bigFontWorkReceipt = $this->getBigFontWorkReceiptSetting($pdo); + $templatekey = "foodtemplate"; + if ($theType === 2) { + $templatekey = "drinktemplate"; + } + $template = $this->getTemplate($pdo, $templatekey); + if (is_null($printer)) { $sql = "SELECT id,content,type FROM %printjobs% WHERE type=? ORDER BY id"; $stmt = $pdo->prepare($this->dbutils->resolveTablenamesInSqlString($sql)); @@ -464,7 +462,12 @@ class PrintQueue { $workarray = array(); foreach($result as $aWorkJob) { $aWork = json_decode($aWorkJob["content"]); // is in json format - $workarray[] = array("id" => $aWorkJob["id"],"content" => $aWork, "bigfontworkreceipt" => intval($bigFontWorkReceipt)); + if ($fl >= 2) { + $workarray[] = array("id" => $aWorkJob["id"],"content" => $aWork, "bigfontworkreceipt" => intval($bigFontWorkReceipt), "template" => $template); + } else { + // default without template + $workarray[] = array("id" => $aWorkJob["id"],"content" => $aWork, "bigfontworkreceipt" => intval($bigFontWorkReceipt)); + } } echo json_encode($workarray); diff --git a/webapp/preferences.html b/webapp/preferences.html index 1f8a2df..4868450 100644 --- a/webapp/preferences.html +++ b/webapp/preferences.html @@ -5,7 +5,7 @@ - + diff --git a/webapp/products.html b/webapp/products.html index e53a211..76b1b52 100644 --- a/webapp/products.html +++ b/webapp/products.html @@ -7,7 +7,7 @@ - + diff --git a/webapp/rating.html b/webapp/rating.html index 8ca2b8a..00136af 100644 --- a/webapp/rating.html +++ b/webapp/rating.html @@ -7,7 +7,7 @@ - + diff --git a/webapp/reports.html b/webapp/reports.html index 8da5554..1cb8df2 100644 --- a/webapp/reports.html +++ b/webapp/reports.html @@ -7,7 +7,7 @@ - + diff --git a/webapp/reservation.html b/webapp/reservation.html index 58ee398..c38957f 100644 --- a/webapp/reservation.html +++ b/webapp/reservation.html @@ -5,7 +5,7 @@ - + diff --git a/webapp/supplydesk.html b/webapp/supplydesk.html index 3637dc0..6583e35 100644 --- a/webapp/supplydesk.html +++ b/webapp/supplydesk.html @@ -5,7 +5,7 @@ - + diff --git a/webapp/waiter.html b/webapp/waiter.html index b2ddad4..075ea09 100644 --- a/webapp/waiter.html +++ b/webapp/waiter.html @@ -4,7 +4,7 @@ - +