diff --git a/webapp/kitchenbar.js b/webapp/kitchenbar.js
index 7123164..4c789af 100644
--- a/webapp/kitchenbar.js
+++ b/webapp/kitchenbar.js
@@ -4,7 +4,6 @@ var KB_TO_MAKE = ["Herzustellen","To prepare","Para preparar"];
var KB_TO_FINISHED = ["Fertig","Ready to serve","Completo"];
var KB_TABLE = ["Tisch","Table","Mesa"];
-// user has rights (default: no)
var isInitialized = false;
var displayWorkToDo = false;
@@ -15,7 +14,6 @@ var cookedEntries = null;
var entriesToCook = null;
var user = "";
-// increase performance by calling AJAX a bit later as a thread
function declareProductBeCookingOrCooked(queueid,action) {
window.setTimeout(function(){declareProductBeCookingOrCooked_orig(queueid,action)},100);
}
@@ -48,14 +46,12 @@ function removeOrRedeclareAnIdFromPrepared(theId,doRemove) {
var aList = table.queueitems;
var tablename = table.table;
- // now remove this from the list or change entry!
var i=0;
var found = false;
for (i=0;i';
aList += '
';
@@ -297,7 +290,6 @@ function fillTableWithCookedEntriesCore() {
} else {
- // remove also headline of list, if list is empty
$("#listWithCookedEntries").html("");
}
}
@@ -346,7 +338,6 @@ function insertGeneralConfigItems(configResult) {
getAndDisplayAllEntries();
} else {
setTimeout(function(){document.location.href = "index.html"},250); // not logged in
- //alert("Fehler beim Aufruf der Seite: " + configResult.msg);
}
}
@@ -363,7 +354,6 @@ function setWorkMode(urlsuffix) {
*/
function setHeadlines() {
if (!displayHeaderFooter) {
- // then replace by individual footer (embedded in iframe)
if (displayWorkToDo) {
$("#moduleheadline").html(KB_TO_MAKE[lang]);
} else if (displayFinished) {
@@ -403,14 +393,11 @@ function groupMadeItems(theSet) {
var joinedNeedle = name + "-" + option + "-" + "-" + table + "_" + extras;
var index = grouped.joinedvals.indexOf(joinedNeedle);
if (index >= 0) {
- // element is already in group
grouped.counts[index] = grouped.counts[index] + 1;
var queueidsarr = grouped.queueids[index];
- // append the current queueid
queueidsarr[queueidsarr.length] = queueid;
grouped.queueids[index] = queueidsarr;
} else {
- // new element to be inserted in grouped
var gLength = grouped.counts.length;
grouped.counts[gLength] = 1;
grouped.joinedvals[gLength] = joinedNeedle;
@@ -453,14 +440,11 @@ function groupItemToMake(theSet) {
var joinedNeedle = name + "-" + option + "-" + waiticon + "-" + cooking;
var index = grouped.joinedvals.indexOf(joinedNeedle);
if (index >= 0) {
- // element is already in group
grouped.counts[index] = grouped.counts[index] + 1;
var queueidsarr = grouped.queueids[index];
- // append the current queueid
queueidsarr[queueidsarr.length] = queueid;
grouped.queueids[index] = queueidsarr;
} else {
- // new element to be inserted in grouped
var gLength = grouped.counts.length;
grouped.counts[gLength] = 1;
grouped.joinedvals[gLength] = joinedNeedle;
diff --git a/webapp/manager.html b/webapp/manager.html
index 265aa50..35c0807 100644
--- a/webapp/manager.html
+++ b/webapp/manager.html
@@ -5,7 +5,7 @@
-
+
@@ -129,7 +129,7 @@ var MAN_MAX_NO_OF_TABLES = ["Max. Anzahl Tische pro Raum: ","Max. number of tabl
var MAN_CHANGE_ROOM_SIZE = ["Raumgröße ändern","Change room size","Cambiar dimensión de espacio"];
var MAN_ROOM_LABEL = ["Räume","Rooms","Espacios"];
var MAN_TABLE_LABEL = ["Tische","Tables","Mesas"];
-
+var MAN_TABLE_TXT = ["Tisch","Table","Mesa"];
var MAN_LANG_OF_RECEIPT = ["Bonsprache","Receipt language","Idioma de tique"];
var MAN_PRINT_CONCEPT = ["Druckkonzept","Print concept","Concepto de impresión"];
var MAN_PAYMENT_CONFIG = ["Menü Zahlungsweg","Menu Payment Type","Selección tipo de pagar"];
@@ -156,6 +156,9 @@ var MAN_PRINT_AND_QUEUE_HINT = ["Wird dieser Wert auf 'ja' gesetzt, so werden di
var MAN_CASH_HINT = ["Die Kassen kann mit dieser Einstellung übergangen werden (Einstellung: nein). Jede Bestellung wird dann sofort mit der Übermittlung an den Server als als bar bezahlt deklariert.",
"The cash function can be skipped ('no'). In this case every order will be declared as paid by cash automatically.",
"Si configurado a 'no', cada ordern va a ser declarada pagada."];
+var MAN_RETURN_TO_ORDER_HINT = ["Wird der Wert auf 'ja' gesetzt, so wechselt die Desktopansicht automatisch wieder in den Bestellmodus über, nachdem ein ausgewählter Tisch komplett abgerechnet oder im Kassenmodus auf einen leeren Tisch geklickt wurde.",
+ "If this value is set to 'true' the mode of the desktop view automatically returns to the ordering after all products of the selected table are marked paid or an empty table was selected.",
+ "Si es 'si' el modus vuelve a ordenar despues de declarar todos los productos de la mesa estado pagado o si el usario ha seleccionado una mesa vacia."];
var MAN_WAITER_GOPAY_DESCR = ["Im Arbeitsablauf 'nur Arbeitsbons' bestimmt diese Einstellung, ob bei Druck auf den Button 'Kasse' Arbeitsbons gedruckt werden sollen.",
"In the 'only work receipts' workflow this setting specifies if after pressing the 'paydesk' button in the waiter's view work receipts shall be printed.",
"En el modus 'solo tiques de trabajar' este boton especifica se debe imprimido el tique de trabajar despues el click en el boton 'caja' en la vista de camarero."];
@@ -311,8 +314,10 @@ 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 MAN_GENSECTION_TXT = ["Allgemeine Einstellungen:","General settings:","Configuración general:"];
var MAN_MOBILSECTION_TXT = ["Einstellungen für die Mobilansicht:","Settings for the mobil view:","Configuración para la vista mobil:"];
+var MAN_DESKTOP_SECTION_TXT = ["Einstellungen für die Desktop-Ansicht:","Settings for the desktop view","Configuración para la vista de PC"];
var MAN_PRINT_AND_QUEUE = ["Drucke Jobs und zeige sie auch in der Küchen-/Baransicht an","Print jobs and show them also in the kitchen/bar view","Imprimir orders y también inserta en la vista de cocina/bar"];
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_RESTAURANT_MODE = ["Restaurantmodus","Restaurant mode","Usar para restaurantes"];
var MAN_REST_MODE_HINT = ["Hinweis: Wird der Restaurantmodus auf Nein gesetzt, wird in der Desktopansicht die Tischauswahl deaktiviert. Alle Produkte werden als Außer-Haus-Verkauf gebucht.","Hint: If the restautant mode is set to no in the desktop view the table selection is deactivated and all products are ordered as to-go","Nota: Si el modus del restaurante es configurado a no en la vista de Desktop la selección de las mesas es deactivada y todos los productos son ordenados como to-go"];
@@ -323,9 +328,11 @@ var MAN_HOTELINTERFACE = ["Anbindung Hotelsoftware","Interface hotel software","
var MAN_HSINFILE = ["HS/3 Datei HS3CASH.IN","HS/3 file HS3CASH.IN","HS/3 file HS3CASH.IN"];
var MAN_HSOUTFILE = ["HS/3 Datei HS3CASH.OUT","HS/3 file HS3CASH.OUT","HS/3 file HS3CASH.OUT"];
var MAN_HSCURRENCY = ["HS/3 Währungsangabe","HS/3 Currency","HS/3 Moneda"];
+var MAN_DEL_HINT = ["Zum Löschen anklicken","Click to delete","Click para removar"];
+var MAN_FONTSIZE_HINT = ["Die Schriftgröße hat nur Einfluss, wenn kein eigenes Layout festgelegt wurde.","The font size only effects receipts if they do not use a specified layout.","El valor sólo funciona si no se usa un layout individual."];
var 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];
+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 numberOfClosings = 0;
@@ -366,6 +373,7 @@ var generalValuesSettings = [
["cashenabled",MAN_CASH[lang],"s",20],
["beepcooked",MAN_BEEP_COOKED[lang],"s",21],
["restaurantmode",MAN_RESTAURANT_MODE[lang],"s",23],
+ ["returntoorder",MAN_CASH[lang],"s",24],
["addreceipttoprinter",MAN_ADD_RECPRINTER[lang],"s",16],
["workflowconfig",MAN_WORKFLOW[lang],"s",4],
["receiptfontsize",MAN_RECEIPT_FONTSIZE[lang],"s",0],
@@ -374,14 +382,12 @@ var generalValuesSettings = [
["remoteaccesscode",MAN_REMOTE_ACCESS[lang],"i",0,""],
["cancelunpaidcode",MAN_CANCEL_UNPAID_CODE[lang],"i",0,""],
["cancelguestcode",MAN_CANCEL_GUEST_CODE[lang],"i",0,""],
- // REM SMTP settings
["smtphost",MAN_SMTPHOST[lang],"i",0,""],
["smtpauth",MAN_SMTPAUTH[lang],"s",5],
["smtpuser",MAN_SMTPUSER[lang],"i",0,""],
["smtppass",MAN_SMTPPASS[lang],"i",0,""],
["smtpsecure",MAN_SMTPSECURE[lang],"s",6],
["smtpport",MAN_SMTPPORT[lang],"i",0,""],
-// // REM Web setting
["webimpressum",MAN_WEBIMPRESSUM[lang],"i",0,""],
["paydeskid",MAN_PAYDESKID[lang],"i",0,""],
@@ -505,14 +511,17 @@ function setLanguage(l) {
$("#digiprinthint").html(MAN_DIGI_PRINTWORK_HINT[l]);
$("#generalsectiontxt").html(MAN_GENSECTION_TXT[l]);
$("#mobilviewsectiontxt").html(MAN_MOBILSECTION_TXT[l]);
+ $("#desktopviewsectiontxt").html(MAN_DESKTOP_SECTION_TXT[l]);
$("#specialsettingssectiontxt").html(MAN_SPECIAL_SETTINGS_TXT[l]);
$("#printandqueuehint").html(MAN_PRINT_AND_QUEUE_HINT[l]);
$("#cashhint").html(MAN_CASH_HINT[l]);
+ $("#returntoorderhint").html(MAN_RETURN_TO_ORDER_HINT[l]);
$("#hsinfiletxt").html(MAN_HSINFILE[l]);
$("#hsoutfiletxt").html(MAN_HSOUTFILE[l]);
$("#hscurrencytxt").html(MAN_HSCURRENCY[l]);
$("#restmodehint").html(MAN_REST_MODE_HINT[l]);
+ $("#workfontsizehint").html(MAN_FONTSIZE_HINT[l]);
}
function createMonthSelection(label) {
@@ -616,6 +625,7 @@ function insertGeneralConfigItems(configResult) {
$("#partOfDigiprintwork").html(createDigiprintwork(values.digiprintwork));
$("#partOfPrintAndQueueJobs").html(createPrintAndQueueJobs(values.printandqueuejobs));
$("#partOfCash").html(createCash(values.cashenabled));
+ $("#partOfReturntoorder").html(createReturntoorder(values.returntoorder));
$("#partOfBeepCooked").html(createBeepCooked(values.beepcooked));
$("#partOfRestaurantmode").html(createRestaurantmode(values.restaurantmode));
@@ -666,6 +676,7 @@ function insertGeneralConfigItems(configResult) {
generalVals[21] = values.beepcooked;
generalVals[22] = values.hotelinterface;
generalVals[23] = values.restaurantmode;
+ generalVals[24] = values.returntoorder;
$("#smtphost").val(values.smtphost);
$("#partOfSmtpauth").html(createSMTPAuth(values.smtpauth));
@@ -818,6 +829,9 @@ function createPrintAndQueueJobs(theValue) {
function createCash(theValue) {
return createYesNo("cashenabled",MAN_CASH, theValue);
}
+function createReturntoorder(theValue) {
+ return createYesNo("returntoorder",MAN_RETURNTOORDER, theValue);
+}
function createBeepCooked(theValue) {
return createYesNo("beepcooked",MAN_BEEP_COOKED, theValue);
}
@@ -1180,7 +1194,6 @@ function binding() {
$( "#nochangeddata" ).popup( "open", {transition: 'flip'} );
} else {
areYouSure(MAN_CHANGE_CONFIG_HEAD[lang], MAN_CHANGE_CONFIG_CONTENT[lang] + changeInfoText, MAN_YES[lang], function() {
- // test for validity
var isValid = true;
for (i=0;i
Summe
Netto
Zahl.weg
Status
";
var i=0;
for (i=0;i
Nach Produkten: ";
- // count | productname | price | tax | sumprice |
html += "
Anzahl
Prod.
Preis
Steuer
Summe
";
for (i=0;i' + MAN_CSV_EXP_ALL[lang] + '';
- // email buttons
var receiverEmail = $("#receiveremail").val();
closingPart += '
diff --git a/webapp/php/admin.php b/webapp/php/admin.php
index 573d05a..a4a84ff 100644
--- a/webapp/php/admin.php
+++ b/webapp/php/admin.php
@@ -287,7 +287,6 @@ class Admin {
echo json_encode("Yes");
}
} else {
- // not defined -> it must be version 1.0.3 or lower --> since this is file of 1.0.4: not installed...
echo json_encode("No");
}
}
@@ -349,7 +348,6 @@ class Admin {
session_start();
}
if (!isset($_SESSION['angemeldet']) || !$_SESSION['angemeldet']) {
- // no user logged in
echo json_encode("NO");
} else {
echo json_encode("YES");
@@ -378,7 +376,6 @@ class Admin {
}
}
- // for the login mask - if user is authenticated then the first page works different
function tryAuthenticate($userid,$password,$modus,$day,$month,$year,$hour,$minute,$unixtime) {
$pdo = DbUtils::openDbAndReturnPdoStatic();
@@ -430,7 +427,6 @@ class Admin {
$_SESSION['angemeldet'] = true;
- // now read the rights of the user
$_SESSION['userid'] = $zeile['id'];
$_SESSION['currentuser'] = $username;
@@ -721,7 +717,7 @@ class Admin {
return;
}
- $configItems = join(",",array("'decpoint'","'version'","'cancelunpaidcode'","'tax'","'togotax'","'taxaustrianormal'","'taxaustriaerm1'","'taxaustriaerm2'","'taxaustriaspecial'","'currency'","'workflowconfig'","'prominentsearch'","'discount1'","'discount2'","'discount3'","'waitergopayprint'","'cashenabled'","'restaurantmode'"));
+ $configItems = join(",",array("'decpoint'","'version'","'cancelunpaidcode'","'tax'","'togotax'","'taxaustrianormal'","'taxaustriaerm1'","'taxaustriaerm2'","'taxaustriaspecial'","'currency'","'workflowconfig'","'prominentsearch'","'discount1'","'discount2'","'discount3'","'waitergopayprint'","'cashenabled'","'returntoorder'","'restaurantmode'"));
$sql = "select name,setting FROM %config% WHERE name in ($configItems)";
$stmt = $pdo->prepare(DbUtils::substTableAlias($sql));
$stmt->execute();
@@ -813,6 +809,7 @@ class Admin {
$addreceipttoprinter = CommonUtils::getConfigValue($pdo,"addreceipttoprinter","");
$printandqueuejobs = CommonUtils::getConfigValue($pdo,"printandqueuejobs",0);
$cashenabled = CommonUtils::getConfigValue($pdo,"cashenabled",1);
+ $returntoorder = CommonUtils::getConfigValue($pdo,"returntoorder",1);
$beepcooked = CommonUtils::getConfigValue($pdo,"beepcooked",0);
$restaurantmode = CommonUtils::getConfigValue($pdo,"restaurantmode",1);
@@ -868,7 +865,7 @@ class Admin {
"austria" => $austria, "digigopaysetready" => $digigopaysetready, "waitergopayprint" => $waitergopayprint, "oneprodworkreceipts" => $oneprodworkreceipts,
"digiprintwork" => $digiprintwork, "memorylimit" => $memorylimit, "hs3refresh" => $hs3refresh,
"paydeskid" => $paydeskid, "aeskey" => $aeskey, "certificatesn" => $certificatesn, "addreceipttoprinter" => $addreceipttoprinter,
- "printandqueuejobs" => $printandqueuejobs, "cashenabled" => $cashenabled, "beepcooked" => $beepcooked,"restaurantmode" => $restaurantmode
+ "printandqueuejobs" => $printandqueuejobs, "cashenabled" => $cashenabled, "returntoorder" => $returntoorder, "beepcooked" => $beepcooked,"restaurantmode" => $restaurantmode
);
if ($forHtml) {
@@ -897,7 +894,6 @@ class Admin {
$right_rating = $_SESSION['right_rating'];
if (self::isOnlyRatingUser($rights, $right_rating, true)) {
- // rating user always goes into that view - important setting after creation of user
echo json_encode("rating.html");
return;
}
@@ -928,7 +924,6 @@ class Admin {
}
}
- // test if user has still the right to go into that view
$mapping = array (
"waiter.html" => 'right_waiter',
"kitchen.html" => 'right_kitchen',
@@ -946,7 +941,6 @@ class Admin {
$valid = false;
if (($view == 'preferences.html') || ($view == 'feedback.html')) {
- // always ok
$valid = true;
} else if ($view == 'manager.html') {
if (($_SESSION['is_admin'] == 1) || ($_SESSION['right_manager'] == 1) || ($_SESSION['right_closing'] == 1)) {
@@ -961,11 +955,10 @@ class Admin {
$view = "preferences.html";
}
- echo json_encode($view . "?v=1.3.1");
+ echo json_encode($view . "?v=1.3.2");
}
}
- // for client request
function isLoggedinUserAdmin() {
if ($this->isCurrentUserAdmin()) {
echo json_encode(YES);
@@ -1028,14 +1021,12 @@ class Admin {
session_start();
}
if (!isset($_SESSION['angemeldet']) || !$_SESSION['angemeldet']) {
- // no user logged in
return false;
} else {
return ($_SESSION[$whichRight]);
}
}
- // for internal request
function isCurrentUserAdmin() {
return $this->hasCurrentUserRight('is_admin');
}
@@ -1101,7 +1092,6 @@ class Admin {
private function fillSampleContent()
{
$pdo = DbUtils::openDbAndReturnPdoStatic();
- // first remove previous content, then fill the SQL file
$sql = "DELETE FROM `%queue%`";
$stmt = $pdo->prepare(DbUtils::substTableAlias($sql));
$stmt->execute();
@@ -1139,7 +1129,6 @@ class Admin {
$waiterMessage = "";
$loggedIn = true;
if (!isset($_SESSION['angemeldet']) || !$_SESSION['angemeldet']) {
- // no user logged in
$mainMenu[] = array("name" => "Startseite", "link" => "index.html");
$loggedIn = false;
} else {
@@ -1168,25 +1157,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.1"); };
+ if ($_SESSION['right_waiter']) { $mainMenu[] = array("name" => $waitertxt[$lang], "link" => "waiter.html?v=1.3.2"); };
} else {
- if ($_SESSION['right_waiter']) { $mainMenu[] = array("name" => $waiterdesktxt[$lang], "link" => "waiterdesktop.php?v=1.3.1"); };
+ if ($_SESSION['right_waiter']) { $mainMenu[] = array("name" => $waiterdesktxt[$lang], "link" => "waiterdesktop.php?v=1.3.2"); };
}
- if ($_SESSION['right_kitchen']) { $mainMenu[] = array("name" => $kitchentxt[$lang], "link" => "kitchen.html?v=1.3.1"); };
- if ($_SESSION['right_bar']) { $mainMenu[] = array("name" => "Bar", "link" => "bar.html?v=1.3.1"); };
- if ($_SESSION['right_supply']) { $mainMenu[] = array("name" => $supplytxt[$lang], "link" => "supplydesk.html?v=1.3.1"); };
+ if ($_SESSION['right_kitchen']) { $mainMenu[] = array("name" => $kitchentxt[$lang], "link" => "kitchen.html?v=1.3.2"); };
+ if ($_SESSION['right_bar']) { $mainMenu[] = array("name" => "Bar", "link" => "bar.html?v=1.3.2"); };
+ if ($_SESSION['right_supply']) { $mainMenu[] = array("name" => $supplytxt[$lang], "link" => "supplydesk.html?v=1.3.2"); };
if ($_SESSION['modus'] == 0) {
- if ($_SESSION['right_paydesk']) { $mainMenu[] = array("name" => $paydesktxt[$lang], "link" => "paydesk.html?v=1.3.1"); };
+ if ($_SESSION['right_paydesk']) { $mainMenu[] = array("name" => $paydesktxt[$lang], "link" => "paydesk.html?v=1.3.2"); };
}
- if ($_SESSION['right_statistics']) { $mainMenu[] = array("name" => $stattxt[$lang], "link" => "reports.html?v=1.3.1"); };
- if ($_SESSION['right_bill']) { $mainMenu[] = array("name" => $bontxt[$lang], "link" => "bill.html?v=1.3.1"); };
- if ($_SESSION['right_products']) { $mainMenu[] = array("name" => $prodtxt[$lang], "link" => "products.html?v=1.3.1"); };
- if ($_SESSION['right_reservation']) { $mainMenu[] = array("name" => $restxt[$lang], "link" => "reservation.html?v=1.3.1"); };
- if ($_SESSION['right_rating']) { $mainMenu[] = array("name" => $ratingtxt[$lang], "link" => "rating.html?v=1.3.1"); };
- if ($_SESSION['right_customers']) { $mainMenu[] = array("name" => $customerstxt[$lang], "link" => "customers.html?v=1.3.1"); };
- if ($_SESSION['right_manager'] || $_SESSION['is_admin'] || $_SESSION['right_closing']) { $mainMenu[] = array("name" => $admintxt[$lang], "link" => "manager.html?v=1.3.1"); };
- $mainMenu[] = array("name" => $settingtxt[$lang], "link" => "preferences.html?v=1.3.1");
- $mainMenu[] = array("name" => "Feedback", "link" => "feedback.html?v=1.3.1");
+ if ($_SESSION['right_statistics']) { $mainMenu[] = array("name" => $stattxt[$lang], "link" => "reports.html?v=1.3.2"); };
+ if ($_SESSION['right_bill']) { $mainMenu[] = array("name" => $bontxt[$lang], "link" => "bill.html?v=1.3.2"); };
+ if ($_SESSION['right_products']) { $mainMenu[] = array("name" => $prodtxt[$lang], "link" => "products.html?v=1.3.2"); };
+ if ($_SESSION['right_reservation']) { $mainMenu[] = array("name" => $restxt[$lang], "link" => "reservation.html?v=1.3.2"); };
+ if ($_SESSION['right_rating']) { $mainMenu[] = array("name" => $ratingtxt[$lang], "link" => "rating.html?v=1.3.2"); };
+ if ($_SESSION['right_customers']) { $mainMenu[] = array("name" => $customerstxt[$lang], "link" => "customers.html?v=1.3.2"); };
+ if ($_SESSION['right_manager'] || $_SESSION['is_admin'] || $_SESSION['right_closing']) { $mainMenu[] = array("name" => $admintxt[$lang], "link" => "manager.html?v=1.3.2"); };
+ $mainMenu[] = array("name" => $settingtxt[$lang], "link" => "preferences.html?v=1.3.2");
+ $mainMenu[] = array("name" => "Feedback", "link" => "feedback.html?v=1.3.2");
}
$mainMenu[] = array("name" => $logout[$lang], "link" => "logout.php");
@@ -1194,8 +1183,7 @@ class Admin {
$waiterMessage = $this->getMessage(null, "waitermessage");
}
- // CAUTION: change version also in config.txt!!!
- $mainMenuAndVersion = array ("version" => "OrderSprinter 1.3.1",
+ $mainMenuAndVersion = array ("version" => "OrderSprinter 1.3.2",
"user" => $currentUser,
"menu" => $mainMenu,
"waitermessage" => $waiterMessage,
@@ -1289,7 +1277,6 @@ class Admin {
echo json_encode(array("status" => "ERROR", "code" => ERROR_NAME_EXISTS_ALREADY, "msg" => ERROR_NAME_EXISTS_ALREADY_MSG));
return;
} else {
- // create the new user
if(session_id() == '') {
session_start();
@@ -1300,7 +1287,6 @@ class Admin {
echo json_encode(array("status" => "ERROR", "code" => ERROR_COMMAND_NOT_ADMIN, "msg" => ERROR_COMMAND_NOT_ADMIN_MSG));
return;
} else {
- // instead if password_hash (PHP > 5.5) use MD5...
$password_hash = md5($password);
$keys = array('id','userpassword','language');
@@ -1331,7 +1317,6 @@ class Admin {
}
}
- // now this has to be logged in the history tables...
HistFiller::createUserInHist($pdo,$lastId);
}
@@ -1473,6 +1458,7 @@ class Admin {
"cancelguestcode" => array("dbcol" => "cancelguestcode","checknum" => 0),
"printandqueuejobs" => array("dbcol" => "printandqueuejobs","checknum" => 0),
"cashenabled" => array("dbcol" => "cashenabled","checknum" => 0),
+ "returntoorder" => array("dbcol" => "returntoorder","checknum" => 0),
"beepcooked" => array("dbcol" => "beepcooked","checknum" => 0),
"restaurantmode" => array("dbcol" => "restaurantmode","checknum" => 0),
"smtphost" => array("dbcol" => "smtphost","checknum" => 0),
@@ -1495,7 +1481,6 @@ class Admin {
$aVal = $aChangeSet['value'];
if ($name == "payprinttype") {
- // special care: 1->l 2->s
if (((string)$aVal) == "1") {
$aVal = "l";
}
@@ -1567,7 +1552,6 @@ class Admin {
}
function changeOneConfigDbItem($pdo,$theItem,$theValue,$table,$doHist) {
- // is the value already there, or has it to be created?
$sql = "SELECT setting from $table WHERE name=?";
$stmt = $pdo->prepare(DbUtils::substTableAlias($sql));
@@ -1585,7 +1569,6 @@ class Admin {
}
if ($doHist) {
- // now this has to be logged in the history tables...
$this->histfiller->updateConfigInHist($pdo,$theItem, $theValue);
}
}
@@ -1600,7 +1583,6 @@ class Admin {
}
function updateUser() {
- // get the name of the user
$pdo = DbUtils::openDbAndReturnPdoStatic();
$theUserId = $_POST['userid'];
@@ -1675,7 +1657,6 @@ class Admin {
function getCurrentUser() {
if (!isset($_SESSION['angemeldet']) || !$_SESSION['angemeldet']) {
- // no user logged in
echo json_encode("Nobody");
} else {
echo json_encode($_SESSION['currentuser']);
@@ -1796,7 +1777,6 @@ class Admin {
}
if ($ok) {
- // allowed to change password
$newp_hash = md5($newpassword);
$sql = "UPDATE %user% set userpassword=? WHERE active='1' AND username=?";
$stmt = $pdo->prepare(DbUtils::substTableAlias($sql));
@@ -2077,13 +2057,40 @@ class Admin {
$version = $genInfo["version"];
$timezone = DbUtils::getTimeZone();
+
+ $dbContent = json_decode($content,true);
+
+ foreach($dbContent as $table) {
+ if ($table['table'] == 'config') {
+
+ $foundConfigItem = null;
+ foreach($table['content'] as $aConfigItem) {
+ foreach($aConfigItem as $aConfigDbPart) {
+ if (($aConfigDbPart['fieldname'] == 'name') && ($aConfigDbPart['value'] == 'version')) {
+ $foundConfigItem = $aConfigItem;
+ break;
+ }
+ }
+ }
+ if (!is_null($foundConfigItem)) {
+ foreach($foundConfigItem as $aConfigDbPart) {
+ if ($aConfigDbPart['fieldname'] == 'setting') {
+ $bakVersion = base64_decode($aConfigDbPart['value']);
+ if ($bakVersion != $version) {
+ header("Location: ../infopage.html?e=manager.html=Backup_hat_die_falsche_Version:_$bakVersion.");
+ exit();
+ }
+ }
+ }
+ }
+
+ }
+ }
$basedb->dropTables($pdo);
$basedb->createEmptyTables($pdo);
- $dbContent = json_decode($content,true);
-
$typeIsOnlyConfig = true;
foreach($dbContent as $table) {
@@ -2153,7 +2160,6 @@ class Admin {
}
$pdo->commit();
- // logout (by the restore other user or rights may have been applied)
if(session_id() == '') {
session_start();
}
diff --git a/webapp/php/bill.php b/webapp/php/bill.php
index f07e10a..f99e84c 100644
--- a/webapp/php/bill.php
+++ b/webapp/php/bill.php
@@ -36,7 +36,6 @@ class Bill {
function handleCommand($command) {
if ($command == 'exportCsv') {
if ($this->hasCurrentUserAdminOrManagerRights()) {
- // yes, we can export the data
$this->exportCsv($_GET['startMonth'],$_GET['startYear'],$_GET['endMonth'],$_GET['endYear'],DO_CSV);
} else {
echo json_encode(array("status" => "ERROR", "code" => ERROR_BILL_NOT_AUTHOTRIZED, "msg" => ERROR_BILL_NOT_AUTHOTRIZED_MSG));
@@ -45,7 +44,6 @@ class Bill {
}
if ($command == 'exportXlsx') {
if ($this->hasCurrentUserAdminOrManagerRights()) {
- // yes, we can export the data
$this->exportCsv($_GET['startMonth'],$_GET['startYear'],$_GET['endMonth'],$_GET['endYear'],DO_EXCEL);
} else {
echo json_encode(array("status" => "ERROR", "code" => ERROR_BILL_NOT_AUTHOTRIZED, "msg" => ERROR_BILL_NOT_AUTHOTRIZED_MSG));
@@ -75,7 +73,6 @@ class Bill {
if ($command == 'exportCsvOfClosing') {
if ($this->hasCurrentUserAdminOrManagerRights()) {
- // yes, we can export the data
$this->exportCsvOfClosing($_GET['closingid'],DO_CSV);
} else {
echo json_encode(array("status" => "ERROR", "code" => ERROR_MANAGER_NOT_AUTHOTRIZED, "msg" => ERROR_MANAGER_NOT_AUTHOTRIZED_MSG));
@@ -84,7 +81,6 @@ class Bill {
}
if ($command == 'exportXlsxOfClosing') {
if ($this->hasCurrentUserAdminOrManagerRights()) {
- // yes, we can export the data
$this->exportCsvOfClosing($_GET['closingid'],DO_EXCEL);
} else {
echo json_encode(array("status" => "ERROR", "code" => ERROR_MANAGER_NOT_AUTHOTRIZED, "msg" => ERROR_MANAGER_NOT_AUTHOTRIZED_MSG));
@@ -133,11 +129,9 @@ class Bill {
}
}
- // for internal request
private function hasCurrentUserBillRights() {
session_start();
if (!isset($_SESSION['angemeldet']) || !$_SESSION['angemeldet']) {
- // no user logged in
return false;
} else {
return ($_SESSION['right_bill']);
@@ -147,18 +141,15 @@ class Bill {
private function hasCurrentUserPaydeskRights() {
session_start();
if (!isset($_SESSION['angemeldet']) || !$_SESSION['angemeldet']) {
- // no user logged in
return false;
} else {
return ($_SESSION['right_paydesk']);
}
}
- // for internal request
private function hasCurrentUserAdminOrManagerRights() {
session_start();
if (!isset($_SESSION['angemeldet']) || !$_SESSION['angemeldet']) {
- // no user logged in
return false;
} else {
return ($_SESSION['right_manager'] || $_SESSION['is_admin']);
@@ -186,7 +177,6 @@ class Bill {
function getBillWithId($pdo,$billid,$language,$printer,$includeGuestInfo = false) {
set_time_limit(120);
- // is bill correct with signature?
$commonUtils = new CommonUtils();
$correct = $commonUtils->verifyBill($pdo, $billid);
if (!$correct) {
@@ -194,9 +184,7 @@ class Bill {
return;
}
- // first: get the bill overall data
- // is the bill for a table or togo
$sql = "SELECT tableid FROM %bill% WHERE id=?";
$stmt = $pdo->prepare(DbUtils::substTableAlias($sql));
$stmt->execute(array($billid));
@@ -210,14 +198,12 @@ class Bill {
$tableid = $row->tableid;
if ($qrow->countid == 0) {
if ($tableid == 0) {
- // togo
$sql = "SELECT DISTINCT billdate,brutto,netto,'-' as tablename,username,host,IFNULL(%bill%.status,'') as status,guestinfo FROM %bill%,%user% WHERE %bill%.id=? AND userid=%user%.id AND tableid='0' ";
} else {
$sql = "SELECT DISTINCT billdate,brutto,netto,tableno as tablename,username,host,IFNULL(%bill%.status,'') as status,guestinfo FROM %bill%,%user%,%resttables% WHERE %bill%.id=? AND userid=%user%.id AND tableid=%resttables%.id ";
}
} else {
if ($tableid == 0) {
- // togo
$sql = "SELECT DISTINCT billdate,brutto,netto,'-' as tablename,username,host,IFNULL(%bill%.status,'') as status,guestinfo FROM %bill%,%user%,%queue% WHERE %bill%.id=? AND %bill%.id=%queue%.billid AND userid=%user%.id AND tableid='0' AND paidtime is not null ";
} else {
$sql = "SELECT DISTINCT billdate,brutto,netto,tableno as tablename,username,host,IFNULL(%bill%.status,'') as status,guestinfo FROM %bill%,%user%,%resttables%,%queue% WHERE %bill%.id=? AND %bill%.id=%queue%.billid AND userid=%user%.id AND tableid=%resttables%.id AND paidtime is not null ";
@@ -245,7 +231,6 @@ class Bill {
}
if ($row == null) {
- // no rows found -> deliver no content
echo json_encode(array("billoverallinfo" => array()));
return;
} else {
@@ -305,7 +290,6 @@ class Bill {
);
}
- // now get all products of this bill
$sql = "select productname,price,%pricelevel%.name as pricelevelname,togo,count(%queue%.productname) as count,%prodtype%.kind as kind from %queue%,%pricelevel%,%billproducts%,%prodtype%,%products% where %billproducts%.billid=? AND %billproducts%.queueid=%queue%.id AND %queue%.pricelevel = %pricelevel%.id AND %queue%.productid = %products%.id AND %products%.category = %prodtype%.id group by kind, productname,price,pricelevelname,togo";
$stmt = $pdo->prepare($this->dbutils->resolveTablenamesInSqlString($sql));
$stmt->execute(array($billid));
@@ -346,7 +330,6 @@ class Bill {
* insert or take out cash money. The direction done by sign of $money value
*/
private function doCashAction($money,$remark) {
- // current time
date_default_timezone_set(DbUtils::getTimeZone());
$currentTime = date('Y-m-d H:i:s');
@@ -361,12 +344,10 @@ class Bill {
if ($row != null) {
$sum = $row->bruttosum;
if (is_null($sum)) {
- // no transaction after last closing
$sum = 0.0;
}
if (($sum + floatval($money)) >= 0.0) {
- // Test if it is allowed to insert new bill as storno bill or if manipulation has happened
$nextbillid = $this->testForNewBillIdAndUpdateWorkTable($pdo);
if ($nextbillid < 0) {
echo json_encode(array("status" => "ERROR", "code" => ERROR_INCONSISTENT_DB, "msg" => ERROR_INCONSISTENT_DB_MSG));
@@ -374,7 +355,6 @@ class Bill {
}
$userId = $this->getUserId();
- // now calculate the signature for the bill entry
$commonUtils = new CommonUtils();
if (trim($money) == '') {
$money = '0.00';
@@ -418,7 +398,6 @@ class Bill {
function getCashOverviewOfUser() {
$userId = $this->getUserId();
- // without cash insert and cash takeout
$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'";
@@ -431,7 +410,6 @@ class Bill {
}
}
- // with cash
$cashByGuestsAndInsertTakeOut = 0.0;
$sql = "SELECT sum(brutto) as sumtotal FROM %bill% WHERE closingid is null AND paymentid='1' AND userid='$userId' AND (status is null OR status ='c')";
$stmt = $pdo->prepare($this->dbutils->resolveTablenamesInSqlString($sql));
@@ -453,7 +431,6 @@ class Bill {
$whenClause = " (billdate >= ? AND billdate <= ?)";
- // search for the bill language
$pdo = $this->dbutils->openDbAndReturnPdo();
$admin = new Admin();
$genValues = $admin->getGeneralConfigItems(false, $pdo);
@@ -495,7 +472,6 @@ class Bill {
$resultarray[] = $arr;
}
- // insert also the host-html just in case it is needed
$hosthtml = file_get_contents("../customer/bon-bewirtungsvorlage.html");
ob_start();
@@ -525,7 +501,6 @@ class Bill {
if (!$commonUtils->verifyLastBillId($pdo, $nextbillid)) {
return (-1);
} else {
- // ok - then increment that last id in the work table
$commonUtils->setLastBillIdInWorkTable($pdo, $nextbillid);
return $nextbillid;
}
@@ -579,13 +554,11 @@ class Bill {
$userid = $this->getUserId();
- // current time
date_default_timezone_set(DbUtils::getTimeZone());
$currentTime = date('Y-m-d H:i:s');
$billid = (-1);
- // find highest bill id
$sql = "SELECT id from %bill% ORDER BY id DESC";
$stmt = $pdo->prepare(DbUtils::substTableAlias($sql));
$stmt->execute();
@@ -599,7 +572,6 @@ class Bill {
$tableid = 0;
}
- // now calculate the signature for the bill entry
$signature = $commonUtils->calcSignatureForBill($pdo,$currentTime, $brutto, $netto, '0.00', $userid);
$billInsertSql = "INSERT INTO `%bill%` (`id` , `billdate`,`brutto`,`netto`,`tableid`,`paymentid`,`userid`,`ref`,`tax`,`host`,`reservationid`,`guestinfo`,`intguestid`,`intguestpaid`,`signature`) VALUES (?,?,?,?,?,?,?,NULL,NULL,?,?,?,?,?,?)";
@@ -607,7 +579,6 @@ class Bill {
$stmt->execute(array($billid,$currentTime,$brutto,$netto,$tableid,$paymentId,$userid,$host,$reservationid,$guestinfo,$intguestid,$intguestpaid,$signature));
$newBillId = $pdo->lastInsertId();
- // now declare them all to be paid:
for ($i=0;$i "ERROR", "code" => ERROR_BILL_NOT_STORNO_CODE, "msg" => ERROR_BILL_NOT_STORNO_CODE_MSG));
}
@@ -652,19 +620,16 @@ class Bill {
}
if (!is_numeric($billid)) {
- // this may be an attack...
if ($doEcho) {
echo json_encode(array("status" => "ERROR", "code" => ERROR_BILL_WRONG_NUMERIC_VALUE, "msg" => ERROR_BILL_WRONG_NUMERIC_VALUE_MSG));
}
return false;
}
- // Do transactional cancel
if ($doOwnTransaction) {
$pdo->beginTransaction();
}
- // is the bill already closed? In this case no cancel is allowed!
$sql = "SELECT brutto,netto,tax,tableid,closingid,status,paymentid,reservationid,guestinfo,intguestid,intguestpaid FROM %bill% WHERE id=?";
$stmt = $pdo->prepare($this->dbutils->resolveTablenamesInSqlString($sql));
$stmt->execute(array($billid));
@@ -673,7 +638,6 @@ class Bill {
if ($row != null) {
$closingId = $row->closingid;
- // save the next data for a copy!
$brutto = $row->brutto;
$netto = $row->netto;
$tax = $row->tax;
@@ -709,7 +673,6 @@ class Bill {
return false;
}
- // is bill correct with signature?
$commonUtils = new CommonUtils();
$correct = $commonUtils->verifyBill($pdo, $billid);
if (!$correct) {
@@ -722,7 +685,6 @@ class Bill {
return false;
}
- // Test if it is allowed to insert new bill as storno bill or if manipulation has happened
$nextbillid = $this->testForNewBillIdAndUpdateWorkTable($pdo);
if ($nextbillid < 0) {
if ($doEcho) {
@@ -734,7 +696,6 @@ class Bill {
return false;
}
- // 0. find the queueitems that are related to that bill
$sql = "SELECT id FROM %queue% WHERE billid=?";
$stmt = $pdo->prepare($this->dbutils->resolveTablenamesInSqlString($sql));
$stmt->execute(array($billid));
@@ -745,7 +706,6 @@ class Bill {
$queueIdArray[] = $row['id'];
}
- // 1. clear connection between queue item and bill
if ($removeproducts == 0) {
$sql = "UPDATE %queue% SET paidtime=null,billid=null WHERE billid=?";
} else {
@@ -754,7 +714,6 @@ class Bill {
$stmt = $pdo->prepare($this->dbutils->resolveTablenamesInSqlString($sql));
$stmt->execute(array($billid));
- // 2. copy bill with negativ brutto as part of storno
$userIdOfStornoUser = $this->getUserId();
$stornval = 0.0 - floatval($brutto);
$stornonettoval = 0.0 - floatval($netto);
@@ -775,7 +734,6 @@ class Bill {
$stmt = $pdo->prepare(DbUtils::substTableAlias($sql));
$stmt->execute(array($row->brutto + $row->prevbrutto + $stornval,$row->netto + $row->prevnetto + $stornonettoval,$refIdOfStornoEntry));
- // 3. mark bill as part of storno
$sql = "UPDATE %bill% SET status='x', closingid=null, ref=?, intguestid=?,intguestpaid=? WHERE id=?";
$stmt = $pdo->prepare($this->dbutils->resolveTablenamesInSqlString($sql));
$stmt->execute(array($refIdOfStornoEntry,null,null,$billid));
@@ -786,7 +744,6 @@ class Bill {
$stmt->execute(array($reason,$billid));
}
- // 4. now put the queue items into the billproducts so that later storno is evaluable
foreach ($queueIdArray as $aQueueid) {
$billProdsSql = "INSERT INTO `%billproducts%` (`queueid` , `billid`) VALUES ( ?,?)";
$stmt = $pdo->prepare($this->dbutils->resolveTablenamesInSqlString($billProdsSql));
@@ -798,7 +755,6 @@ class Bill {
if ($doOwnTransaction) {
$pdo->commit();
}
- // end of transactional cancel
if ($doEcho) {
echo json_encode(array("status" => "OK", "code" => OK));
@@ -892,7 +848,6 @@ class Bill {
$endMonth = "0" . $endMonth;
}
$startDate = $startYear . "-" . $startMonth . "-01 00:00:00";
- // now find last day of month of end date!
$endDate = $endYear . "-" . $endMonth . "-01";
$lastdayOfMonth = date("t", strtotime($endDate));
$endDate = $endYear . "-" . $endMonth . "-" . $lastdayOfMonth . " 23:59:59";
@@ -942,7 +897,6 @@ class Bill {
$firstRow[] = $this->t['PayWay'][$l];
$firstRow[] = $this->t['ClosRemark'][$l];
} else {
- // closing id is know - do not output unnecessary info
$firstRow[] = $this->t['PayWay'][$l];
}
@@ -960,10 +914,8 @@ class Bill {
$sql .= "WHERE closingid is not null AND %bill%.closingid=%closing%.id ";
$sql .= " AND %bill%.paymentid=%payment%.id ";
if ($onlyClosingId == null) {
- // search for time span
$sql .= " AND %bill%.billdate BETWEEN ? AND ? ";
} else {
- // search for a special closing id
$sql .= " AND closingid=? ";
}
$sql .= " AND %bill%.userid = %user%.id ";
diff --git a/webapp/php/printqueue.php b/webapp/php/printqueue.php
index 81c525d..88e507b 100644
--- a/webapp/php/printqueue.php
+++ b/webapp/php/printqueue.php
@@ -71,6 +71,8 @@ class PrintQueue {
$this->batchReceiptPrintJob($_POST['start'],$_POST['end']);
} else if ($command == 'getLastLog') {
$this->getLastLog($_POST['pass']);
+ } else if ($command == 'deleteSpooledPrintJob') {
+ $this->deleteSpooledPrintJob($_POST['id']);
} else {
echo "Kommando nicht erkannt!";
}
@@ -139,21 +141,27 @@ class PrintQueue {
$jobs = array();
for ($printer=1;$printer<7;$printer++) {
- $sql = "SELECT count(id) as count FROM %printjobs% WHERE printer=? AND type != '1' AND type != '2'";
- $stmt = $pdo->prepare(DbUtils::substTableAlias($sql));
- $stmt->execute(array($printer));
- $result = $stmt->fetchObject();
- $jobs[] = array("printer" => $printer, "jobs" => $result->count);
+ $sql = "SELECT %printjobs%.id as id,%bill%.id as billid,billdate,brutto,%resttables%.tableno as tablename 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));
+ $jobs[] = array("printer" => $printer, "count" => count($result),"jobs" => $result);
}
- $sql = "SELECT count(id) as count FROM %printjobs% WHERE type=?";
+ $sql = "SELECT %printjobs%.id as id,content FROM %printjobs% WHERE type=?";
$stmt = $pdo->prepare(DbUtils::substTableAlias($sql));
$stmt->execute(array(1));
- $result = $stmt->fetchObject();
- $jobs[] = array("printer" => 7, "jobs" => $result->count);
+ $result = $stmt->fetchAll();
+ $works = array();
+ foreach($result as $r) {
+ $works[] = array("id" => $r['id'],"content" => json_decode($r['content']));
+ }
+ $jobs[] = array("printer" => 7, "count" => count($result),"jobs" => $works);
$stmt->execute(array(2));
- $result = $stmt->fetchObject();
- $jobs[] = array("printer" => 8, "jobs" => $result->count);
+ $result = $stmt->fetchAll();
+ $works = array();
+ foreach($result as $r) {
+ $works[] = array("id" => $r['id'],"content" => json_decode($r['content']));
+ }
+ $jobs[] = array("printer" => 8, "count" => count($result),"jobs" => $works);
echo json_encode(array("status" => "OK", "msg" => $jobs));
}
@@ -208,6 +216,20 @@ class PrintQueue {
}
}
+ function deleteSpooledPrintJob($printjobid) {
+ if (!($this->userrights->hasCurrentUserRight('right_manager')) &&
+ !($this->userrights->hasCurrentUserRight('is_admin'))
+ ) {
+ echo "Benutzerrechte nicht ausreichend!";
+ return false;
+ }
+
+ $pdo = DbUtils::openDbAndReturnPdoStatic();
+ $sql = "DELETE FROM %printjobs% WHERE id=?";
+ CommonUtils::execSql($pdo, $sql, array($printjobid));
+ echo json_encode(array("status" => "OK"));
+ }
+
function queueReceiptPrintJob($billid,$useaddrecprinter) {
// waiter, or manager, bill, admin rights required
if (!($this->userrights->hasCurrentUserRight('right_paydesk')) &&
diff --git a/webapp/php/products.php b/webapp/php/products.php
index f221e9e..c30ff02 100644
--- a/webapp/php/products.php
+++ b/webapp/php/products.php
@@ -217,7 +217,7 @@ class Products {
}
$sql = "SELECT DISTINCT %extras%.id AS extraid,%extras%.name AS name FROM %extras%,%extrasprods%
- WHERE %extrasprods%.prodid=? AND %extras%.id=%extrasprods%.extraid AND %extras%.removed is null";
+ WHERE %extrasprods%.prodid=? AND %extras%.id=%extrasprods%.extraid AND %extras%.removed is null ORDER BY name";
$stmt = $pdo->prepare($this->dbutils->resolveTablenamesInSqlString($sql));
$stmt->execute(array($row['id']));
@@ -356,7 +356,6 @@ class Products {
}
private function getMenuLevelUp($ref) {
- // from which type does the current type reference to?
$pdo = $this->dbutils->openDbAndReturnPdo();
$sql = "SELECT reference from %prodtype% where removed is null AND id=?";
$stmt = $pdo->prepare($this->dbutils->resolveTablenamesInSqlString($sql));
@@ -511,7 +510,6 @@ class Products {
$itemsql = $aProdDef["histget"];
if ($item != "") {
if ($itemsql == 'tax') {
- // IF(tax is not null, tax, '-') as tax
$value = ($zeile['tax']);
if ($value == null) {
$value = '-';
@@ -569,7 +567,6 @@ class Products {
$pdo = $this->dbutils->openDbAndReturnPdo();
$pdo->beginTransaction();
- // getSortingOfProduct
$this->sorter->resortAfterProduct($pdo, $prodid);
$sql = "UPDATE %products% SET category=? WHERE id=?";
@@ -578,7 +575,6 @@ class Products {
$affectedRows = $stmt->rowCount();
$pdo->commit();
if ($affectedRows == 1) {
- // now declare as set to end to list
$this->sorter->setMaxSortingForProdId($pdo, $prodid);
echo json_encode(array("status" => "OK"));
} else {
@@ -621,7 +617,6 @@ class Products {
return $ids;
}
- // to be called by manager-readSpeisekarte
public static function createExtraCore($pdo,$name,$price,$assignedProdIds) {
if (is_null($pdo)) {
$pdo = DbUtils::openDbAndReturnPdoStatic();
@@ -731,10 +726,8 @@ class Products {
$pdo = $this->dbutils->openDbAndReturnPdo();
$pdo->beginTransaction();
- // what is the max sort number because it shall be added afterwards
$maxSorting = $this->getMaxSortOfGenComment($pdo);
- // insert the comment
$sql = "INSERT INTO `%comments%` (`id`,`comment`,`prodid`,`active`,`sorting`) VALUES(NULL,?,NULL,1,?)";
$stmt = $pdo->prepare($this->dbutils->resolveTablenamesInSqlString($sql));
$stmt->execute(array($comment,$maxSorting+1));
@@ -799,7 +792,6 @@ class Products {
try {
$pdo = $this->dbutils->openDbAndReturnPdo();
$pdo->beginTransaction();
- // which sorting has the comment to delete?
$sorting = $this->getSortingOfComment($pdo, $id);
if ($sorting < 0) {
@@ -807,12 +799,10 @@ class Products {
return;
}
- // delete the comment
$sql = "DELETE FROM %comments% WHERE id=? AND prodid is null";
$stmt = $pdo->prepare($this->dbutils->resolveTablenamesInSqlString($sql));
$stmt->execute(array($id));
- // subtract all sortings by one higher then the deleted sorting index
$sql = "SELECT id,sorting FROM %comments% WHERE sorting>? AND prodid is null";
$stmt = $pdo->prepare($this->dbutils->resolveTablenamesInSqlString($sql));
$stmt->execute(array($sorting));
@@ -840,7 +830,6 @@ class Products {
$pdo = $this->dbutils->openDbAndReturnPdo();
$pdo->beginTransaction();
- // which sorting has the comment to delete?
$sorting = $this->getSortingOfComment($pdo, $id);
if ($sorting < 0) {
@@ -848,20 +837,17 @@ class Products {
return;
}
if ($sorting == 1) {
- // finished
$pdo->commit();
echo json_encode(array("status" => "OK"));
return;
}
- // get comment before
$sql = "SELECT id FROM %comments% WHERE sorting=? AND prodid is null";
$stmt = $pdo->prepare($this->dbutils->resolveTablenamesInSqlString($sql));
$stmt->execute(array($sorting - 1));
$row = $stmt->fetchObject();
$previousId = $row->id;
- // change these two comments in its ordering
$sql = "UPDATE %comments% SET sorting=? WHERE id=?";
$stmt = $pdo->prepare($this->dbutils->resolveTablenamesInSqlString($sql));
$stmt->execute(array($sorting,$previousId));
@@ -883,7 +869,6 @@ class Products {
$pdo = $this->dbutils->openDbAndReturnPdo();
$pdo->beginTransaction();
- // which sorting has the comment to delete?
$sorting = $this->getSortingOfComment($pdo, $id);
if ($sorting < 0) {
@@ -891,23 +876,19 @@ class Products {
return;
}
- // is it at end of list?
$maxSorting = $this->getMaxSortOfGenComment($pdo);
if (($maxSorting == 0) || ($maxSorting == $sorting)) {
- // finished
$pdo->commit();
echo json_encode(array("status" => "OK"));
return;
}
- // get comment afterwards
$sql = "SELECT id FROM %comments% WHERE sorting=? AND prodid is null";
$stmt = $pdo->prepare($this->dbutils->resolveTablenamesInSqlString($sql));
$stmt->execute(array($sorting + 1));
$row = $stmt->fetchObject();
$nextId = $row->id;
- // change these two comments in its ordering
$sql = "UPDATE %comments% SET sorting=? WHERE id=?";
$stmt = $pdo->prepare($this->dbutils->resolveTablenamesInSqlString($sql));
$stmt->execute(array($sorting,$nextId));
@@ -963,7 +944,6 @@ class Products {
if ($changeExtras == 1) {
$this->changeExtraAssignment($pdo, $id, $extras);
}
- // now this has to be logged in the history tables...
HistFiller::updateProdInHist($pdo,$id);
} else {
@@ -1025,7 +1005,6 @@ class Products {
$pdo = $this->dbutils->openDbAndReturnPdo();
$pdo->beginTransaction();
- // which kind is the referenced type?
$sql = "SELECT kind FROM %prodtype% WHERE id=?";
$stmt = $pdo->prepare($this->dbutils->resolveTablenamesInSqlString($sql));
$stmt->execute(array($id));
@@ -1067,7 +1046,6 @@ class Products {
return;
}
- // now this has to be logged in the history tables...
HistFiller::createProdInHist($pdo, $newProdId);
echo json_encode("OK: sql");
@@ -1146,7 +1124,6 @@ class Products {
return $allProdsAndTypesInThisLevel;
}
- // return in text format
private function readDbProductsWithRef_json_version($pdo,$ref,$depth) {
$decpoint = $this->getDecPoint($pdo);
$text = "";
@@ -1157,7 +1134,6 @@ class Products {
for ($index_prod=0;$index_prodreadDbProducts($pdo);
diff --git a/webapp/php/queuecontent.php b/webapp/php/queuecontent.php
index c2043ef..6b995ca 100644
--- a/webapp/php/queuecontent.php
+++ b/webapp/php/queuecontent.php
@@ -172,14 +172,12 @@ class QueueContent {
* $kind=0 -> return only food elements, =1 -> return drinks
*/
private function getJsonAllQueueItemsToMake($kind) {
- // current time
date_default_timezone_set(DbUtils::getTimeZone());
$currentTime = date('Y-m-d H:i:s');
$pdo = $this->dbutils->openDbAndReturnPdo();
- // first sort all non-ready products ordered by ordertime
if ($this->areBillExisting($pdo)) {
$sql = "SELECT DISTINCT %queue%.id as id,%resttables%.id as tableid,tablenr,longname,anoption,tableno,date_format(ordertime,'%Y-%m-%d %H:%i:00') as ordertime,cooking,TIMESTAMPDIFF(MINUTE,ordertime,?) AS waittime FROM %queue%,%products%,%prodtype%,%resttables%,%bill% ";
@@ -196,7 +194,6 @@ class QueueContent {
$sql .= "%queue%.workprinted='0') ";
if ($this->areBillExisting($pdo)) {
- // now remove closed items
$sql .= "AND (%queue%.billid is null OR (";
$sql .= "%queue%.billid=%bill%.id AND %bill%.closingid is null)) ";
}
@@ -256,7 +253,6 @@ class QueueContent {
for ($queue_index=0;$queue_index < count($resultarray);$queue_index++) {
$aTable = $resultarray[$queue_index]['tablenr'];
if (($table <> $aTable) && !in_array($aTable,$insertedTables)) {
- // sort all entries for this table
$table = $aTable;
$tableid = $resultarray[$queue_index]['tableid'];
$maxWaitTime = $resultarray[$queue_index]['waittime'];
@@ -265,9 +261,6 @@ class QueueContent {
if ($resultarray[$i]['tablenr'] == $table) {
$foundItem = $resultarray[$i];
$waittimeofentry = intval($foundItem['waittime']);
- // icons of waittime
- // 1-20 in 1 min steps
- // 25,30,40,50,60min
$waitIconMinStep = 1;
if ($waittimeofentry <= 1) {
$waitIconMinStep = 1;
@@ -299,7 +292,6 @@ class QueueContent {
$tableArr[] = $anEntryForThisTable;
}
}
- // Now fit max wait time of table to entry wait time steps:
if (($maxWaitTime > 20) && ($maxWaitTime < 60)) {
if ($maxWaitTime >= 50) {
$maxWaitTime = "> 50";
@@ -377,7 +369,6 @@ class QueueContent {
$jobs = array();
foreach($queueItems as $aQueueItem) {
- // is the job for that printer?
$thePrinter = $aQueueItem["printer"];
$queueid = $aQueueItem["id"];
@@ -412,7 +403,6 @@ class QueueContent {
}
if ($groupworkitems) {
- // now put the count number into the longname
foreach($jobs as &$aJob) {
$cnt = $aJob["count"];
$aJob["longname"] = $cnt . "x " . $aJob["longname"];
@@ -459,7 +449,6 @@ class QueueContent {
}
private function doWorkPrintCore($pdo,$theTableid,$insertedQueueIds,$username,$payPrintType,$lang,$declareReadyDelivered = true) {
- // is it server or local print?
$foodJobsPrinter1 = $this->getJobsToPrint($pdo, 0, 1, $insertedQueueIds);
$foodJobsPrinter2 = $this->getJobsToPrint($pdo, 0, 2, $insertedQueueIds);
@@ -536,7 +525,6 @@ class QueueContent {
private function getJsonLastMadeItems($kind) {
$pdo = DbUtils::openDbAndReturnPdoStatic();
- // first sort all non-ready products ordered by ordertime
if ($this->areBillExisting($pdo)) {
$sql = "SELECT DISTINCT %queue%.id as id,tablenr,longname,anoption,tableno,readytime,%products%.id as prodid FROM %queue%,%products%,%prodtype%,%resttables%,%bill% ";
} else {
@@ -553,7 +541,6 @@ class QueueContent {
$sql .= "%queue%.workprinted='0') ";
if ($this->areBillExisting($pdo)) {
- // now remove closed items
$sql .= "AND (%queue%.billid is null OR (";
$sql .= "%queue%.billid=%bill%.id AND %bill%.closingid is null)) ";
}
@@ -580,7 +567,6 @@ class QueueContent {
$sql .= "%queue%.workprinted='0') ";
if ($this->areBillExisting($pdo)) {
- // now remove closed items
$sql .= "AND (%queue%.billid is null OR (";
$sql .= "%queue%.billid=%bill%.id AND %bill%.closingid is null)) ";
}
@@ -599,7 +585,6 @@ class QueueContent {
$productid = $zeile['prodid'];
$useConditions = $this->getUseKitchenAndSupplyForProd($pdo,$productid);
if ($useConditions["usekitchen"] == 1) {
- // yes, display it in kitchen view as cooked
$arr = array("id" => $zeile['id'],
"tablename" => $zeile['tableno'],
"longname" => $zeile['longname'],
@@ -611,11 +596,6 @@ class QueueContent {
}
}
- // now look for items that are made and auto-delivered
- // They must appear if:
- // a) in category autosupply yes
- // b) they have the right kind
- // c) they shall appear in bar/kitchen module at all
$resultarray = $this->appendProdsForBarKitchenAndAutoDelivery($pdo,$kind, $resultarray);
echo json_encode($resultarray);
@@ -632,7 +612,6 @@ class QueueContent {
$sql .= "(%queue%.productid = %products%.id AND %products%.category = %prodtype%.id AND %prodtype%.kind=? AND %prodtype%.usesupplydesk='0' AND %prodtype%.usekitchen='1') AND ";
$sql .= "%queue%.workprinted='0') ";
- // now remove closed items
$sql .= "AND (%queue%.billid is null OR (";
$sql .= "%queue%.billid=%bill%.id AND %bill%.closingid is null)) ";
@@ -671,7 +650,6 @@ class QueueContent {
$pdo = $this->dbutils->openDbAndReturnPdo();
$pdo->beginTransaction();
- // is product already cooking or will it be set to cooking?
$sql = "SELECT cooking,productid FROM %queue% WHERE id=?";
$row = CommonUtils::getRowSqlObject($pdo, $sql, array($queueid));
if ($row != null) {
@@ -679,16 +657,13 @@ class QueueContent {
$productid = $row->productid;
if ($action == 'r') {
- // product shall be declared ready
if (is_null($cooking)) {
- // a product must be cooking before it can be ready!
$pdo->rollBack();
echo json_encode(array("status" => "ERROR", "code" => ERROR_DB_PAR_ACCESS, "msg" => ERROR_DB_PAR_ACCESS_MSG));
} else {
$this->reallyDeclareAsCooked($pdo,$queueid);
$useConditions = $this->getUseKitchenAndSupplyForProd($pdo,$productid);
if ($useConditions["usesupply"] == 0) {
- // can bypass the supplydesk
$this->declareProductBeDeliveredWithGivenPdo($pdo,$queueid);
} else {
self::setNewProductsToServe($pdo, 1);
@@ -707,9 +682,7 @@ class QueueContent {
echo json_encode(array("status" => "OK"));
}
} else if ($action == 'c') {
- // product shall be declared as cooking (in progress)
if (!is_null($cooking)) {
- // a product must not be cooking before it can becomes cooking
$pdo->rollBack();
echo json_encode(array("status" => "ERROR", "code" => ERROR_DB_PAR_ACCESS, "msg" => ERROR_DB_PAR_ACCESS_MSG));
} else {
@@ -745,7 +718,6 @@ class QueueContent {
$pdo = $this->dbutils->openDbAndReturnPdo();
$pdo->beginTransaction();
- // first: is the product still declared as delivered?
$sql = "SELECT id FROM %queue% WHERE id=? AND readytime IS NOT NULL";
$row = CommonUtils::getRowSqlObject($pdo, $sql, array($queueid));
if ($row != null) {
@@ -830,7 +802,6 @@ class QueueContent {
$workflowconfig = CommonUtils::getExistingConfigValue($pdo, 'workflowconfig');
$austria = CommonUtils::getExistingConfigValue($pdo, 'austria');
- // get current pricelevel
$currentPriceLevel = $this->commonUtils->getCurrentPriceLevel($pdo);
$currentPriceLevelId = $currentPriceLevel["id"];
@@ -844,7 +815,6 @@ class QueueContent {
$theChangedPrice = $aProd["changedPrice"];
$theChangedPrice = str_replace(',','.',$theChangedPrice);
- // now get the price for this pricelevel
$getPriceSql = "SELECT priceA,priceB,priceC,longname,tax,taxaustria,amount FROM %products% where id=?";
$row = CommonUtils::getRowSqlObject($pdo, $getPriceSql, array($productid));
if ($row == null) {
@@ -875,7 +845,6 @@ class QueueContent {
$price = $theChangedPrice;
}
- // now check if the product is a togo article that might have been booked on a table
$togo = $aProd["togo"];
$tax = $normaltax;
@@ -930,7 +899,6 @@ class QueueContent {
}
if (is_null($theTableid) || (is_numeric($theTableid) && is_numeric($productid))) {
- // first get category of product
$useConditions = $this->getUseKitchenAndSupplyForProdWithPdo($pdo,$productid);
$insertSql = "INSERT INTO `%queue%` (
@@ -958,13 +926,9 @@ class QueueContent {
$this->declareProductBeDeliveredWithGivenPdo($pdo,$queueid);
} else {
if ($useConditions["usekitchen"] == 0) {
- // no - can bypass the kitchen
$this->reallyDeclareAsCooked($pdo,$queueid);
- // then also look for supplydesk, since kitchen action won't do this!
if ($useConditions["usesupply"] == 0) {
- // can bypass the supplydesk
$this->declareProductBeDeliveredWithGivenPdo($pdo,$queueid);
- // THIS autop declares as "prepared" (cooked)!!!
}
} else {
$insertedQueueIds[] = $queueid;
@@ -1029,7 +993,6 @@ class QueueContent {
} else {
$sql .= " AND (readytime IS NULL or readytime is null) ";
}
- // and not in a closing:
if ($hasBills) {
$sql .= " AND (billid is null OR (";
$sql .= " billid = %bill%.id AND %bill%.closingid is null)) ";
@@ -1261,8 +1224,6 @@ class QueueContent {
echo json_encode(array("status" => "OK", "msg" => $prodsToPay));
}
- // This function gets the items to pay and creates a table, in which these items
- // are listed up. It can be used as a receipt to print later
function displayBill($billtableitems,$totalPrice) {
$currency = $this->commonUtils->getCurrency();
$numberOfItemsToPay = count($billtableitems);
@@ -1280,9 +1241,6 @@ class QueueContent {
echo "";
}
- // **********************************
- // * Bereitstellung *
- // **********************************
function declareProductBeDeliveredWithGivenPdo($pdo,$queueid) {
@@ -1294,7 +1252,6 @@ class QueueContent {
$stmt = $pdo->prepare($this->dbutils->resolveTablenamesInSqlString($updateSql));
$stmt->execute(array($delivertime,$queueid));
- // then it was probably already prepared
$updateSql = "UPDATE %queue% SET readytime=? WHERE id=?";
$stmt = $pdo->prepare($this->dbutils->resolveTablenamesInSqlString($updateSql));
$stmt->execute(array($delivertime,$queueid));
@@ -1351,14 +1308,12 @@ class QueueContent {
$sql .= "AND toremove <> '1') ";
if ($this->areBillExisting($pdo)) {
- // now remove closed items
$sql .= "AND (%queue%.billid is null OR (";
$sql .= "%queue%.billid=%bill%.id AND %bill%.closingid is null)) ";
}
$sql .= " ORDER BY tableno";
} else {
- // togo
$sql = "SELECT DISTINCT %queue%.id as id,'' as tableno,longname,anoption,readytime ";
if ($this->areBillExisting($pdo)) {
$sql .= "FROM %queue%,%products%,%resttables%,%bill% ";
@@ -1383,7 +1338,6 @@ class QueueContent {
$stmt->execute();
$dbresult = $stmt->fetchAll();
- // create a table that is optimal (sqrt-like size)
$numberOfIcons = count($dbresult);
$arrayOfProdsForTable = array();
$idsProdsOfTable = ''; // this is a hack! All queueids of a table redundant for "Deliver all"
@@ -1410,12 +1364,9 @@ class QueueContent {
return array("prods" => $arrayOfProdsForTable, "ids" => $idsProdsOfTable);
}
- // total number of products for table
- // can later be used for color indication if products can be delivered completly for a table
public function numberOfProductsForTableNotDelivered($pdo,$tableid) {
$sql = "SELECT DISTINCT %queue%.id as id ";
if (!is_null($tableid)) {
- // not togo
$sql .= "FROM %queue%,%resttables% ";
} else {
$sql .= "FROM %queue% ";
@@ -1426,7 +1377,6 @@ class QueueContent {
$sql .= "AND workprinted='0' ";
$sql .= "AND toremove <> '1' ";
if (!is_null($tableid)) {
- // not togo
$sql .= "AND %queue%.tablenr=%resttables%.id ";
$sql .= "AND %resttables%.id=" . $tableid;
} else {
@@ -1444,7 +1394,6 @@ class QueueContent {
function getJsonAllPreparedProducts() {
$pdo = DbUtils::openDbAndReturnPdoStatic();
- // find out the tables that are relevant
$sql = "SELECT DISTINCT tablenr ";
if ($this->areBillExisting($pdo)) {
$sql .= "FROM %queue%,%resttables%,%bill% ";
@@ -1459,7 +1408,6 @@ class QueueContent {
$sql .= "%queue%.workprinted='0') ";
if ($this->areBillExisting($pdo)) {
- // now remove closed items
$sql .= "AND (%queue%.billid is null OR (";
$sql .= "%queue%.billid=%bill%.id AND %bill%.closingid is null)) ";
}
@@ -1499,7 +1447,6 @@ class QueueContent {
$tablesToServe[] = $zeile['tablenr'];
}
- // to sort complete prepared tables use two arrays:
$preparedProds_incomplete_tables = array();
$preparedProds = array();
@@ -1545,7 +1492,6 @@ class QueueContent {
*/
function getJsonLastDeliveredProducts() {
$pdo = DbUtils::openDbAndReturnPdoStatic();
- // 1. no togo products
$sql = "SELECT DISTINCT %queue%.id as id,tableno,longname,delivertime,anoption,%products%.id as prodid ";
if ($this->areBillExisting($pdo)) {
$sql .= "FROM %queue%,%resttables%,%products%,%bill% ";
@@ -1561,7 +1507,6 @@ class QueueContent {
$sql .= "%queue%.workprinted='0') ";
if ($this->areBillExisting($pdo)) {
- // now remove closed items
$sql .= "AND (%queue%.billid is null OR (";
$sql .= "%queue%.billid=%bill%.id AND %bill%.closingid is null)) ";
}
@@ -1572,7 +1517,6 @@ class QueueContent {
$stmt->execute();
$result1 = $stmt->fetchAll();
- // 2.togo products
$sql = "SELECT DISTINCT %queue%.id as id,'' as tableno,longname,delivertime,anoption,%products%.id as prodid ";
if ($this->areBillExisting($pdo)) {
$sql .= "FROM %queue%,%resttables%,%products%,%bill% ";
@@ -1603,7 +1547,6 @@ class QueueContent {
$productid = $zeile['prodid'];
$useConditions = $this->getUseKitchenAndSupplyForProd($pdo,$productid);
if ($useConditions["usesupply"] == 1) {
- // yes, display it in supplydesk view as cooked
$extras = $this->getExtrasOfQueueItem(null,$zeile['id']);
@@ -1621,9 +1564,6 @@ class QueueContent {
}
- // **********************************
- // * Kasse *
- // **********************************
/*
* Test if all queue items with the given ids are not paid
@@ -1660,7 +1600,6 @@ class QueueContent {
$pdo->beginTransaction();
}
- // check if all items are not paid yet! Also get rid of empty entries
$allNotPaid = true;
for ($i=0;$icommonUtils->verifyLastBillId($pdo, $billid)) {
if (!$calledInternally) {
echo json_encode(array("status" => "ERROR", "code" => ERROR_INCONSISTENT_DB, "msg" => ERROR_INCONSISTENT_DB_MSG));
@@ -1720,7 +1657,6 @@ class QueueContent {
}
return;
} else {
- // ok - then increment that last id in the work table
$this->commonUtils->setLastBillIdInWorkTable($pdo, $billid);
}
@@ -1734,14 +1670,12 @@ class QueueContent {
$brutto = $row->brutto;
$netto = $row->netto;
- // now calculate the signature for the bill entry
$signature = $this->commonUtils->calcSignatureForBill($pdo,$currentTime, $brutto, $netto, '0.00', $userid);
$billInsertSql = "INSERT INTO `%bill%` (`id` , `billdate`,`brutto`,`netto`,`prevbrutto`,`prevnetto`,`tableid`,`paymentid`,`userid`,`ref`,`tax`,`host`,`reservationid`,`guestinfo`,`intguestid`,`signature`) VALUES (?,?,?,?,?,?,?,?,?,NULL,NULL,?,?,?,?,?)";
$stmt = $pdo->prepare($this->dbutils->resolveTablenamesInSqlString($billInsertSql));
$stmt->execute(array($billid,$currentTime,$brutto,$netto,$newprevbrutto,$newprevnetto,$tableid,$paymentId,$userid,$host,$reservationid,$guestinfo,$intguestid,$signature));
- // now declare them all to be paid:
for ($i=0;$i "ERROR", "code" => ERROR_NOT_AUTHOTRIZED, "msg" => ERROR_NOT_AUTHOTRIZED_MSG));
}
}
@@ -47,7 +46,6 @@ class Roomtables {
session_start();
}
if (!isset($_SESSION['angemeldet']) || !$_SESSION['angemeldet']) {
- // no user logged in
return false;
} else {
return ($_SESSION['is_admin']);
@@ -61,7 +59,6 @@ class Roomtables {
}
public static function getUnpaidTablesCore($pdo,$roomid) {
- // first get all tables of that rooms
$tablesSql = "SELECT id,tableno FROM %resttables% WHERE %resttables%.roomid =? AND removed is null";
$stmt = $pdo->prepare(DbUtils::substTableAlias($tablesSql));
@@ -126,7 +123,6 @@ class Roomtables {
}
function hasTableUnpaidItems($tableid) {
- // sql copied from getJsonProductsOfTableToPay
$sql = "SELECT %queue%.id as id,longname,%queue%.price as price,%pricelevel%.name as pricelevelname,%products%.id as prodid
FROM %queue%
INNER JOIN %products% ON %queue%.productid = %products%.id
@@ -176,7 +172,6 @@ class Roomtables {
return $row->pricesum;
}
- // Part of chain to choose a product , here we start with chosing a room
private function getAllTablesAndRooms($pdo)
{
$queue = new QueueContent();
@@ -190,7 +185,6 @@ class Roomtables {
foreach($dbresult as $zeile) {
$roomid = $zeile['id'];
- // now find the tables that are in that room
$tablesArray = array();
$sql = "SELECT %resttables%.id as id,%resttables%.tableno as name,IFNULL(SUM(IF(%queue%.ordertime is not null AND %queue%.paidtime is null AND %queue%.isclosed is null,%queue%.price,0.00)),0.00) as pricesum FROM %resttables% ";
@@ -253,17 +247,14 @@ class Roomtables {
$pdo = $this->dbutils->openDbAndReturnPdo();
$pdo->beginTransaction();
- // clear room table
$sql = "UPDATE %room% SET removed=?";
$stmt = $pdo->prepare($this->dbutils->resolveTablenamesInSqlString($sql));
$stmt->execute(array('1'));
- // clear resttables table
$sql = "UPDATE %resttables% SET removed=?";
$stmt = $pdo->prepare($this->dbutils->resolveTablenamesInSqlString($sql));
$stmt->execute(array('1'));
- // clear table positions and maps
$sql = "DELETE FROM %tablepos%";
$stmt = $pdo->prepare(DbUtils::substTableAlias($sql));
$stmt->execute();
@@ -322,7 +313,6 @@ class Roomtables {
$abbreviation = $row['abbreviation'];
$printer = $row['printer'];
- // now get the tables of this room
$sql = "SELECT id,tableno FROM %resttables% WHERE roomid=? AND removed is null ORDER BY 'sorting'";
$stmt = $pdo->prepare($this->dbutils->resolveTablenamesInSqlString($sql));
$stmt->execute(array($row['id']));
diff --git a/webapp/preferences.html b/webapp/preferences.html
index e8f0f93..69e0c63 100644
--- a/webapp/preferences.html
+++ b/webapp/preferences.html
@@ -5,7 +5,7 @@
-
+
@@ -85,7 +85,6 @@ function insertGeneralConfigItems(configResult) {
setLanguage(values.userlanguage);
} else {
setTimeout(function(){document.location.href = "index.html"},250); // not logged in
- //alert("Fehler beim Aufruf der Seite: " + configResult.msg);
}
}
@@ -309,7 +308,6 @@ function handleGeneralAnswer(json) {
}
function binding() {
- // Help buttons
$("#changepasswordbutton").off("click").on("click", function (e) {
e.stopImmediatePropagation();
e.preventDefault();
@@ -406,14 +404,14 @@ $(document).on("pageinit", "#pref-page", function () {
diff --git a/webapp/reservation.html b/webapp/reservation.html
index ac41387..6ffc9e3 100644
--- a/webapp/reservation.html
+++ b/webapp/reservation.html
@@ -5,7 +5,7 @@
-
+
@@ -88,7 +88,6 @@ var reservationnote = "";
var companyinfo = "";
var emailIsPossible = false;
var emailTemplate = "";
-// REM* ther list of customers that are filtered by the server when the user types in the name in the search field
var filteredCustomers = [];
function setLanguage(language) {
@@ -176,7 +175,6 @@ function insertGenConfigStartRest(configResult) {
} else {
setTimeout(function(){document.location.href = "index.html"},250); // not logged in
$("#fullcontent").hide();
- //alert("Fehler beim Aufruf der Seite: " + configResult.msg);
}
}
@@ -226,7 +224,6 @@ function bindNewReservationBtn() {
remark: remark
};
- // prepare next page for email
var emailtext = emailTemplate;
emailtext = emailtext.replace(/DATUM/g,date.getDate() + "." + (date.getMonth() + 1) + "." + date.getFullYear());
emailtext = emailtext.replace(/ANZAHL/g,persons);
@@ -320,12 +317,10 @@ function insertReservations(answer) {
var hour = 0;
var residx = 0;
for (hour=0;hour<24;hour++) {
- // collect reservations for hour
var resofhour = [];
times[hour] = resofhour;
}
- // now every hour has its (empty) array...
var maxCol = 0;
var hasTotalRes = false;
@@ -348,7 +343,6 @@ function insertReservations(answer) {
}
}
- // now times table is filled. Create html
if (!hasTotalRes) {
html += "
" + RES_NORES[lang] + "
";
@@ -387,7 +381,6 @@ function insertReservations(answer) {
function fitsInCol(times,maxCol,start,end) {
var col = 0;
for (col=0;col<=(maxCol+1);col++) {
- // does it fit in this col?
var h = 0;
var fits = true;
for (h=start;h<=end;h++) {
@@ -400,7 +393,6 @@ function fitsInCol(times,maxCol,start,end) {
return col;
}
}
- // should never be come to this point
return maxCol+1;
}
@@ -464,17 +456,14 @@ function bindCusElem() {
e.stopImmediatePropagation();
e.preventDefault();
- // REM* find customer in filteredCustomers
var cusid = this.id.split("_")[1];
for (var i=0;i copy customer values into the fields
$("#guestname").val(aCus.name);
$("#email").val(aCus.email);
$("#telno").val(aCus.phone);
- // REM* now clean the search stuff
$("#customer").val("");
$("#customerlist").html('');
}
@@ -603,7 +592,6 @@ $(document).on("pageinit", "#res-page", function () {
$(document).on("pagebeforeshow", "#changeres-page", function () {
if (lang < 0) {
- // user has refreshed change page - that does not work!
setTimeout(function(){document.location.href = "reservation.html?"},500);
} else {
$("#ctimefieldse").selectmenu('refresh', true);
@@ -617,13 +605,13 @@ $(document).on("pagebeforeshow", "#changeres-page", function () {
diff --git a/webapp/utilities.js b/webapp/utilities.js
index 1bb60ea..bc68b91 100644
--- a/webapp/utilities.js
+++ b/webapp/utilities.js
@@ -8,8 +8,8 @@ function initializeMainMenu(menuid) {
$("#versioninfo").html(moduleEntries.version + " ");
if (moduleEntries.loggedin == 1) {
$("#loggedinuser").html(" " + moduleEntries.user);
- var li='
Module
';
- $.each(moduleEntries.menu, function (i, module) {
+ var li='
Hauptmenü
';
+ $.each(moduleEntries.menu, function (i, module) {
var name = module.name;
var link = module.link;
if ((name != "Abmelden") && (name != "Log out") && (name != "Adios")) {
diff --git a/webapp/waiter.html b/webapp/waiter.html
index 1fa5624..6bede63 100644
--- a/webapp/waiter.html
+++ b/webapp/waiter.html
@@ -4,7 +4,7 @@
-
+
@@ -32,19 +32,19 @@
+var W_TABLES=["Tische","Tables","Mesas"];var W_ATABLE=["Tisch","Table","Mesa"];var W_ROOMS=["Räume","Rooms","Espacios"];var W_SELECTION=["Auswahl","Selection","Selección"];var W_LAST_SELECTED=["zuletzt","last","seleccionado"];var W_FAVS=["Favoriten","Favorites","Favoritos"];var W_NEW_ORDER=["Neue Order","New Orders","Ordenes nuevas"];var W_KIT_BAR=["nicht serviert/unbezahlt","unserved/unpaid","no servido/impagado"];var W_OTHER_PROD=["Auswahl Produktkategorie","Select product categroy","Categoría diferente"];var W_WORK_TICKET=["Arbeitsbon","Work ticket","Tique de trabajar"];var W_NOTE=["Bemerkung","Comment","Comentario"];var W_SEND_ORDERS=["Bestellung senden","Send orders","Enviar Ordenes"];var W_TO_PAYDESK=["-> Kasse","-> Paydesk","-> Caja"];var W_TABLECHANGE=["Tischwechsel","Change table","Cambiar mesa"];var W_ROOMTABLE=["Raum-Tisch","Room-Table","Espacio-Mesa"];var W_TABLE_SEL=["Tischauswahl","Select table","Qué mesa?"];var W_UNDELIV_INFO=["Liste enthält die Produkte die noch in der Küchen-/Baransicht sind, sowie unbezahlte Produkte, die die Bereitstellungsansicht nicht durchlaufen.","List contains the products which are still in kitchen or bar view, as well as unpaid products that do not pass the supplydesk view.","La lista contiene los productos que estan todavía en modulo de cocina/bar, también productos impagados que no pasan vista de productos preparados."];var W_REMOVE_ERROR=["Ansicht nicht mehr aktuell - Liste wird neu geladen.","View is obsolete - List will be reloaded.","Vista no esta actual - vamos a actualisar la lista."];var W_FOOD_FOR=["Speisen für","Food for","Comidas para"];var W_DRINKS_FOR=["Getränke für","Beverage for","Bebidas para"];var W_ACT_NEW_ORD_EL=["Aktion auswählen","Select action","Que acción?"];var W_ACT_CHANGE=["Ändern","Modify","Modificar"];var W_ACT_CHANGE_ALL=["Alle Ändern","Modify all","Modificar todo"];var W_ACT_CHANGE_ONE=["Einen Artikel ändern","Modify one item","Modificar un artículo"];var W_APPLY=["Anwenden","Apply","Aplicar"];var W_CANCEL=["Abbrechen","Cancel","Cancelar"];var W_STILL_UNSENT_ORDERS=["Es sind noch ungesendete Orders vorhanden!","There are unsent orders in the list","Hay elementos in la liste que no han enviados"];var W_EXTRAS=["Extras/Optionen","Add-ons/Options","Opciones"];var W_OPEN_PANEL=["Extras-Auswahl noch offen","Add-ons selection still open","Selección de opciones todavía abierta"];var W_DEL=["Löschen","Delete","Removar"];var W_MSG=["Nachricht","Message","Mensaje"];var W_CHANGE_PRICE=["Neuer Preis: ","New price: ","Cambiar precio: "];var W_PRICE=["Preis","Price","Precio"];var W_WRONG_FORMAT=["Falsches Zahlenformat","Wrong number format","Formato de precio incorecto"];var W_TOGO=["Außer-Haus-Verkauf","Sale with Tax No 2","Venta IVA 2"];var W_YES=["Ja","Yes","Si"];var W_NO=["Nein","No","No"];var W_DISCARD_NO_ASK=["Es sind noch ungesendete Orders vorhanden! Sollen diese verworfen werden?","There are still unsent orders. Do you want to discard them?","Hay todavía ordenes non-enviados. Removarlos?"];var W_DISCARD_HEADER=["Neue Orders verwerfen?","Discard new orders?","Removar ordenes nuevos?"];var W_SEARCH=["Produktsuche","Product search","Buscar producto"];var W_SEARCHRESULTS=["Suchergebnis","Search Result","Encontrado"];var W_WRONG_PIN=["Falscher Stornocode","Wrong cancel code","Codigo falso"];var W_NO_ORDERS=["Keine gebuchten Orders vorhanden!","No orders available!","No hay ningún orden!"];var W_TO_PAY=["offen","to pay","a pagar"];var W_MOVE_PRODS=["Produkte verschieben","Move products","Productos a otra mesa"];var W_NO_PRODS_SELECTED=["Es wurden keine Produkte ausgewählt!","You have not chosen any products!","No ha seleccionado ningún producto!"];var W_MAX_PRICE_EXCEEDED=["Der Maximalwert für den Preis wurde überschritten!","The max. value for the price is exceeded!","El valor del precio es más que el maximum!"];var W_REORDER=["Nachbestellen","Reorder","Order una vez mas"];var W_REMOVE=["Entfernen","Remove","Removar"];var W_SELALL=["Alles auswählen","Select all","Elegir todo"];var W_UNSELALL=["Alles abwählen","Unselect all","No elegir nada"];var W_ONLY=["noch","only","sólo"];var W_DEL_ALL_UNDELIVERED=["Entferne alles","Remove all","Borrar todo"];var W_DEL_ALL_ASSIGNED_PRODS=["Alle Produkte löschen?","Delete all products?","Removar todos los productos?"];var CHANGE_ALL=0;var CHANGE_ONE=1;var WORKFLOW_DIGI_WORK=0;var WORKFLOW_DIGI=1;var WORKFLOW_WORK=2;var WORKFLOW_WORK_SEND=3;function Grouping(b,a){this.set=b;this.sortedset=[];this.group=function(){this.sortedset=[];for(var g=0;g/g,">"))}function setLanguage(h){lang=h;$("#roomtableheader2").html(W_ROOMTABLE[lang]);$("#tableselection").html(W_TABLE_SEL[lang]);$("#actiontxt").html(W_ACT_NEW_ORD_EL[lang]);$("#actdeltxt").html(W_DEL[lang]);$("#discard_new_orders_yes").html(W_YES[lang]);$("#discard_new_orders_no").html(W_NO[lang]);$("#discardnewordersask").html(W_DISCARD_NO_ASK[lang]);$("#discardnoheader").html(W_DISCARD_HEADER[lang]);$("#moveprods").html(W_MOVE_PRODS[lang]);var f="";if(prominentsearch==0){f+='