OrderSprinter 1.3.10
This commit is contained in:
parent
ebbaf1a4e6
commit
e119a80cf1
Binary file not shown.
Binary file not shown.
|
@ -85,7 +85,7 @@ class Installer {
|
|||
}
|
||||
Database::dropTables($pdo);
|
||||
Database::createEmptyTables($pdo, $prefix);
|
||||
Database::setVersion($pdo,$prefix,"1.3.9");
|
||||
Database::setVersion($pdo,$prefix,"1.3.10");
|
||||
Database::setAccessPassword($pdo,$prefix,$adminpass);
|
||||
Database::setRefreshRate($pdo,$prefix,"5"); // default: 5 times per hour
|
||||
return array("status" => "OK","msg" => "Installation successful");
|
||||
|
|
Binary file not shown.
|
@ -5,7 +5,7 @@
|
|||
<meta http-equiv="content-type" content="text/html; charset=utf-8">
|
||||
<meta name="author" content="Stefan Pichel">
|
||||
|
||||
<link rel="stylesheet" type="text/css" href="css/bestformat.css?v=1.3.9">
|
||||
<link rel="stylesheet" type="text/css" href="css/bestformat.css?v=1.3.10">
|
||||
|
||||
<link rel="stylesheet" href="php/contenthandler.php?module=admin&command=getmobilecss" />
|
||||
<link rel="stylesheet" href="php/3rdparty/orderstyle/jquery.mobile.icons.min.css" />
|
||||
|
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -1 +1 @@
|
|||
html{overflow-y:scroll}.ospage{display:-webkit-flex;display:flex;-webkit-flex-flow:row wrap;flex-flow:row wrap;text-align:center;color:white}.ospage>*{padding:10px;flex:100%}.main{text-align:left;background:cornflowerblue;-webkit-flex:5;flex:5;-webkit-flex-flow:nowrap;flex-flow:nowrap}.header{background:black}.footer{display:-webkit-flex;display:flex;-webkit-justify-content:center;justify-content:center;-webkit-flex-wrap:row nowrap;flex-flow:row nowrap;background:black;-webkit-align-items:stretch;align-items:stretch}#loggedinuser{text-align:left;width:50%}#versioninfo{text-align:right;color:white;width:50%}.aside1{background:moccasin;color:black;width:0;-webkit-flex:2;flex:2}.aside2{background:violet;-webkit-flex:1;flex:1}@media all and (min-width:400px){.aside1{order:1}.main{order:2}.aside2{order:3}.ordereditem-sentcontainer{order:4}.waitermsg{order:5}.footer{order:6}}.input100{width:100%;height:50px;font-weight:bold;text-align:center}.input90{width:89%;height:50px;font-weight:bold;text-align:center}.input50{width:49%;height:50px;font-weight:bold;text-align:center}.area10{width:9%;height:50px;text-align:center}.inputwhite[type="text"]{background-color:white}.inputwhite[type="submit"]{background-color:white}.inputgreen[type="text"]{background-color:#0f0}.inputgreen[type="submit"]{background-color:#0f0}.inputblue[type="text"]{background-color:#8ee5ee}.inputblue[type="submit"]{background-color:#8ee5ee}.infoarea{width:49%;background-color:#afa;color:black;font-weight:bold;font-size:20px;display:-webkit-flex;display:flex;-webkit-justify-content:center;justify-content:center;-webkit-align-items:center;align-items:center;border:2px solid red}.mainmenuchoice{list-style-type:none;padding:0;border:1px solid #ddd}.mainmenuitem{padding:8px 16px;border-bottom:1px solid #ddd;background-color:#fff6b5;height:40px;font-size:16px;font-weight:bold}.mainmenuitem:hover{background-color:#eed33f}.commentitem:last-child{border-bottom:0}.commentitem{padding:8px 16px;border-bottom:1px solid #ddd;background-color:#fff6b5;height:40px;font-size:16px;font-weight:bold}.commentitem:last-child{border-bottom:0}#loggedinuser{color:black}.buttonarea{box-shadow:10px 10px 5px #888}
|
||||
html{overflow-y:scroll}.ospage{font-family:Helvetica,Arial,Verdana,sans-serif;display:-webkit-flex;display:flex;-webkit-flex-flow:row wrap;flex-flow:row wrap;text-align:center;color:white}.ospage>*{padding:10px;flex:100%}.main{text-align:left;background:cornflowerblue;-webkit-flex:5;flex:5;-webkit-flex-flow:nowrap;flex-flow:nowrap}.header{background:black}.footer{display:-webkit-flex;display:flex;-webkit-justify-content:center;justify-content:center;-webkit-flex-wrap:row nowrap;flex-flow:row nowrap;background:black;-webkit-align-items:stretch;align-items:stretch}#loggedinuser{text-align:left;width:50%}#versioninfo{text-align:right;color:white;width:50%}.aside1{background:moccasin;color:black;width:0;-webkit-flex:2;flex:2}.aside2{background:violet;-webkit-flex:1;flex:1}@media all and (min-width:400px){.aside1{order:1}.main{order:2}.aside2{order:3}.ordereditem-sentcontainer{order:4}.waitermsg{order:5}.footer{order:6}}.input100{width:100%;height:50px;font-weight:bold;text-align:center}.input90{width:89%;height:50px;font-weight:bold;text-align:center}.input50{width:49%;height:50px;font-weight:bold;text-align:center}.area10{width:9%;height:50px;text-align:center}.inputwhite[type="text"]{background-color:white}.inputwhite[type="submit"]{background-color:white}.inputgreen[type="text"]{background-color:#0f0}.inputgreen[type="submit"]{background-color:#0f0}.inputblue[type="text"]{background-color:#8ee5ee}.inputblue[type="submit"]{background-color:#8ee5ee}.infoarea{width:49%;background-color:#afa;color:black;font-weight:bold;font-size:20px;display:-webkit-flex;display:flex;-webkit-justify-content:center;justify-content:center;-webkit-align-items:center;align-items:center;border:2px solid red}.mainmenuchoice{list-style-type:none;padding:0;border:1px solid #ddd}.mainmenuitem{padding:8px 16px;border-bottom:1px solid #ddd;background-color:#fff6b5;height:40px;font-size:16px;font-weight:bold}.mainmenuitem:hover{background-color:#eed33f}.commentitem:last-child{border-bottom:0}.commentitem{padding:8px 16px;border-bottom:1px solid #ddd;background-color:#fff6b5;height:40px;font-size:16px;font-weight:bold}.commentitem:last-child{border-bottom:0}#loggedinuser{color:black}.buttonarea{box-shadow:10px 10px 5px #888}
|
|
@ -15,6 +15,7 @@ function newExtra(id, name, price) {
|
|||
+ "<td><input id='extraprice_" + id + "' type='text' class='extraprice'></input>"
|
||||
+ "<td><button id='delextra_" + id + "' class='extracmd'>−</button>"
|
||||
+ "<td><button id='applyextra_" + id + "' class='extracmd'>↵</button>"
|
||||
+ "<td><button id='upextra_" + id + "' class='extracmd'>↑</button>"
|
||||
+ "</tr>";
|
||||
return trline;
|
||||
} else {
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<meta http-equiv="content-type" content="text/html; charset=utf-8">
|
||||
|
||||
<link rel="stylesheet" type="text/css" href="css/bestformat.css?v=1.3.9">
|
||||
<link rel="stylesheet" type="text/css" href="css/bestformat.css?v=1.3.10">
|
||||
|
||||
<link rel="stylesheet" href="php/contenthandler.php?module=admin&command=getmobilecss" />
|
||||
<link rel="stylesheet" href="php/3rdparty/orderstyle/jquery.mobile.icons.min.css" />
|
||||
|
|
|
@ -9,8 +9,8 @@
|
|||
<meta http-equiv="content-type" content="text/html; charset=utf-8">
|
||||
<meta name="author" content="Stefan Pichel">
|
||||
|
||||
<link rel="stylesheet" type="text/css" href="css/bestformat.css?v=1.3.9">
|
||||
<link rel="stylesheet" type="text/css" href="css/numfield.css?v=1.3.9">
|
||||
<link rel="stylesheet" type="text/css" href="css/bestformat.css?v=1.3.10">
|
||||
<link rel="stylesheet" type="text/css" href="css/numfield.css?v=1.3.10">
|
||||
|
||||
<link rel="stylesheet" href="php/3rdparty/orderstyle/orderstyle.min.css" />
|
||||
<link rel="stylesheet" href="php/3rdparty/orderstyle/jquery.mobile.icons.min.css" />
|
||||
|
@ -206,7 +206,7 @@ function handleResultOfInstallCheck(is_installed) {
|
|||
if (is_installed == "Yes") {
|
||||
useInstallation();
|
||||
} else {
|
||||
setTimeout(function(){document.location.href = "install.html?v=1.3.9"},500);
|
||||
setTimeout(function(){document.location.href = "install.html?v=1.3.10"},500);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -725,7 +725,7 @@ $(document).ready(function() {
|
|||
<tr id=updateline>
|
||||
<td> </td>
|
||||
<td align=center>
|
||||
<button id="updatebtn">Update -> 1.3.9</button>
|
||||
<button id="updatebtn">Update -> 1.3.10</button>
|
||||
<span id="updateinprogresstxt" style="display:none;">Update... bitte warten.</span>
|
||||
</td>
|
||||
<td> </td>
|
||||
|
|
|
@ -2035,6 +2035,75 @@ return false;
|
|||
}
|
||||
}
|
||||
|
||||
function updateUserTable1309_1310($prefix, $version, $dbname) {
|
||||
$pdo = $this->pdo;
|
||||
try {
|
||||
if ($version != "1.3.9") {
|
||||
$ret = $this->updateUserTable1308_1309($prefix, $version, $dbname);
|
||||
if (!$ret) {
|
||||
echo "Version update v1.3.8 to 1.3.9 not successful.";
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
DbUtils::overrulePrefix($prefix);
|
||||
|
||||
$sql = "INSERT INTO `%config%` (`id` , `name`, `setting`) VALUES (NULL,?,?)";
|
||||
$stmt = $pdo->prepare($this->basedb->resolveTablenamesInSqlString($sql));
|
||||
$stmt->execute(array('closshowci','1'));
|
||||
$stmt->execute(array('closshowpaytaxes','1'));
|
||||
$stmt->execute(array('closshowprods','1'));
|
||||
|
||||
$sql = "SELECT setting FROM %config% WHERE name=?";
|
||||
$stmt = $pdo->prepare($this->basedb->resolveTablenamesInSqlString($sql));
|
||||
$stmt->execute(array("paymentconfig"));
|
||||
$row = $stmt->fetchObject();
|
||||
$paymentconfig = $row->setting;
|
||||
$sql = "INSERT INTO `%config%` (`id` , `name`, `setting`) VALUES (NULL,?,?)";
|
||||
$stmt = $pdo->prepare($this->basedb->resolveTablenamesInSqlString($sql));
|
||||
if ($paymentconfig == 0) {
|
||||
$stmt->execute(array('showpayment2','1'));
|
||||
$stmt->execute(array('showpayment3','1'));
|
||||
$stmt->execute(array('showpayment4','1'));
|
||||
$stmt->execute(array('showpayment5','1'));
|
||||
$stmt->execute(array('showpayment6','1'));
|
||||
$stmt->execute(array('showpayment7','1'));
|
||||
$stmt->execute(array('showpayment8','1'));
|
||||
} else {
|
||||
$stmt->execute(array('showpayment2','1'));
|
||||
$stmt->execute(array('showpayment3','0'));
|
||||
$stmt->execute(array('showpayment4','0'));
|
||||
$stmt->execute(array('showpayment5','0'));
|
||||
$stmt->execute(array('showpayment6','0'));
|
||||
$stmt->execute(array('showpayment7','0'));
|
||||
$stmt->execute(array('showpayment8','0'));
|
||||
}
|
||||
|
||||
$sql = "ALTER TABLE %extras% ADD sorting INT(2) NULL AFTER price";
|
||||
$stmt = $pdo->prepare(DbUtils::substTableAlias($sql));
|
||||
$stmt->execute();
|
||||
|
||||
$sql = "SELECT id FROM %extras% WHERE removed is null";
|
||||
$stmt = $pdo->prepare(DbUtils::substTableAlias($sql));
|
||||
$stmt->execute();
|
||||
$result = $stmt->fetchAll();
|
||||
$pos = 1;
|
||||
$sql = "UPDATE %extras% SET sorting=? WHERE id=?";
|
||||
$stmt = $pdo->prepare(DbUtils::substTableAlias($sql));
|
||||
foreach($result as $extraid) {
|
||||
$stmt->execute(array($pos,$extraid["id"]));
|
||||
$pos++;
|
||||
}
|
||||
|
||||
$this->updateVersion($pdo, '1.3.10');
|
||||
|
||||
return true;
|
||||
} catch (PDOException $e) {
|
||||
echo "Error in v1.3.9 to 1.3.10: $e";
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function setVersion($prefix,$theVersion) {
|
||||
$pdo = $this->pdo;
|
||||
|
@ -2161,7 +2230,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.9')");
|
||||
$this->basedb->doSQL($pdo,"INSERT INTO `%config%` (`id` , `name`, `setting`) VALUES (NULL , 'version', '1.3.10')");
|
||||
$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')");
|
||||
|
@ -2213,6 +2282,18 @@ $this->basedb->doSQL($pdo,"INSERT INTO `%config%` (`id` , `name`, `setting`) VAL
|
|||
$this->basedb->doSQL($pdo,"INSERT INTO `%config%` (`id` , `name`, `setting`) VALUES (NULL , 'discountname2', '')");
|
||||
$this->basedb->doSQL($pdo,"INSERT INTO `%config%` (`id` , `name`, `setting`) VALUES (NULL , 'discountname3', '')");
|
||||
|
||||
$this->basedb->doSQL($pdo,"INSERT INTO `%config%` (`id` , `name`, `setting`) VALUES (NULL , 'closshowci', '1')");
|
||||
$this->basedb->doSQL($pdo,"INSERT INTO `%config%` (`id` , `name`, `setting`) VALUES (NULL , 'closshowpaytaxes', '1')");
|
||||
$this->basedb->doSQL($pdo,"INSERT INTO `%config%` (`id` , `name`, `setting`) VALUES (NULL , 'closshowprods', '1')");
|
||||
|
||||
$this->basedb->doSQL($pdo,"INSERT INTO `%config%` (`id` , `name`, `setting`) VALUES (NULL , 'showpayment2', '1')");
|
||||
$this->basedb->doSQL($pdo,"INSERT INTO `%config%` (`id` , `name`, `setting`) VALUES (NULL , 'showpayment3', '1')");
|
||||
$this->basedb->doSQL($pdo,"INSERT INTO `%config%` (`id` , `name`, `setting`) VALUES (NULL , 'showpayment4', '1')");
|
||||
$this->basedb->doSQL($pdo,"INSERT INTO `%config%` (`id` , `name`, `setting`) VALUES (NULL , 'showpayment5', '1')");
|
||||
$this->basedb->doSQL($pdo,"INSERT INTO `%config%` (`id` , `name`, `setting`) VALUES (NULL , 'showpayment6', '1')");
|
||||
$this->basedb->doSQL($pdo,"INSERT INTO `%config%` (`id` , `name`, `setting`) VALUES (NULL , 'showpayment7', '1')");
|
||||
$this->basedb->doSQL($pdo,"INSERT INTO `%config%` (`id` , `name`, `setting`) VALUES (NULL , 'showpayment8', '1')");
|
||||
|
||||
// prepare for later inconsistency check if version is obsolete
|
||||
date_default_timezone_set($timezone);
|
||||
$installDate = date('Y-m-d H:i:s');
|
||||
|
@ -2549,7 +2630,7 @@ $zones[] = $timezone_identifiers[$i];
|
|||
}
|
||||
echo json_encode($zones);
|
||||
} else if ($command == 'update') {
|
||||
$installerVersion = "1.3.9";
|
||||
$installerVersion = "1.3.10";
|
||||
|
||||
$admin = new InstallAdmin();
|
||||
$pdo = $admin->openDbAndReturnPdo($_POST['host'],$_POST['db'],$_POST['user'],$_POST['password']);
|
||||
|
@ -2579,7 +2660,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.3.8"
|
||||
"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","1.3.9"
|
||||
);
|
||||
|
||||
if (!in_array($version, $supportedVersions)) {
|
||||
|
@ -2587,7 +2668,7 @@ echo json_encode("Quellversion nicht unterstützt");
|
|||
return;
|
||||
}
|
||||
|
||||
$ret = $admin->updateUserTable1308_1309($_POST['prefix'], $version, $_POST['db']);
|
||||
$ret = $admin->updateUserTable1309_1310($_POST['prefix'], $version, $_POST['db']);
|
||||
|
||||
if(session_id() == '') {
|
||||
session_start();
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
<meta http-equiv="content-type" content="text/html; charset=utf-8">
|
||||
<meta name="author" content="Stefan Pichel">
|
||||
|
||||
<link rel="stylesheet" type="text/css" href="css/bestformat.css?v=1.3.9">
|
||||
<link rel="stylesheet" type="text/css" href="css/bestformat.css?v=1.3.10">
|
||||
|
||||
<link rel="stylesheet" href="php/contenthandler.php?module=admin&command=getmobilecss" />
|
||||
<link rel="stylesheet" href="php/3rdparty/orderstyle/jquery.mobile.icons.min.css" />
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
<meta http-equiv="content-type" content="text/html; charset=utf-8">
|
||||
<meta name="author" content="Stefan Pichel">
|
||||
|
||||
<link rel="stylesheet" type="text/css" href="css/bestformat.css?v=1.3.9">
|
||||
<link rel="stylesheet" type="text/css" href="css/bestformat.css?v=1.3.10">
|
||||
|
||||
<link rel="stylesheet" href="php/contenthandler.php?module=admin&command=getmobilecss" />
|
||||
<link rel="stylesheet" href="php/3rdparty/orderstyle/jquery.mobile.icons.min.css" />
|
||||
|
@ -333,9 +333,21 @@ var MAN_PRINT_AND_QUEUE = ["Drucke Jobs und zeige sie auch in der Küchen-/Baran
|
|||
var MAN_CASH = ["Kassenfunktion aktiviert","Enabled cash function","Caja activada"];
|
||||
var MAN_RETURNTOORDER = ["Rücksprung Bestellung","Go back to order","Volver a ordenar"];
|
||||
var MAN_BEEP_COOKED = ["Signalton, wenn neues Produkt serviert werden kann (experimentell)","Audio signal if new product can be served (experimental)","Señal audio si un producto nuevo esta cocinado"];
|
||||
var MAN_CLOSSHOWCI = ["Betriebsinfo auf Tagesabschlussbon","Print company info on closing receipt","Imprimir info del café en el cerramiento"];
|
||||
var MAN_CLOSSHOWPAYTAXES = ["Individuelle Steuerbeträge pro Zahlungsweg auf Tagesabschluss","Print each tax per payment way on closing","Imprimir cada impuesto por cada camino de pagar en el cerramiento"];
|
||||
var MAN_CLOSSHOWPRODS = ["Produktstatistik auf Tagesabschlussbon","Product statistics on closung","Statistica de productos en el cerramiento"];
|
||||
var MAN_SHOWPAYMENT2 = ["EC-Karte","EC card","EC"];
|
||||
var MAN_SHOWPAYMENT3 = ["Kreditkarten","credit card","tarjeta de credito"];
|
||||
var MAN_SHOWPAYMENT4 = ["Rechnung","Bill","Factura"];
|
||||
var MAN_SHOWPAYMENT5 = ["Überweisung","Transfer","transferencia"];
|
||||
var MAN_SHOWPAYMENT6 = ["Lastschrift","debitsCard","Débito"];
|
||||
var MAN_SHOWPAYMENT7 = ["Hotelzimmer","Hotel room","Habitación"];
|
||||
var MAN_SHOWPAYMENT8 = ["Gast","Guest","Huésped"];
|
||||
var MAN_RESTAURANT_MODE = ["Restaurantmodus","Restaurant mode","Usar para restaurantes"];
|
||||
var MAN_REST_MODE_HINT = ["Hinweis: Wird der Restaurantmodus auf <i>Nein</i> gesetzt, wird in der <b>Desktopansicht</b> die Tischauswahl deaktiviert. Alle Produkte werden als Außer-Haus-Verkauf gebucht.","Hint: If the restautant mode is set to <i>no</i> in the <b>desktop view</b> the table selection is deactivated and all products are ordered as <i>to-go</i>","Nota: Si el modus del restaurante es configurado a <i>no</i> en la vista de <b>Desktop</b> la selección de las mesas es deactivada y todos los productos son ordenados como <i>to-go</i>"];
|
||||
var MAN_SPECIAL_SETTINGS_TXT = ["Einstellungen für spezielle Abläufe:","Settings for special workflows:","Configuración para workflows muy escpeciales:"];
|
||||
var MAN_PRINT_ON_CLOSINGS = ["Tageserfassungsbons","Closing receipts","Tiques de cerramiento"];
|
||||
var MAN_SHOW_PAYMENTS_DLG = ["Zahlungswege im Zahldialog","Payment ways in payment dialog","Que modos de pagar"];
|
||||
var MAN_ROOMCHANGE_WARNING = ["Alten Raumplan löschen und neuen festlegen? Bestellungen offener Tische gehen verloren!","Replace room map? Orders of open tables will be lost!","Sustituir mapa de mesas? Orders de mesas abiertas van a ser borradas!"];
|
||||
|
||||
var MAN_HOTELINTERFACE = ["Anbindung Hotelsoftware","Interface hotel software","Conección programa de hotel"];
|
||||
|
@ -350,7 +362,7 @@ var MAN_CLOSING_TIME_LIMIT_ERROR = ["Ein Tagesabschluss wurde nicht erzeugt, wei
|
|||
|
||||
|
||||
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];
|
||||
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, 1,1,1,1,1,1,1,1,1,1];
|
||||
|
||||
var numberOfClosings = 0;
|
||||
|
||||
|
@ -392,6 +404,19 @@ var generalValuesSettings = [
|
|||
["printandqueuejobs",MAN_PRINT_AND_QUEUE[lang],"s",19],
|
||||
["cashenabled",MAN_CASH[lang],"s",20],
|
||||
["beepcooked",MAN_BEEP_COOKED[lang],"s",21],
|
||||
|
||||
["closshowci",MAN_CLOSSHOWCI[lang],"s",25],
|
||||
["closshowpaytaxes",MAN_CLOSSHOWPAYTAXES[lang],"s",26],
|
||||
["closshowprods",MAN_CLOSSHOWPRODS[lang],"s",27],
|
||||
|
||||
["showpayment2",MAN_SHOWPAYMENT2[lang],"s",28],
|
||||
["showpayment3",MAN_SHOWPAYMENT3[lang],"s",29],
|
||||
["showpayment4",MAN_SHOWPAYMENT4[lang],"s",30],
|
||||
["showpayment5",MAN_SHOWPAYMENT5[lang],"s",31],
|
||||
["showpayment6",MAN_SHOWPAYMENT6[lang],"s",32],
|
||||
["showpayment7",MAN_SHOWPAYMENT7[lang],"s",33],
|
||||
["showpayment8",MAN_SHOWPAYMENT8[lang],"s",34],
|
||||
|
||||
["restaurantmode",MAN_RESTAURANT_MODE[lang],"s",23],
|
||||
["returntoorder",MAN_CASH[lang],"s",24],
|
||||
["addreceipttoprinter",MAN_ADD_RECPRINTER[lang],"s",16],
|
||||
|
@ -552,6 +577,8 @@ function setLanguage(l) {
|
|||
$("#mobilviewsectiontxt").html(MAN_MOBILSECTION_TXT[l]);
|
||||
$("#desktopviewsectiontxt").html(MAN_DESKTOP_SECTION_TXT[l]);
|
||||
$("#specialsettingssectiontxt").html(MAN_SPECIAL_SETTINGS_TXT[l]);
|
||||
$("#closingprintstxt").html(MAN_PRINT_ON_CLOSINGS[l]);
|
||||
$("#showpaymentstxt").html(MAN_SHOW_PAYMENTS_DLG[l]);
|
||||
$("#printandqueuehint").html(MAN_PRINT_AND_QUEUE_HINT[l]);
|
||||
$("#cashhint").html(MAN_CASH_HINT[l]);
|
||||
$("#returntoorderhint").html(MAN_RETURN_TO_ORDER_HINT[l]);
|
||||
|
@ -601,11 +628,11 @@ function showPanelsDueToUserStatus(jsonAnswer) {
|
|||
}
|
||||
|
||||
function getSpeisekarte() {
|
||||
doAjax("GET", "php/contenthandler.php?module=products&command=getSpeisekarte", null, insertSpeisekarte, "Fehler Insert Speisekarte");
|
||||
doAjax("GET", "php/contenthandler.php?module=products&command=getSpeisekarte", null, insertSpeisekarte, "Fehler Insert Speisekarte",true);
|
||||
}
|
||||
|
||||
function getGeneralConfigItems() {
|
||||
doAjax("GET", "php/contenthandler.php?module=admin&command=getGeneralConfigItems", null, insertGeneralConfigItems, "Fehler Konfigurationsdaten");
|
||||
doAjax("GET", "php/contenthandler.php?module=admin&command=getGeneralConfigItems", null, insertGeneralConfigItems, "Fehler Konfigurationsdaten",true);
|
||||
}
|
||||
|
||||
function saveValueIntoForm(aValue, decpoint, formid) {
|
||||
|
@ -671,7 +698,19 @@ function insertGeneralConfigItems(configResult) {
|
|||
$("#partOfReturntoorder").html(createReturntoorder(values.returntoorder));
|
||||
$("#partOfBeepCooked").html(createBeepCooked(values.beepcooked));
|
||||
$("#partOfRestaurantmode").html(createRestaurantmode(values.restaurantmode));
|
||||
|
||||
$("#partOfclosshowci").html(createYesNo("closshowci",MAN_CLOSSHOWCI,values.closshowci));
|
||||
$("#partOfclosshowpaytaxes").html(createYesNo("closshowpaytaxes",MAN_CLOSSHOWPAYTAXES,values.closshowpaytaxes));
|
||||
$("#partOfclosshowprods").html(createYesNo("closshowprods",MAN_CLOSSHOWPRODS,values.closshowprods));
|
||||
|
||||
$("#partOfshowpayment2").html(createYesNo("showpayment2",MAN_SHOWPAYMENT2, values.showpayment2));
|
||||
$("#partOfshowpayment3").html(createYesNo("showpayment3",MAN_SHOWPAYMENT3, values.showpayment3));
|
||||
$("#partOfshowpayment4").html(createYesNo("showpayment4",MAN_SHOWPAYMENT4, values.showpayment4));
|
||||
$("#partOfshowpayment5").html(createYesNo("showpayment5",MAN_SHOWPAYMENT5, values.showpayment5));
|
||||
$("#partOfshowpayment6").html(createYesNo("showpayment6",MAN_SHOWPAYMENT6, values.showpayment6));
|
||||
$("#partOfshowpayment7").html(createYesNo("showpayment7",MAN_SHOWPAYMENT7, values.showpayment7));
|
||||
$("#partOfshowpayment8").html(createYesNo("showpayment8",MAN_SHOWPAYMENT8, values.showpayment8));
|
||||
|
||||
var language = values.billlanguage;
|
||||
generalVals[2] = language;
|
||||
$("#partOfBillLanguage").html(createBillLanguagePart(language));
|
||||
|
@ -721,6 +760,18 @@ function insertGeneralConfigItems(configResult) {
|
|||
generalVals[23] = values.restaurantmode;
|
||||
generalVals[24] = values.returntoorder;
|
||||
|
||||
generalVals[25] = values.closshowci;
|
||||
generalVals[26] = values.closshowpaytaxes;
|
||||
generalVals[27] = values.closshowprods;
|
||||
|
||||
generalVals[28] = values.showpayment2;
|
||||
generalVals[29] = values.showpayment3;
|
||||
generalVals[30] = values.showpayment4;
|
||||
generalVals[31] = values.showpayment5;
|
||||
generalVals[32] = values.showpayment6;
|
||||
generalVals[33] = values.showpayment7;
|
||||
generalVals[34] = values.showpayment8;
|
||||
|
||||
$("#smtphost").val(values.smtphost);
|
||||
$("#partOfSmtpauth").html(createSMTPAuth(values.smtpauth));
|
||||
$("#smtpuser").val(values.smtpuser);
|
||||
|
@ -744,6 +795,7 @@ function insertGeneralConfigItems(configResult) {
|
|||
$("#partOfHotelInterface").html(createHotelInterfacePart(values.hotelinterface));
|
||||
|
||||
$("#configpart").trigger("create");
|
||||
bindConfig();
|
||||
} else {
|
||||
setTimeout(function(){document.location.href = "index.html"},250); // not logged in
|
||||
}
|
||||
|
@ -756,6 +808,7 @@ function insertSpeisekarte(speisekarte) {
|
|||
$("#speiseninfo").val(speisekarte.msg);
|
||||
$("#speiseninfo").trigger('change');
|
||||
}
|
||||
bindingMenu();
|
||||
}
|
||||
|
||||
function isSelectedOption(optionNo,option) {
|
||||
|
@ -1084,7 +1137,7 @@ function showClosingBtn() {
|
|||
$("#createclosing").show();
|
||||
}
|
||||
|
||||
function binding() {
|
||||
function bindingClosing() {
|
||||
$("#createclosing").off("click").on("click", function (e) {
|
||||
var remarkText =$('#remarkfield').val();
|
||||
$('#remarkfield').val("");
|
||||
|
@ -1162,8 +1215,84 @@ function binding() {
|
|||
});
|
||||
$("#select-month").change(function() {
|
||||
getClosingsOfSelectedDate();
|
||||
});
|
||||
}
|
||||
|
||||
function bindingExports() {
|
||||
$(".exportbtn").off("click").on("click", function (e) {
|
||||
e.stopImmediatePropagation();
|
||||
e.preventDefault();
|
||||
|
||||
var selectedMonthStart = $("#select-month-export-start").find(":selected").val();
|
||||
var selectedYearStart = $("#select-year-export-start").find(":selected").val();
|
||||
|
||||
var selectedMonthEnd = $("#select-month-export-end").find(":selected").val();
|
||||
var selectedYearEnd = $("#select-year-export-end").find(":selected").val();
|
||||
|
||||
var dateparams = "lang=" + lang + "&";
|
||||
dateparams += "startMonth=" + selectedMonthStart + "&";
|
||||
dateparams += "startYear=" + selectedYearStart + "&";
|
||||
dateparams += "endMonth=" + selectedMonthEnd + "&";
|
||||
dateparams += "endYear=" + selectedYearEnd;
|
||||
|
||||
var theId = this.id;
|
||||
if (theId == "createprodexport") {
|
||||
window.location.href = "php/contenthandler.php?module=products&command=exportCsv";
|
||||
} else if (theId == "createuserexport") {
|
||||
window.location.href = "php/contenthandler.php?module=admin&command=exportUserCsv";
|
||||
} else if (theId == "createconfigexport") {
|
||||
window.location.href = "php/contenthandler.php?module=admin&command=exportConfigCsv";
|
||||
} else if (theId == "createdbexport") {
|
||||
window.location.href = "php/contenthandler.php?module=bill&command=exportCsv&" + dateparams;
|
||||
} else if (theId == "createdbexportxlsx") {
|
||||
window.location.href = "php/contenthandler.php?module=bill&command=exportXlsx&" + dateparams;
|
||||
} else if (theId == "createpdfexport") {
|
||||
window.open("php/contenthandler.php?module=bill&command=exportPdfReport&" + dateparams,'_blank');
|
||||
} else if (theId == "createpdfsummary") {
|
||||
window.open("php/contenthandler.php?module=bill&command=exportPdfSummary&" + dateparams,'_blank');
|
||||
} else if (theId == "createlogexport") {
|
||||
window.open("php/contenthandler.php?module=admin&command=exportLog",'_blank');
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
function bindingMenu() {
|
||||
$("#readspeisekarte").off("click").on("click", function (e) {
|
||||
e.stopImmediatePropagation();
|
||||
e.preventDefault();
|
||||
var text = $("#speiseninfo").val();
|
||||
doAjaxSuppressError("POST", "php/contenthandler.php?module=admin&command=fillSpeisekarte", {speisekarte:text}, confirmMsg, "Fehler");
|
||||
});
|
||||
}
|
||||
|
||||
function bindRoom() {
|
||||
$("#changeroomsize").off("click").on("click", function (e) {
|
||||
e.stopImmediatePropagation();
|
||||
e.preventDefault();
|
||||
resizeRoomField();
|
||||
});
|
||||
$("#cancel_roomchange").off("click").on("click", function (e) {
|
||||
e.stopImmediatePropagation();
|
||||
e.preventDefault();
|
||||
askForCurrentRoomField();
|
||||
});
|
||||
$("#roomfield_prefill").off("click").on("click", function (e) {
|
||||
e.stopImmediatePropagation();
|
||||
e.preventDefault();
|
||||
roomfield_prefill();
|
||||
});
|
||||
$("#roomfield_apply").off("click").on("click", function (e) {
|
||||
e.stopImmediatePropagation();
|
||||
e.preventDefault();
|
||||
areYouSure("Raumdefinition", MAN_ROOMCHANGE_WARNING[lang], "Ja", function() {
|
||||
roomfield_apply();
|
||||
});
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
function bindConfig() {
|
||||
$( ".genConfigEl" ).keyup(function(e) {
|
||||
$(this).data("changed",true);
|
||||
});
|
||||
|
@ -1275,72 +1404,18 @@ function binding() {
|
|||
});
|
||||
}
|
||||
});
|
||||
|
||||
$(".exportbtn").off("click").on("click", function (e) {
|
||||
$("#configpart").off("collapsibleexpand").on("collapsibleexpand", function (e) {
|
||||
e.stopImmediatePropagation();
|
||||
e.preventDefault();
|
||||
|
||||
var selectedMonthStart = $("#select-month-export-start").find(":selected").val();
|
||||
var selectedYearStart = $("#select-year-export-start").find(":selected").val();
|
||||
|
||||
var selectedMonthEnd = $("#select-month-export-end").find(":selected").val();
|
||||
var selectedYearEnd = $("#select-year-export-end").find(":selected").val();
|
||||
|
||||
var dateparams = "lang=" + lang + "&";
|
||||
dateparams += "startMonth=" + selectedMonthStart + "&";
|
||||
dateparams += "startYear=" + selectedYearStart + "&";
|
||||
dateparams += "endMonth=" + selectedMonthEnd + "&";
|
||||
dateparams += "endYear=" + selectedYearEnd;
|
||||
|
||||
var theId = this.id;
|
||||
if (theId == "createprodexport") {
|
||||
window.location.href = "php/contenthandler.php?module=products&command=exportCsv";
|
||||
} else if (theId == "createuserexport") {
|
||||
window.location.href = "php/contenthandler.php?module=admin&command=exportUserCsv";
|
||||
} else if (theId == "createconfigexport") {
|
||||
window.location.href = "php/contenthandler.php?module=admin&command=exportConfigCsv";
|
||||
} else if (theId == "createdbexport") {
|
||||
window.location.href = "php/contenthandler.php?module=bill&command=exportCsv&" + dateparams;
|
||||
} else if (theId == "createdbexportxlsx") {
|
||||
window.location.href = "php/contenthandler.php?module=bill&command=exportXlsx&" + dateparams;
|
||||
} else if (theId == "createpdfexport") {
|
||||
window.open("php/contenthandler.php?module=bill&command=exportPdfReport&" + dateparams,'_blank');
|
||||
} else if (theId == "createpdfsummary") {
|
||||
window.open("php/contenthandler.php?module=bill&command=exportPdfSummary&" + dateparams,'_blank');
|
||||
} else if (theId == "createlogexport") {
|
||||
window.open("php/contenthandler.php?module=admin&command=exportLog",'_blank');
|
||||
}
|
||||
});
|
||||
|
||||
$("#changeroomsize").off("click").on("click", function (e) {
|
||||
e.stopImmediatePropagation();
|
||||
e.preventDefault();
|
||||
resizeRoomField();
|
||||
});
|
||||
$("#cancel_roomchange").off("click").on("click", function (e) {
|
||||
e.stopImmediatePropagation();
|
||||
e.preventDefault();
|
||||
askForCurrentRoomField();
|
||||
});
|
||||
$("#roomfield_prefill").off("click").on("click", function (e) {
|
||||
e.stopImmediatePropagation();
|
||||
e.preventDefault();
|
||||
roomfield_prefill();
|
||||
});
|
||||
$("#roomfield_apply").off("click").on("click", function (e) {
|
||||
e.stopImmediatePropagation();
|
||||
e.preventDefault();
|
||||
areYouSure("Raumdefinition", MAN_ROOMCHANGE_WARNING[lang], "Ja", function() {
|
||||
roomfield_apply();
|
||||
});
|
||||
});
|
||||
|
||||
$("#readspeisekarte").off("click").on("click", function (e) {
|
||||
e.stopImmediatePropagation();
|
||||
e.preventDefault();
|
||||
var text = $("#speiseninfo").val();
|
||||
doAjaxSuppressError("POST", "php/contenthandler.php?module=admin&command=fillSpeisekarte", {speisekarte:text}, confirmMsg, "Fehler");
|
||||
setVisibilityOfAustriaButtons();
|
||||
setVisibilityDueToWorkflow();
|
||||
setVisibilityDueToPrintType();
|
||||
setVisibilityHs3DueToHotelInterface();
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
function binding() {
|
||||
|
||||
$("#backup_btn").off("click").on("click", function (e) {
|
||||
e.stopImmediatePropagation();
|
||||
|
@ -1449,14 +1524,7 @@ function binding() {
|
|||
doAjax("POST","php/contenthandler.php?module=admin&command=assignTaxes",data,confirmMsg,"Problem Steuersatzzuweisung");
|
||||
});
|
||||
|
||||
$("#configpart").off("collapsibleexpand").on("collapsibleexpand", function (e) {
|
||||
e.stopImmediatePropagation();
|
||||
e.preventDefault();
|
||||
setVisibilityOfAustriaButtons();
|
||||
setVisibilityDueToWorkflow();
|
||||
setVisibilityDueToPrintType();
|
||||
setVisibilityHs3DueToHotelInterface();
|
||||
});
|
||||
|
||||
|
||||
bindSelectionsWithActions();
|
||||
}
|
||||
|
@ -1514,9 +1582,9 @@ function handleUpdateCheckResult(answer) {
|
|||
|
||||
var millis=getMillis();
|
||||
setTimeout(function(){
|
||||
document.location.href = "install.html?v=1.3.9&mode=onlyupdate&n=" + millis;
|
||||
document.location.href = "install.html?v=1.3.10&mode=onlyupdate&n=" + millis;
|
||||
},250);
|
||||
document.location.href = "install.html?v=1.3.9&mode=onlyupdate&n=" + millis;
|
||||
document.location.href = "install.html?v=1.3.10&mode=onlyupdate&n=" + millis;
|
||||
}
|
||||
|
||||
function handleUpdateReplace(answer) {
|
||||
|
@ -1874,7 +1942,8 @@ function displayReceivedClosings(closingresult) {
|
|||
});
|
||||
$("#partofclosings").html(closingParts);
|
||||
$('#partofclosings').trigger('create');
|
||||
binding();
|
||||
bindingClosing();
|
||||
bindingExports();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1883,7 +1952,7 @@ function getClosings(month,year) {
|
|||
month: month,
|
||||
year: year
|
||||
};
|
||||
doAjax("GET","php/contenthandler.php?module=closing&command=getClosings",data,displayReceivedClosings,"Keine Abschluesse erhalten");
|
||||
doAjax("GET","php/contenthandler.php?module=closing&command=getClosings",data,displayReceivedClosings,"Keine Abschluesse erhalten",true);
|
||||
}
|
||||
|
||||
function createLabelWithTextField(aLabel,displayedName,defaultText) {
|
||||
|
@ -2019,7 +2088,7 @@ function fillUserListIntoGui(userinfo) {
|
|||
}
|
||||
|
||||
function askAndFillUserList() {
|
||||
doAjax("GET","php/contenthandler.php?module=admin&command=getUserList",null, fillUserListIntoGui,"no user data received");
|
||||
doAjax("GET","php/contenthandler.php?module=admin&command=getUserList",null, fillUserListIntoGui,"no user data received",true);
|
||||
}
|
||||
|
||||
function dynamicUserBinding() {
|
||||
|
@ -2307,7 +2376,7 @@ function tablelist(no,rowId) {
|
|||
}
|
||||
|
||||
function askForCurrentRoomField() {
|
||||
doAjax("GET","php/contenthandler.php?module=roomtables&command=getRoomfield",null,initroomfield,"Raumplan");
|
||||
doAjax("GET","php/contenthandler.php?module=roomtables&command=getRoomfield",null,initroomfield,"Raumplan",true);
|
||||
}
|
||||
|
||||
function resizeRoomField() {
|
||||
|
@ -2393,6 +2462,7 @@ function initroomfield(roomfield_json) {
|
|||
}
|
||||
|
||||
$("#roomfield").trigger("create");
|
||||
bindRoom();
|
||||
var roomMap = new Roommap("#tablemaps");
|
||||
}
|
||||
|
||||
|
@ -2494,7 +2564,7 @@ function createSpooledRecPrintButtons(jobs) {
|
|||
var theType = aJob.type;
|
||||
if (theType == 4) {
|
||||
txt += createSpooledPrintJobButton(
|
||||
'spooledJob_' + aJob.id,MAN_CLOSINGRIGHT[lang] + " (" + aJob.billdate + ")");
|
||||
'spooledJob_' + aJob.id,MAN_CLOSINGRIGHT[lang] + " (" + aJob.closingid + ": "+ aJob.closingdate + ")");
|
||||
} else {
|
||||
txt += createSpooledPrintJobButton(
|
||||
'spooledJob_' + aJob.id,MAN_TABLE_TXT[lang]
|
||||
|
@ -2582,8 +2652,6 @@ $(document).on("pageinit", "#admin-page", function () {
|
|||
|
||||
getSpeisekarte();
|
||||
|
||||
binding();
|
||||
|
||||
askForCurrentRoomField();
|
||||
|
||||
$("#userfile").val('');
|
||||
|
@ -2591,6 +2659,8 @@ $(document).on("pageinit", "#admin-page", function () {
|
|||
getSpooledPrintJobs();
|
||||
|
||||
getVersionInfoForUpdate();
|
||||
|
||||
binding();
|
||||
});
|
||||
|
||||
|
||||
|
@ -2745,34 +2815,34 @@ $(document).on("pageinit", "#admin-page", function () {
|
|||
|
||||
<div data-role="fieldcontain">
|
||||
<label for="companyinfo">Betriebsinfo:</label>
|
||||
<textarea cols="40" rows="8" name="companyinfo" id="companyinfo" class="genConfigEl"></textarea>
|
||||
<textarea cols="40" rows="8" name="companyinfo" id="companyinfo" class="genConfigEl" style="background-color:#FFFFFF;"></textarea>
|
||||
</div>
|
||||
<div data-role="fieldcontain">
|
||||
<label for="rectemplate">Bonvorlage:</label>
|
||||
<textarea cols="40" rows="8" name="rectemplate" id="rectemplate" class="genConfigEl"></textarea>
|
||||
<textarea cols="40" rows="8" name="rectemplate" id="rectemplate" class="genConfigEl" style="background-color:#FFFFFF;"></textarea>
|
||||
<i id=rectemplatehint style="padding-left: 50px;padding-right: 50px;">Hinweis: siehe Anleitung</i>
|
||||
</div>
|
||||
<div data-role="fieldcontain">
|
||||
<label for="foodtemplate">Vorlage Speisebons:</label>
|
||||
<textarea cols="40" rows="8" name="foodtemplate" id="foodtemplate" class="genConfigEl"></textarea>
|
||||
<textarea cols="40" rows="8" name="foodtemplate" id="foodtemplate" class="genConfigEl" style="background-color:#FFFFFF;"></textarea>
|
||||
<i id=foodtemplatehint style="padding-left: 50px;padding-right: 50px;">Hinweis: siehe Anleitung</i>
|
||||
</div>
|
||||
<div data-role="fieldcontain">
|
||||
<label for="drinktemplate">Vorlage Getränkebons:</label>
|
||||
<textarea cols="40" rows="8" name="drinktemplate" id="drinktemplate" class="genConfigEl"></textarea>
|
||||
<textarea cols="40" rows="8" name="drinktemplate" id="drinktemplate" class="genConfigEl" style="background-color:#FFFFFF;"></textarea>
|
||||
<i id=drinktemplatehint style="padding-left: 50px;padding-right: 50px;">Hinweis: siehe Anleitung</i>
|
||||
</div>
|
||||
<div data-role="fieldcontain">
|
||||
<label for="reservationnote">Reservierungstemplate Email:</label>
|
||||
<textarea cols="40" rows="8" name="reservationnote" id="reservationnote" class="genConfigEl"></textarea>
|
||||
<textarea cols="40" rows="8" name="reservationnote" id="reservationnote" class="genConfigEl" style="background-color:#FFFFFF;"></textarea>
|
||||
</div>
|
||||
<div data-role="fieldcontain">
|
||||
<label for="serverUrl">Webserver:</label>
|
||||
<textarea cols="40" rows="1" name="serverUrl" id="serverUrl" class="genConfigEl">localhost</textarea>
|
||||
<textarea cols="40" rows="1" name="serverUrl" id="serverUrl" class="genConfigEl" style="background-color:#FFFFFF;">localhost</textarea>
|
||||
</div>
|
||||
<div data-role="fieldcontain">
|
||||
<label for="webimpressum">Webimpressum:</label>
|
||||
<textarea cols="40" rows="1" name="webimpressum" id="webimpressum" class="genConfigEl"></textarea>
|
||||
<textarea cols="40" rows="1" name="webimpressum" id="webimpressum" class="genConfigEl" style="background-color:#FFFFFF;"></textarea>
|
||||
</div>
|
||||
<div data-role="fieldcontain">
|
||||
<label for="email"><span id="fromemailtxt">Sender-Email:</span></label>
|
||||
|
@ -2817,7 +2887,7 @@ $(document).on("pageinit", "#admin-page", function () {
|
|||
<div id="partOfPayPrintType"></div>
|
||||
<div id="partOfBillLanguage"></div>
|
||||
<div id="partOfReceiptFontSize"></div>
|
||||
<div id="partOfPaymentConfig"></div>
|
||||
<div id="partOfPaymentConfig" style="display:none;"></div>
|
||||
<div id="partOfWorkflowConfig"></div>
|
||||
<div id="partIfDigiWorkflow">
|
||||
<div id="partOfDigigopaysetready"></div>
|
||||
|
@ -2944,6 +3014,22 @@ $(document).on("pageinit", "#admin-page", function () {
|
|||
<i id=returntoorderhint style="padding-left: 50px;padding-right: 50px;">Hinweis: siehe Anleitung</i>
|
||||
</div>
|
||||
|
||||
<br><b><u><span id="closingprintstxt">Tageserfassungsbons</span></u></b><br><br>
|
||||
|
||||
<div id="partOfclosshowci"></div>
|
||||
<div id="partOfclosshowpaytaxes"></div>
|
||||
<div id="partOfclosshowprods"></div>
|
||||
|
||||
<br><b><u><span id="showpaymentstxt">Zahlungswege</span></u></b><br><br>
|
||||
|
||||
<div id="partOfshowpayment2"></div>
|
||||
<div id="partOfshowpayment3"></div>
|
||||
<div id="partOfshowpayment4"></div>
|
||||
<div id="partOfshowpayment5"></div>
|
||||
<div id="partOfshowpayment6"></div>
|
||||
<div id="partOfshowpayment7"></div>
|
||||
<div id="partOfshowpayment8"></div>
|
||||
|
||||
<br><b><u><span id="specialsettingssectiontxt">Spezialeinstellungen</span></u></b><br><br>
|
||||
|
||||
<div>
|
||||
|
@ -2956,7 +3042,7 @@ $(document).on("pageinit", "#admin-page", function () {
|
|||
<i id=cashhint style="padding-left: 50px;padding-right: 50px;">Hinweis: siehe Anleitung</i>
|
||||
</div>
|
||||
|
||||
<div id="partOfBeepCooked"></div>
|
||||
<div id="partOfBeepCooked"></div>
|
||||
|
||||
<p>
|
||||
|
||||
|
@ -3108,9 +3194,7 @@ $(document).on("pageinit", "#admin-page", function () {
|
|||
|
||||
</div>
|
||||
<textarea cols="40" rows="8" name="speiseninfo" id="speiseninfo" data-theme="a" style='font-family:"monospace"'></textarea>
|
||||
|
||||
|
||||
|
||||
|
||||
</div> <!-- Speisekarte -->
|
||||
|
||||
<p>
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -912,6 +912,18 @@ class Admin {
|
|||
$cashenabled = CommonUtils::getConfigValue($pdo,"cashenabled",1);
|
||||
$returntoorder = CommonUtils::getConfigValue($pdo,"returntoorder",1);
|
||||
$beepcooked = CommonUtils::getConfigValue($pdo,"beepcooked",0);
|
||||
|
||||
$closshowci = CommonUtils::getConfigValue($pdo,"closshowci",1);
|
||||
$closshowpaytaxes = CommonUtils::getConfigValue($pdo,"closshowpaytaxes",1);
|
||||
$closshowprods = CommonUtils::getConfigValue($pdo,"closshowprods",1);
|
||||
$showpayment2 = CommonUtils::getConfigValue($pdo,"showpayment2",1);
|
||||
$showpayment3 = CommonUtils::getConfigValue($pdo,"showpayment3",1);
|
||||
$showpayment4 = CommonUtils::getConfigValue($pdo,"showpayment4",1);
|
||||
$showpayment5 = CommonUtils::getConfigValue($pdo,"showpayment5",1);
|
||||
$showpayment6 = CommonUtils::getConfigValue($pdo,"showpayment6",1);
|
||||
$showpayment7 = CommonUtils::getConfigValue($pdo,"showpayment7",1);
|
||||
$showpayment8 = CommonUtils::getConfigValue($pdo,"showpayment8",1);
|
||||
|
||||
$restaurantmode = CommonUtils::getConfigValue($pdo,"restaurantmode",1);
|
||||
|
||||
$smtphost = "";
|
||||
|
@ -973,9 +985,18 @@ class Admin {
|
|||
"digiprintwork" => $digiprintwork, "memorylimit" => $memorylimit, "updateurl" => $updateurl, "hs3refresh" => $hs3refresh,
|
||||
"paydeskid" => $paydeskid, "aeskey" => $aeskey, "certificatesn" => $certificatesn, "rksvserver" => $rksvserver, "addreceipttoprinter" => $addreceipttoprinter,
|
||||
"printandqueuejobs" => $printandqueuejobs, "cashenabled" => $cashenabled, "returntoorder" => $returntoorder, "beepcooked" => $beepcooked,"restaurantmode" => $restaurantmode,
|
||||
"discountname1" => $discountname1,"discountname2" => $discountname2,"discountname3" => $discountname3
|
||||
"discountname1" => $discountname1,"discountname2" => $discountname2,"discountname3" => $discountname3,
|
||||
"closshowci" => $closshowci, "closshowpaytaxes" => $closshowpaytaxes, "closshowprods" => $closshowprods,
|
||||
"showpayment2" => $showpayment2,
|
||||
"showpayment3" => $showpayment3,
|
||||
"showpayment4" => $showpayment4,
|
||||
"showpayment5" => $showpayment5,
|
||||
"showpayment6" => $showpayment6,
|
||||
"showpayment7" => $showpayment7,
|
||||
"showpayment8" => $showpayment8
|
||||
);
|
||||
|
||||
|
||||
if ($forHtml) {
|
||||
echo json_encode(array("status" => "OK", "msg" => $retVal));
|
||||
} else {
|
||||
|
@ -1063,7 +1084,7 @@ class Admin {
|
|||
$view = "preferences.html";
|
||||
}
|
||||
|
||||
echo json_encode($view . "?v=1.3.9");
|
||||
echo json_encode($view . "?v=1.3.10");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1265,25 +1286,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.9"); };
|
||||
if ($_SESSION['right_waiter']) { $mainMenu[] = array("name" => $waitertxt[$lang], "link" => "waiter.html?v=1.3.10"); };
|
||||
} else {
|
||||
if ($_SESSION['right_waiter']) { $mainMenu[] = array("name" => $waiterdesktxt[$lang], "link" => "waiterdesktop.php?v=1.3.9"); };
|
||||
if ($_SESSION['right_waiter']) { $mainMenu[] = array("name" => $waiterdesktxt[$lang], "link" => "waiterdesktop.php?v=1.3.10"); };
|
||||
}
|
||||
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['right_kitchen']) { $mainMenu[] = array("name" => $kitchentxt[$lang], "link" => "kitchen.html?v=1.3.10"); };
|
||||
if ($_SESSION['right_bar']) { $mainMenu[] = array("name" => "Bar", "link" => "bar.html?v=1.3.10"); };
|
||||
if ($_SESSION['right_supply']) { $mainMenu[] = array("name" => $supplytxt[$lang], "link" => "supplydesk.html?v=1.3.10"); };
|
||||
if ($_SESSION['modus'] == 0) {
|
||||
if ($_SESSION['right_paydesk']) { $mainMenu[] = array("name" => $paydesktxt[$lang], "link" => "paydesk.html?v=1.3.9"); };
|
||||
if ($_SESSION['right_paydesk']) { $mainMenu[] = array("name" => $paydesktxt[$lang], "link" => "paydesk.html?v=1.3.10"); };
|
||||
}
|
||||
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");
|
||||
if ($_SESSION['right_statistics']) { $mainMenu[] = array("name" => $stattxt[$lang], "link" => "reports.html?v=1.3.10"); };
|
||||
if ($_SESSION['right_bill']) { $mainMenu[] = array("name" => $bontxt[$lang], "link" => "bill.html?v=1.3.10"); };
|
||||
if ($_SESSION['right_products']) { $mainMenu[] = array("name" => $prodtxt[$lang], "link" => "products.html?v=1.3.10"); };
|
||||
if ($_SESSION['right_reservation']) { $mainMenu[] = array("name" => $restxt[$lang], "link" => "reservation.html?v=1.3.10"); };
|
||||
if ($_SESSION['right_rating']) { $mainMenu[] = array("name" => $ratingtxt[$lang], "link" => "rating.html?v=1.3.10"); };
|
||||
if ($_SESSION['right_customers']) { $mainMenu[] = array("name" => $customerstxt[$lang], "link" => "customers.html?v=1.3.10"); };
|
||||
if ($_SESSION['right_manager'] || $_SESSION['is_admin'] || $_SESSION['right_closing']) { $mainMenu[] = array("name" => $admintxt[$lang], "link" => "manager.html?v=1.3.10"); };
|
||||
$mainMenu[] = array("name" => $settingtxt[$lang], "link" => "preferences.html?v=1.3.10");
|
||||
$mainMenu[] = array("name" => "Feedback", "link" => "feedback.html?v=1.3.10");
|
||||
}
|
||||
|
||||
$mainMenu[] = array("name" => $logout[$lang], "link" => "logout.php");
|
||||
|
@ -1291,7 +1312,7 @@ class Admin {
|
|||
|
||||
$waiterMessage = $this->getMessage(null, "waitermessage");
|
||||
}
|
||||
$mainMenuAndVersion = array ("version" => "OrderSprinter 1.3.9",
|
||||
$mainMenuAndVersion = array ("version" => "OrderSprinter 1.3.10",
|
||||
"user" => $currentUser,
|
||||
"menu" => $mainMenu,
|
||||
"waitermessage" => $waiterMessage,
|
||||
|
@ -1568,6 +1589,20 @@ class Admin {
|
|||
"cashenabled" => array("dbcol" => "cashenabled","checknum" => 0),
|
||||
"returntoorder" => array("dbcol" => "returntoorder","checknum" => 0),
|
||||
"beepcooked" => array("dbcol" => "beepcooked","checknum" => 0),
|
||||
|
||||
|
||||
"closshowci" => array("dbcol" => "closshowci","checknum" => 0),
|
||||
"closshowpaytaxes" => array("dbcol" => "closshowpaytaxes","checknum" => 0),
|
||||
"closshowprods" => array("dbcol" => "closshowprods","checknum" => 0),
|
||||
|
||||
"showpayment2" => array("dbcol" => "showpayment2","checknum" => 0),
|
||||
"showpayment3" => array("dbcol" => "showpayment3","checknum" => 0),
|
||||
"showpayment4" => array("dbcol" => "showpayment4","checknum" => 0),
|
||||
"showpayment5" => array("dbcol" => "showpayment5","checknum" => 0),
|
||||
"showpayment6" => array("dbcol" => "showpayment6","checknum" => 0),
|
||||
"showpayment7" => array("dbcol" => "showpayment7","checknum" => 0),
|
||||
"showpayment8" => array("dbcol" => "showpayment8","checknum" => 0),
|
||||
|
||||
"restaurantmode" => array("dbcol" => "restaurantmode","checknum" => 0),
|
||||
"smtphost" => array("dbcol" => "smtphost","checknum" => 0),
|
||||
"smtpauth" => array("dbcol" => "smtpauth","checknum" => 1),
|
||||
|
|
|
@ -418,17 +418,38 @@ class Bill {
|
|||
* take outs are in in his waiter paydesk then this value is of interest, too. Return both.
|
||||
*/
|
||||
function getCashOverviewOfUser() {
|
||||
$pdo = DbUtils::openDbAndReturnPdoStatic();
|
||||
$userId = $this->getUserId();
|
||||
|
||||
$onlyCashByGuests = 0.0;
|
||||
$pdo = $this->dbutils->openDbAndReturnPdo();
|
||||
$sql = "SELECT sum(brutto) as sumtotal FROM %bill% WHERE closingid is null AND status is null AND paymentid=1 AND userid='$userId'";
|
||||
$stmt = $pdo->prepare($this->dbutils->resolveTablenamesInSqlString($sql));
|
||||
$stmt->execute();
|
||||
$row =$stmt->fetchObject();
|
||||
if ($row != null) {
|
||||
if ($row->sumtotal != null) {
|
||||
$onlyCashByGuests = $row->sumtotal;
|
||||
if(session_id() == '') {
|
||||
session_start();
|
||||
}
|
||||
$lang = $_SESSION['language'];
|
||||
$paymentnameitem = "name";
|
||||
if ($lang == 1) {
|
||||
$paymentnameitem = "name_en";
|
||||
} else if ($lang == 2) {
|
||||
$paymentnameitem = "name_esp";
|
||||
}
|
||||
$cashPerPayments = array();
|
||||
for ($paymentid=1;$paymentid<=8;$paymentid++) {
|
||||
$sql = "SELECT $paymentnameitem as payname FROM %payment% WHERE id=?";
|
||||
$row = CommonUtils::getRowSqlObject($pdo, $sql, array($paymentid));
|
||||
$paymentname = $row->payname;
|
||||
|
||||
$onlyCashByGuests = 0.0;
|
||||
$pdo = $this->dbutils->openDbAndReturnPdo();
|
||||
$sql = "SELECT sum(brutto) as sumtotal FROM %bill% WHERE closingid is null AND status is null AND paymentid=? AND userid=?";
|
||||
$stmt = $pdo->prepare($this->dbutils->resolveTablenamesInSqlString($sql));
|
||||
$stmt->execute(array($paymentid,$userId));
|
||||
$row =$stmt->fetchObject();
|
||||
if ($row != null) {
|
||||
if ($row->sumtotal != null) {
|
||||
$onlyCashByGuests = $row->sumtotal;
|
||||
}
|
||||
}
|
||||
if ($onlyCashByGuests != '0.00') {
|
||||
$cashPerPayments[] = array("payment" => $paymentname,"value" => $onlyCashByGuests);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -442,7 +463,7 @@ class Bill {
|
|||
$cashByGuestsAndInsertTakeOut = $row->sumtotal;
|
||||
}
|
||||
}
|
||||
echo json_encode(array("guestmoney" => $onlyCashByGuests, "total" => $cashByGuestsAndInsertTakeOut));
|
||||
echo json_encode(array("cashperpayments" => $cashPerPayments,"total" => $cashByGuestsAndInsertTakeOut));
|
||||
}
|
||||
|
||||
function getLastBillsWithContent($day,$month,$year) {
|
||||
|
|
|
@ -18,7 +18,7 @@ require_once 'translations.php';
|
|||
|
||||
function handleCommand($command) {
|
||||
// all commands require closing,manager or admin rights
|
||||
if (!($this->hasCurrentUserManagerOrAdminOrClosingRights())) {
|
||||
if (!($this->hasCurrentUserManagerOrAdminRights()) && ($command != 'createClosing') && ($command != 'getClosings')) {
|
||||
if ($command != 'exportCsv') {
|
||||
echo json_encode(array("status" => "ERROR", "code" => ERROR_MANAGER_NOT_AUTHOTRIZED, "msg" => ERROR_MANAGER_NOT_AUTHOTRIZED_MSG));
|
||||
} else {
|
||||
|
@ -48,13 +48,13 @@ echo "Command not supported.";
|
|||
}
|
||||
}
|
||||
|
||||
private function hasCurrentUserManagerOrAdminOrClosingRights() {
|
||||
private function hasCurrentUserManagerOrAdminRights() {
|
||||
session_start();
|
||||
if (!isset($_SESSION['angemeldet']) || !$_SESSION['angemeldet']) {
|
||||
// no user logged in
|
||||
return false;
|
||||
} else {
|
||||
return ($_SESSION['right_manager'] || $_SESSION['right_closing'] || $_SESSION['is_admin']);
|
||||
return ($_SESSION['right_manager'] || $_SESSION['is_admin']);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -709,6 +709,20 @@ $stmt = $pdo->prepare($this->dbutils->resolveTablenamesInSqlString($sql));
|
|||
$stmt->execute(array($closingid));
|
||||
$taxessum = $stmt->fetchAll(PDO::FETCH_ASSOC);
|
||||
|
||||
$sql = "SELECT DISTINCT paymentid,name FROM %bill%,%payment% WHERE %bill%.closingid=? AND %bill%.paymentid=%payment%.id";
|
||||
$payments = CommonUtils::fetchSqlAll($pdo, $sql, array($closingid));
|
||||
$paymenttaxes = array();
|
||||
foreach($payments as $aPayment) {
|
||||
$sql = "select %queue%.tax as t,SUM(%queue%.price) as bruttosum,ROUND(SUM(%queue%.price)/(1 + %queue%.tax/100.0),2) as nettosum ";
|
||||
$sql .= " FROM %bill%,%queue% ";
|
||||
$sql .= " WHERE %bill%.closingid=? AND %queue%.billid=%bill%.id AND %bill%.paymentid=? GROUP BY t";
|
||||
$stmt = $pdo->prepare($this->dbutils->resolveTablenamesInSqlString($sql));
|
||||
$stmt->execute(array($closingid,$aPayment["paymentid"]));
|
||||
$paymenttaxessum = $stmt->fetchAll(PDO::FETCH_ASSOC);
|
||||
$paymenttaxes[] = array("payment" => $aPayment["name"],"paymenttaxessum" => $paymenttaxessum);
|
||||
}
|
||||
|
||||
|
||||
$sql = "select count(%queue%.productname) as count,%queue%.productname,%queue%.price,%queue%.tax as tax,sum(%queue%.price) as sumprice ";
|
||||
$sql .= " from %queue%,%bill% where ";
|
||||
$sql .= "%queue%.billid=%bill%.id AND %bill%.closingid=? AND ";
|
||||
|
@ -723,7 +737,19 @@ $details = $stmt->fetchAll(PDO::FETCH_ASSOC);
|
|||
if (!$exportSignature || $fromWeb) {
|
||||
unset($closingpart->signature);
|
||||
}
|
||||
if ($fl >= 3) {
|
||||
if ($fl >= 8) {
|
||||
$closshowci = CommonUtils::getConfigValue($pdo, 'closshowci', 1);
|
||||
$closshowpaytaxes = CommonUtils::getConfigValue($pdo, 'closshowpaytaxes', 1);
|
||||
$closshowprods = CommonUtils::getConfigValue($pdo, 'closshowprods', 1);
|
||||
$companyinfo = CommonUtils::getConfigValue($pdo, 'companyinfo', '');
|
||||
$retVal = array("closing" => $closingpart, "overview" => $overview, "details" => $details, "taxessum" => $taxessum,
|
||||
"companyinfo" => $companyinfo,
|
||||
"paymenttaxessum" => $paymenttaxes,
|
||||
"closshowci" => $closshowci,
|
||||
"closshowpaytaxes" => $closshowpaytaxes,
|
||||
"closshowprods" => $closshowprods,
|
||||
);
|
||||
} else if ($fl >= 3) {
|
||||
$retVal = array("closing" => $closingpart, "overview" => $overview, "details" => $details, "taxessum" => $taxessum);
|
||||
} else {
|
||||
$retVal = array("closing" => $closingpart, "overview" => $overview, "details" => $details);
|
||||
|
|
|
@ -141,8 +141,12 @@ class PrintQueue {
|
|||
|
||||
$jobs = array();
|
||||
for ($printer=1;$printer<7;$printer++) {
|
||||
$sql = "SELECT %printjobs%.id as id,%bill%.id as billid,billdate,brutto,%resttables%.tableno as tablename,type FROM %printjobs%,%bill%,%resttables% WHERE printer=? AND type != '1' AND type != '2' AND content=%bill%.id AND %bill%.tableid=%resttables%.id";
|
||||
$result = CommonUtils::fetchSqlAll($pdo, $sql, array($printer));
|
||||
$sql = "SELECT %printjobs%.id as id,%bill%.id as billid,billdate,brutto,%resttables%.tableno as tablename,type FROM %printjobs%,%bill%,%resttables% WHERE printer=? AND type = '3' AND content=%bill%.id AND %bill%.tableid=%resttables%.id";
|
||||
$resultBills = CommonUtils::fetchSqlAll($pdo, $sql, array($printer));
|
||||
$sql = "SELECT %printjobs%.id as id,%closing%.id as closingid,type,closingdate FROM %printjobs%,%closing% WHERE printer=? AND type = '4' AND content=%closing%.id";
|
||||
$resultClosings = CommonUtils::fetchSqlAll($pdo, $sql, array($printer));
|
||||
|
||||
$result = array_merge($resultBills,$resultClosings);
|
||||
$jobs[] = array("printer" => $printer, "count" => count($result),"jobs" => $result);
|
||||
}
|
||||
|
||||
|
@ -416,6 +420,7 @@ class PrintQueue {
|
|||
$jobid = $aClos['id'];
|
||||
$closid = $aClos["content"];
|
||||
$printer = $aClos["printer"];
|
||||
|
||||
$theClosing = $closing->getClosingSummaryWoSign($closid, $pdo, false,$fl);
|
||||
$aClosing = array("id" => $jobid,"closing" => $theClosing, "printer" => $printer);
|
||||
$closingarray[] = $aClosing;
|
||||
|
|
|
@ -36,7 +36,7 @@ class Products {
|
|||
|
||||
function handleCommand($command) {
|
||||
|
||||
$cmdArray = array('showDbProducts', 'getMenuLevelUp', 'applySingleProdData', 'createExtra', 'applyExtra', 'delExtra','sortup','sortdown', 'delproduct', 'reassign', 'applyType', 'delType', 'getSingleProdData', 'getSingleTypeData', 'getPriceLevelInfo','setPriceLevelInfo', 'createProduct','createProdType','addGeneralComment','changeGeneralComment','delGeneralComment','upGeneralComment','downGeneralComment');
|
||||
$cmdArray = array('showDbProducts', 'getMenuLevelUp', 'applySingleProdData', 'createExtra', 'applyExtra', 'upExtra', 'delExtra','sortup','sortdown', 'delproduct', 'reassign', 'applyType', 'delType', 'getSingleProdData', 'getSingleTypeData', 'getPriceLevelInfo','setPriceLevelInfo', 'createProduct','createProdType','addGeneralComment','changeGeneralComment','delGeneralComment','upGeneralComment','downGeneralComment');
|
||||
if (in_array($command, $cmdArray)) {
|
||||
if (!($this->userrights->hasCurrentUserRight('right_products'))) {
|
||||
if ($command == 'createProdType') {
|
||||
|
@ -93,6 +93,8 @@ class Products {
|
|||
$this->delExtra($_POST['id']);
|
||||
} else if ($command == 'applyExtra') {
|
||||
$this->applyExtra($_POST['name'],$_POST['price'],$_POST['id']);
|
||||
} else if ($command == 'upExtra') {
|
||||
$this->upExtra($_POST['id']);
|
||||
} else if ($command == 'sortup') {
|
||||
$this->sortup($_POST['prodid']);
|
||||
} else if ($command == 'sortdown') {
|
||||
|
@ -225,8 +227,8 @@ class Products {
|
|||
$fav = 0;
|
||||
}
|
||||
|
||||
$sql = "SELECT DISTINCT %extras%.id AS extraid,%extras%.name AS name,%extras%.price as price FROM %extras%,%extrasprods%
|
||||
WHERE %extrasprods%.prodid=? AND %extras%.id=%extrasprods%.extraid AND %extras%.removed is null ORDER BY name";
|
||||
$sql = "SELECT DISTINCT %extras%.id AS extraid,%extras%.name AS name,%extras%.price as price,%extras%.sorting as sorting FROM %extras%,%extrasprods%
|
||||
WHERE %extrasprods%.prodid=? AND %extras%.id=%extrasprods%.extraid AND %extras%.removed is null ORDER BY sorting,name";
|
||||
|
||||
$stmt = $pdo->prepare($this->dbutils->resolveTablenamesInSqlString($sql));
|
||||
$stmt->execute(array($row['id']));
|
||||
|
@ -261,7 +263,7 @@ class Products {
|
|||
|
||||
function getAllExtrasAlphaSortedCore($pdo) {
|
||||
$pdo = $this->dbutils->openDbAndReturnPdo();
|
||||
$sql = "select id,name,price from %extras% WHERE removed is null ORDER BY name";
|
||||
$sql = "select id,name,price,sorting from %extras% WHERE removed is null ORDER BY sorting,name";
|
||||
$stmt = $pdo->prepare($this->dbutils->resolveTablenamesInSqlString($sql));
|
||||
$stmt->execute();
|
||||
$result = $stmt->fetchAll(PDO::FETCH_OBJ);
|
||||
|
@ -422,7 +424,7 @@ class Products {
|
|||
if (is_null($pdo)) {
|
||||
$pdo = $this->dbutils->openDbAndReturnPdo();
|
||||
}
|
||||
$sql = "SELECT id,name,price FROM %extras% WHERE removed is null";
|
||||
$sql = "SELECT id,name,price,sorting FROM %extras% WHERE removed is null ORDER by sorting";
|
||||
$stmt = $pdo->prepare($this->dbutils->resolveTablenamesInSqlString($sql));
|
||||
$stmt->execute();
|
||||
$result = $stmt->fetchAll(PDO::FETCH_OBJ);
|
||||
|
@ -595,6 +597,16 @@ class Products {
|
|||
}
|
||||
}
|
||||
|
||||
private static function getMaxSortingOfExtras($pdo) {
|
||||
$sql = "SELECT max(sorting) as maxsort FROM %extras% WHERE removed is null";
|
||||
$row = CommonUtils::getRowSqlObject($pdo, $sql,null);
|
||||
$max = 0;
|
||||
if (!is_null($row) && !is_null($row->maxsort)) {
|
||||
$max = intval($row->maxsort);
|
||||
}
|
||||
return $max;
|
||||
}
|
||||
|
||||
private function getMaxSortOfGenComment($pdo) {
|
||||
$sql = "SELECT MAX(sorting) as maxsort from %comments% WHERE prodid is null";
|
||||
$stmt = $pdo->prepare($this->dbutils->resolveTablenamesInSqlString($sql));
|
||||
|
@ -635,33 +647,40 @@ class Products {
|
|||
$pdo = DbUtils::openDbAndReturnPdoStatic();
|
||||
}
|
||||
|
||||
$sql = "SELECT id FROM %extras% WHERE name=? AND removed is null";
|
||||
$stmt = $pdo->prepare(DbUtils::substTableAlias($sql));
|
||||
$stmt->execute(array($name));
|
||||
$numberOfExtras = $stmt->rowCount();
|
||||
|
||||
if ($numberOfExtras > 0) {
|
||||
return ERROR_NAME_EXISTS_ALREADY;
|
||||
}
|
||||
|
||||
$sql = "INSERT INTO `%extras%` (`id`,`name`,`price`) VALUES(NULL,?,?)";
|
||||
$stmt = $pdo->prepare(DbUtils::substTableAlias($sql));
|
||||
$stmt->execute(array($name,$price));
|
||||
$lastExtraId = $pdo->lastInsertId();
|
||||
|
||||
$sql = "DELETE FROM %extrasprods% WHERE id=?";
|
||||
$stmt = $pdo->prepare(DbUtils::substTableAlias($sql));
|
||||
$stmt->execute(array($lastExtraId));
|
||||
|
||||
foreach ($assignedProdIds as $assProdId) {
|
||||
$sql = "INSERT INTO %extrasprods% (`id` , `extraid` , `prodid`) VALUES (NULL,?,?)";
|
||||
try {
|
||||
$sql = "SELECT id FROM %extras% WHERE name=? AND removed is null";
|
||||
$stmt = $pdo->prepare(DbUtils::substTableAlias($sql));
|
||||
$stmt->execute(array($lastExtraId,$assProdId));
|
||||
$stmt->execute(array($name));
|
||||
$numberOfExtras = $stmt->rowCount();
|
||||
|
||||
$histextra = self::getExtrasForProd($pdo,$assProdId);
|
||||
self::updateHistOnlyForExtrasOfProd($pdo, $assProdId,$histextra);
|
||||
if ($numberOfExtras > 0) {
|
||||
return ERROR_NAME_EXISTS_ALREADY;
|
||||
}
|
||||
|
||||
$maxPos = self::getMaxSortingOfExtras($pdo);
|
||||
|
||||
$sql = "INSERT INTO `%extras%` (`id`,`name`,`price`,`sorting`) VALUES(NULL,?,?,?)";
|
||||
$stmt = $pdo->prepare(DbUtils::substTableAlias($sql));
|
||||
$stmt->execute(array($name,$price,$maxPos+1));
|
||||
$lastExtraId = $pdo->lastInsertId();
|
||||
|
||||
$sql = "DELETE FROM %extrasprods% WHERE id=?";
|
||||
$stmt = $pdo->prepare(DbUtils::substTableAlias($sql));
|
||||
$stmt->execute(array($lastExtraId));
|
||||
|
||||
foreach ($assignedProdIds as $assProdId) {
|
||||
$sql = "INSERT INTO %extrasprods% (`id` , `extraid` , `prodid`) VALUES (NULL,?,?)";
|
||||
$stmt = $pdo->prepare(DbUtils::substTableAlias($sql));
|
||||
$stmt->execute(array($lastExtraId,$assProdId));
|
||||
|
||||
$histextra = self::getExtrasForProd($pdo,$assProdId);
|
||||
self::updateHistOnlyForExtrasOfProd($pdo, $assProdId,$histextra);
|
||||
}
|
||||
return OK;
|
||||
} catch (Exception $ex) {
|
||||
echo $ex->getMessage();
|
||||
exit;
|
||||
}
|
||||
return OK;
|
||||
}
|
||||
|
||||
private function createExtra($name,$price) {
|
||||
|
@ -684,6 +703,29 @@ class Products {
|
|||
}
|
||||
}
|
||||
|
||||
private function upExtra($id) {
|
||||
$pdo = DbUtils::openDbAndReturnPdoStatic();
|
||||
|
||||
$pdo->beginTransaction();
|
||||
|
||||
$sql = "SELECT sorting FROM %extras% WHERE id=?";
|
||||
$row = CommonUtils::getRowSqlObject($pdo, $sql, array($id));
|
||||
$currentPos = intval($row->sorting);
|
||||
if ($currentPos > 1) {
|
||||
$sql = "SELECT id FROM %extras% WHERE sorting=? AND removed is NULL";
|
||||
$row = CommonUtils::getRowSqlObject($pdo, $sql, array($currentPos-1));
|
||||
if (!is_null($row) && !is_null($row->id)) {
|
||||
$idUpper = $row->id;
|
||||
|
||||
$sql = "UPDATE %extras% SET sorting=? WHERE id=?";
|
||||
CommonUtils::execSql($pdo, $sql, array($currentPos,$idUpper));
|
||||
CommonUtils::execSql($pdo, $sql, array($currentPos-1,$id));
|
||||
}
|
||||
}
|
||||
$pdo->commit();
|
||||
$this->getAllExtrasAlphaSorted();
|
||||
}
|
||||
|
||||
private function applyExtra($name,$price,$id) {
|
||||
try {
|
||||
$pdo = $this->dbutils->openDbAndReturnPdo();
|
||||
|
@ -719,11 +761,24 @@ class Products {
|
|||
|
||||
private function delExtra($id) {
|
||||
try {
|
||||
$pdo = $this->dbutils->openDbAndReturnPdo();
|
||||
$sql = "UPDATE %extras% SET removed='1' WHERE id=?";
|
||||
$pdo = DbUtils::openDbAndReturnPdoStatic();
|
||||
|
||||
$sql = "SELECT sorting FROM %extras% WHERE id=?";
|
||||
$row = CommonUtils::getRowSqlObject($pdo, $sql, array($id));
|
||||
$currentPos = $row->sorting;
|
||||
$maxPos = self::getMaxSortingOfExtras($pdo);
|
||||
|
||||
$sql = "UPDATE %extras% SET removed='1',sorting=? WHERE id=?";
|
||||
$stmt = $pdo->prepare($this->dbutils->resolveTablenamesInSqlString($sql));
|
||||
$stmt->execute(array($id));
|
||||
$stmt->execute(array(null,$id));
|
||||
$this->getAllExtrasAlphaSorted();
|
||||
|
||||
// decrease all sortings, independently of the removed flag, by 1
|
||||
for ($i=$currentPos;$i<=$maxPos;$i++) {
|
||||
$sql = "UPDATE %extras% SET sorting=? WHERE sorting=?";
|
||||
CommonUtils::execSql($pdo, $sql, array($i-1,$i));
|
||||
}
|
||||
|
||||
}
|
||||
catch (PDOException $e) {
|
||||
echo json_encode(array("status" => "ERROR", "code" => ERROR_GENERAL_DB_NOT_READABLE, "msg" => ERROR_GENERAL_DB_NOT_READABLE_MSG));
|
||||
|
|
|
@ -8,5 +8,3 @@ $command = $_GET["command"];
|
|||
|
||||
$updater = new Updater();
|
||||
$updater->handleCommand($command);
|
||||
|
||||
?>
|
|
@ -117,7 +117,7 @@ class Updater {
|
|||
$infoFileLines = $infoFile["msg"];
|
||||
|
||||
if (count($infoFileLines) > 1) {
|
||||
$checkIfNewerVersion = self::isV2Newer('1.3.9',trim($infoFileLines[0]));
|
||||
$checkIfNewerVersion = self::isV2Newer('1.3.10',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);
|
||||
|
@ -143,7 +143,7 @@ class Updater {
|
|||
}
|
||||
|
||||
private static function genVerKey($v) {
|
||||
$vparts = split("\.",$v);
|
||||
$vparts = explode('.',$v);
|
||||
$len = count($vparts);
|
||||
$key = 0;
|
||||
try {
|
||||
|
|
|
@ -525,5 +525,4 @@ class TypeAndProductFileManager {
|
|||
}
|
||||
return $ret;
|
||||
}
|
||||
}
|
||||
?>
|
||||
}
|
|
@ -335,6 +335,7 @@ class Basedb {
|
|||
`id` INT (10) NOT NULL AUTO_INCREMENT PRIMARY KEY ,
|
||||
`name` VARCHAR ( 150 ) NOT NULL,
|
||||
`price` " . DECIMALSMALL . " NOT NULL,
|
||||
`sorting` INT(2) NULL,
|
||||
`removed` INT(1) NULL
|
||||
) CHARACTER SET utf8 COLLATE utf8_general_ci ENGINE = InnoDb ;
|
||||
";
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
<meta http-equiv="content-type" content="text/html; charset=utf-8">
|
||||
<meta name="author" content="Stefan Pichel">
|
||||
|
||||
<link rel="stylesheet" type="text/css" href="css/bestformat.css?v=1.3.9">
|
||||
<link rel="stylesheet" type="text/css" href="css/bestformat.css?v=1.3.10">
|
||||
|
||||
<link rel="stylesheet" href="php/contenthandler.php?module=admin&command=getmobilecss" />
|
||||
<link rel="stylesheet" href="php/3rdparty/orderstyle/jquery.mobile.icons.min.css" />
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
<meta http-equiv="content-type" content="text/html; charset=utf-8">
|
||||
<meta name="author" content="Stefan Pichel">
|
||||
|
||||
<link rel="stylesheet" type="text/css" href="css/bestformat.css?v=1.3.9">
|
||||
<link rel="stylesheet" type="text/css" href="css/bestformat.css?v=1.3.10">
|
||||
<link rel="stylesheet" href="php/contenthandler.php?module=admin&command=getmobilecss" />
|
||||
<link rel="stylesheet" href="php/3rdparty/orderstyle/jquery.mobile.icons.min.css" />
|
||||
|
||||
|
@ -220,7 +220,9 @@ function setLanguage(language) {
|
|||
delExtra(objid);
|
||||
} else if (cmd == 'applyextra') {
|
||||
applyExtra(objid);
|
||||
}
|
||||
} else if (cmd == 'upextra') {
|
||||
upExtra(objid);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -857,6 +859,9 @@ function setLanguage(language) {
|
|||
createOrApplyExtra(name,price,"applyExtra",extraid);
|
||||
}
|
||||
|
||||
function upExtra(extraid) {
|
||||
doAjax("POST","php/contenthandler.php?module=products&command=upExtra",{id:extraid},handleExtraCreation,"Extras");
|
||||
}
|
||||
function createOrApplyExtra(name,price,fct,id) {
|
||||
price = price.replace(",",".");
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
<meta http-equiv="content-type" content="text/html; charset=utf-8">
|
||||
<meta name="author" content="Stefan Pichel">
|
||||
|
||||
<link rel="stylesheet" type="text/css" href="css/bestformat.css?v=1.3.9">
|
||||
<link rel="stylesheet" type="text/css" href="css/bestformat.css?v=1.3.10">
|
||||
<link rel="stylesheet" href="php/contenthandler.php?module=admin&command=getmobilecss" />
|
||||
<link rel="stylesheet" href="php/3rdparty/orderstyle/jquery.mobile.icons.min.css" />
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
<meta http-equiv="content-type" content="text/html; charset=utf-8">
|
||||
<meta name="author" content="Stefan Pichel">
|
||||
|
||||
<link rel="stylesheet" type="text/css" href="css/bestformat.css?v=1.3.9">
|
||||
<link rel="stylesheet" type="text/css" href="css/bestformat.css?v=1.3.10">
|
||||
<link rel="stylesheet" href="php/contenthandler.php?module=admin&command=getmobilecss" />
|
||||
<link rel="stylesheet" href="php/3rdparty/orderstyle/jquery.mobile.icons.min.css" />
|
||||
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<meta http-equiv="content-type" content="text/html; charset=utf-8">
|
||||
<meta name="author" content="Stefan Pichel">
|
||||
<link rel="stylesheet" type="text/css" href="css/bestformat.css?v=1.3.9">
|
||||
<link rel="stylesheet" type="text/css" href="css/bestformat.css?v=1.3.10">
|
||||
<link rel="stylesheet" href="php/contenthandler.php?module=admin&command=getmobilecss" />
|
||||
<link rel="stylesheet" href="php/3rdparty/orderstyle/jquery.mobile.icons.min.css" />
|
||||
|
||||
|
@ -695,7 +695,7 @@ $(document).on("pagebeforeshow", "#changeres-page", function () {
|
|||
|
||||
<div data-role="fieldcontain">
|
||||
<label for="customer" class="select" style="width: 100%;"><span id="customertxt">Kunde</span>: </label>
|
||||
<input type="text" id="customer" value="" data-mini="true" placeholder="Name / Telefon"/>
|
||||
<input type="text" id="customer" class="reservationinputfield" value="" data-mini="true" placeholder="Name / Telefon"/>
|
||||
</div> <!-- fieldcontain name -->
|
||||
<div id="customerlist"></div>
|
||||
|
||||
|
@ -703,22 +703,22 @@ $(document).on("pagebeforeshow", "#changeres-page", function () {
|
|||
|
||||
<p><div data-role="fieldcontain">
|
||||
<label for="guestname" class="select" style="width: 100%;"><span id="nametxt">Name</span>: </label>
|
||||
<input type="text" id="guestname" value="" data-mini="true" />
|
||||
<input type="text" id="guestname" class="reservationinputfield" value="" data-mini="true" />
|
||||
</div> <!-- fieldcontain name -->
|
||||
|
||||
<div data-role="fieldcontain">
|
||||
<label for="email" class="select" style="width: 100%;"><span id="emailtxt">Email</span>: </label>
|
||||
<input type="text" id="email" value="" data-mini="true" />
|
||||
<input type="text" id="email" class="reservationinputfield" value="" data-mini="true" />
|
||||
</div> <!-- fieldcontain name -->
|
||||
|
||||
<div data-role="fieldcontain">
|
||||
<label for="telno" class="select" style="width: 100%;"><span id="teltxt">Telefon</span>: </label>
|
||||
<input type="text" id="telno" value="" data-mini="true" />
|
||||
<input type="text" id="telno" class="reservationinputfield" value="" data-mini="true" />
|
||||
</div> <!-- fieldcontain name -->
|
||||
|
||||
<div data-role="fieldcontain">
|
||||
<label for="remark" class="select" style="width: 100%;"><span id="remarktxt">Notiz</span>: </label>
|
||||
<input type="text" id="remark" value="" data-mini="true" />
|
||||
<input type="text" id="remark" class="reservationinputfield" value="" data-mini="true" />
|
||||
</div> <!-- fieldcontain name -->
|
||||
|
||||
<a href="#" data-role="button" data-theme="f" id="newbtn"><span id="newtxt">Neu</span></a>
|
||||
|
@ -856,22 +856,22 @@ $(document).on("pagebeforeshow", "#changeres-page", function () {
|
|||
|
||||
<div data-role="fieldcontain">
|
||||
<label for="cguestname" class="select" style="width: 200px;"><span id="cnametxt">Name</span>: </label>
|
||||
<input type="text" id="cguestname" value="" data-mini="true" />
|
||||
<input type="text" id="cguestname" class="reservationinputfield" value="" data-mini="true" />
|
||||
</div> <!-- fieldcontain cguestname -->
|
||||
|
||||
<div data-role="fieldcontain">
|
||||
<label for="cemail" class="select" style="width: 200px;"><span id="cemailtxt">Name</span>: </label>
|
||||
<input type="text" id="cemail" value="" data-mini="true" />
|
||||
<input type="text" id="cemail" class="reservationinputfield" value="" data-mini="true" />
|
||||
</div> <!-- fieldcontain cemail -->
|
||||
|
||||
<div data-role="fieldcontain">
|
||||
<label for="ctelno" class="select" style="width: 200px;"><span id="cteltxt">Telefon</span>: </label>
|
||||
<input type="text" id="ctelno" value="" data-mini="true" />
|
||||
<input type="text" id="ctelno" class="reservationinputfield" value="" data-mini="true" />
|
||||
</div> <!-- fieldcontain ctelno -->
|
||||
|
||||
<div data-role="fieldcontain">
|
||||
<label for="cremark" class="select" style="width: 200px;"><span id="cremarktxt">Notiz</span>: </label>
|
||||
<input type="text" id="cremark" value="" data-mini="true" />
|
||||
<input type="text" id="cremark" class="reservationinputfield" value="" data-mini="true" />
|
||||
</div> <!-- fieldcontain cremark -->
|
||||
|
||||
<p>
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
<meta http-equiv="content-type" content="text/html; charset=utf-8">
|
||||
<meta name="author" content="Stefan Pichel">
|
||||
|
||||
<link rel="stylesheet" type="text/css" href="css/bestformat.css?v=1.3.9">
|
||||
<link rel="stylesheet" type="text/css" href="css/bestformat.css?v=1.3.10">
|
||||
|
||||
<link rel="stylesheet" href="php/contenthandler.php?module=admin&command=getmobilecss" />
|
||||
<link rel="stylesheet" href="php/3rdparty/orderstyle/jquery.mobile.icons.min.css" />
|
||||
|
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue