OrderSprinter 1.1.12
This commit is contained in:
parent
8f6f59e47a
commit
6f9dcaf7ea
Binary file not shown.
|
@ -0,0 +1,32 @@
|
||||||
|
Hinweise zum Inhalt dieses Verzeichnisses:
|
||||||
|
|
||||||
|
Mit dem Backup-Skript "backup-db-linux.sh" ist es möglich, auf einem Linux-System
|
||||||
|
|
||||||
|
- ein Backup der Datenbank
|
||||||
|
- das Kassenbuch (PDF-Zusammenfassung) vom Zeitraum des aktuellen Jahres
|
||||||
|
|
||||||
|
auf einem USB-Stick anzulegen. Der USB-Stick wird vor dem Backup eingehängt,
|
||||||
|
und nachher wieder ausgehängt, so dass er anschließend vom Gerät abgezogen werden kann.
|
||||||
|
|
||||||
|
Das Skript kann beispielsweise auf einem Raspberry Pi oder anderen Linux-System eingesetzt
|
||||||
|
werden.
|
||||||
|
|
||||||
|
Das Ein- und Aushängen erfordert eigentlich Root-Berechtigungen. Entweder lässt man das Skript
|
||||||
|
als Root laufen, oder nutzt Möglichkeiten des setuid (wird hier nicht beschrieben).
|
||||||
|
|
||||||
|
Es werden immer die letzten maximal drei Backups gespeichert bzw. aufbewahrt.
|
||||||
|
|
||||||
|
Im Skript müssen am Anfang einige Variablen angepasst werden:
|
||||||
|
- der Gerätenamen des Sticks
|
||||||
|
- die Zugangsparameter der Datenbank (lassen sich aus der config.php) entnehmen, wenn nicht mehr bekannt.
|
||||||
|
- die Server-Baseadresse
|
||||||
|
- der Remoteaccess-Code, wie er zuvor in der Verwaltungsansicht eingestellt werden muss
|
||||||
|
|
||||||
|
Es wird empfohlen, die Ausführung des Skripts über einen cron-Job regelmäßig und automatisisiert
|
||||||
|
zu starten:
|
||||||
|
|
||||||
|
Um z.B. jeden Morgen um 4 Uhr eine Datensicherung zu starten, legt man den Cronjob wie folgt an:
|
||||||
|
|
||||||
|
In der Datei /etc/crontab ans Ende folgenden Eintrag und anschließend eine Zeile freilassen:
|
||||||
|
|
||||||
|
0 4 * * * root /usr/local/bin/backup-db-linux.sh > /dev/null 2>&1
|
|
@ -0,0 +1,61 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# Die folgenden Werte müssen je nach Installation angepasst werden:
|
||||||
|
|
||||||
|
mount="/dev/sdc1"
|
||||||
|
database="ordersprinter"
|
||||||
|
user="Benutzer"
|
||||||
|
password="DasPasswort"
|
||||||
|
serverbase="http://localhost/ordersprinter"
|
||||||
|
remoteaccesscode="123"
|
||||||
|
|
||||||
|
if grep -qs "$mount" /proc/mounts; then
|
||||||
|
echo "Der USB-Stick ist bereits eingehaengt"
|
||||||
|
else
|
||||||
|
echo "Der USB-Stick ist noch nicht eingehaengt."
|
||||||
|
mount "$mount" /mnt
|
||||||
|
if [ $? -eq 0 ]; then
|
||||||
|
echo "Der USB-Stick konnte eingehaengt werden."
|
||||||
|
|
||||||
|
# Halte die letzten 3 Sicherungen der DB vor:
|
||||||
|
if [ -f /mnt/db-dump-1.json ]
|
||||||
|
then mv /mnt/db-dump-1.json /mnt/db-dump-2.json
|
||||||
|
fi
|
||||||
|
if [ -f /mnt/db-dump.json ]
|
||||||
|
then mv /mnt/db-dump.json /mnt/db-dump-1.json
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Halte die letzten 3 Sicherungen des Kassenbuchs vor
|
||||||
|
if [ -f /mnt/kassenbuch-1.pdf ]
|
||||||
|
then mv /mnt/kassenbuch-1.pdf /mnt/kassenbuch-2.pdf
|
||||||
|
fi
|
||||||
|
if [ -f /mnt/kassenbuch.pdf ]
|
||||||
|
then mv /mnt/kassenbuch.pdf /mnt/kassenbuch-1.pdf
|
||||||
|
fi
|
||||||
|
|
||||||
|
#
|
||||||
|
# Sicherung der Datenbank über die OrderSprinter Backup-Funktion
|
||||||
|
# (das ist die bevorzugte Variante, weil die Ausgabe-Datei wieder über die Wiederherstellungsfunktion
|
||||||
|
# vom OrderSprinter eingelesen werden kann).
|
||||||
|
#
|
||||||
|
#
|
||||||
|
wget --post-data "remoteaccesscode=$remoteaccesscode" -O /mnt/db-dump.json 2>>/dev/null "$serverbase/php/contenthandler.php?module=admin&command=autobackup"
|
||||||
|
#
|
||||||
|
#
|
||||||
|
# Sicherung der Datenbank direkt über mysqldump:
|
||||||
|
# (wird diese Variante genutzt, ist das Umkopieren anzupassen, wenn mehrere Datensicherungen aufbewahrt
|
||||||
|
# werden sollen.)
|
||||||
|
#
|
||||||
|
#mysqldump --user=$user --password=$password --databases $database > /mnt/db-dump.sql
|
||||||
|
|
||||||
|
#
|
||||||
|
# Sicherung des Kassenbuchs als PDF
|
||||||
|
wget --post-data "remoteaccesscode=$remoteaccesscode" -O /mnt/kassenbuch.pdf 2>>/dev/null "$serverbase/php/contenthandler.php?module=bill&command=autoBackupPdfSummary&lang=0"
|
||||||
|
#
|
||||||
|
|
||||||
|
umount /mnt
|
||||||
|
echo "Das Datenbank-Backup ist erfolgt, der USB-Stick wurde wieder ausgehaengt."
|
||||||
|
else
|
||||||
|
echo "Der USB-Stick konnte nicht eingehaengt werden, das Backup ist nicht erfolgt!"
|
||||||
|
fi
|
||||||
|
fi
|
Binary file not shown.
|
@ -5,7 +5,7 @@
|
||||||
<meta http-equiv="content-type" content="text/html; charset=utf-8">
|
<meta http-equiv="content-type" content="text/html; charset=utf-8">
|
||||||
<meta name="author" content="Stefan Pichel">
|
<meta name="author" content="Stefan Pichel">
|
||||||
|
|
||||||
<link rel="stylesheet" type="text/css" href="css/bestformat.css?v=1.1.11">
|
<link rel="stylesheet" type="text/css" href="css/bestformat.css?v=1.1.12">
|
||||||
|
|
||||||
<link rel="stylesheet" href="php/3rdparty/orderstyle/orderstyle.min.css" />
|
<link rel="stylesheet" href="php/3rdparty/orderstyle/orderstyle.min.css" />
|
||||||
<link rel="stylesheet" href="php/3rdparty/orderstyle/jquery.mobile.icons.min.css" />
|
<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 http-equiv="content-type" content="text/html; charset=utf-8">
|
||||||
<meta name="author" content="Stefan Pichel">
|
<meta name="author" content="Stefan Pichel">
|
||||||
|
|
||||||
<link rel="stylesheet" type="text/css" href="css/bestformat.css?v=1.1.11">
|
<link rel="stylesheet" type="text/css" href="css/bestformat.css?v=1.1.12">
|
||||||
|
|
||||||
<link rel="stylesheet" href="php/3rdparty/orderstyle/orderstyle.min.css" />
|
<link rel="stylesheet" href="php/3rdparty/orderstyle/orderstyle.min.css" />
|
||||||
<link rel="stylesheet" href="php/3rdparty/orderstyle/jquery.mobile.icons.min.css" />
|
<link rel="stylesheet" href="php/3rdparty/orderstyle/jquery.mobile.icons.min.css" />
|
||||||
|
|
|
@ -0,0 +1,97 @@
|
||||||
|
function Grouping(set,hashFct) {
|
||||||
|
// initialization during construction of class
|
||||||
|
this.set = set;
|
||||||
|
|
||||||
|
// setting by group()
|
||||||
|
this.sortedset = [];
|
||||||
|
|
||||||
|
this.group = function() {
|
||||||
|
this.sortedset = [];
|
||||||
|
for (var i=0;i<this.set.length;i++) {
|
||||||
|
var anEntry = this.set[i];
|
||||||
|
|
||||||
|
if (this.sortedset.length == 0) {
|
||||||
|
// new value
|
||||||
|
anEntry["count"] = 1;
|
||||||
|
anEntry["ids"] = [ anEntry["id"]];
|
||||||
|
this.sortedset[this.sortedset.length] = anEntry;
|
||||||
|
} else {
|
||||||
|
// check if the entry must be added to an existing entry
|
||||||
|
var hashOfValueToInsert = hashFct(anEntry);
|
||||||
|
var found = false;
|
||||||
|
for (j=0;j<this.sortedset.length;j++) {
|
||||||
|
var existingVal = this.sortedset[j];
|
||||||
|
var hashOfExistingValue = hashFct(existingVal);
|
||||||
|
|
||||||
|
if (hashOfValueToInsert == hashOfExistingValue) {
|
||||||
|
existingVal["count"] = existingVal["count"] + 1;
|
||||||
|
// now add the id
|
||||||
|
var ids = existingVal["ids"];
|
||||||
|
ids[ids.length] = anEntry["id"];
|
||||||
|
found = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!found) {
|
||||||
|
// new value
|
||||||
|
anEntry["count"] = 1;
|
||||||
|
anEntry["ids"] = [ anEntry["id"]];
|
||||||
|
this.sortedset[this.sortedset.length] = anEntry;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
this.outputList = function(outputFct) {
|
||||||
|
var txt = "";
|
||||||
|
for (var i=0;i<this.sortedset.length;i++) {
|
||||||
|
var anEntry = this.sortedset[i];
|
||||||
|
txt += outputFct(anEntry);
|
||||||
|
}
|
||||||
|
return txt;
|
||||||
|
}
|
||||||
|
|
||||||
|
this.getItemsOfRow = function(rowId) {
|
||||||
|
var anEntrySet = this.sortedset[rowId];
|
||||||
|
var ids = anEntrySet["ids"];
|
||||||
|
var items = [];
|
||||||
|
for (var j=0;j<ids.length;j++) {
|
||||||
|
var anId = ids[j];
|
||||||
|
for (var i=0;i<this.set.length;i++) {
|
||||||
|
var anEntry = this.set[i];
|
||||||
|
if (anEntry.id==anId) {
|
||||||
|
items[items.length] = anEntry;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return items;
|
||||||
|
}
|
||||||
|
|
||||||
|
this.popSortedEntry = function(rowId) {
|
||||||
|
var anEntry = this.sortedset[rowId];
|
||||||
|
var ids = anEntry["ids"];
|
||||||
|
var id = ids.pop();
|
||||||
|
var aSetEntry = this.popSetEntry(id);
|
||||||
|
this.group();
|
||||||
|
return aSetEntry;
|
||||||
|
}
|
||||||
|
|
||||||
|
this.popSetEntry = function(id) {
|
||||||
|
for (var i=0;i<this.set.length;i++) {
|
||||||
|
var anEntry = this.set[i];
|
||||||
|
if (anEntry.id==id) {
|
||||||
|
this.set.splice(i,1);
|
||||||
|
return anEntry;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
this.getSourceSet = function() {
|
||||||
|
return this.set;
|
||||||
|
}
|
||||||
|
|
||||||
|
this.getGroupedList = function() {
|
||||||
|
return this.sortedset;
|
||||||
|
}
|
||||||
|
}
|
|
@ -4,7 +4,7 @@
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||||
<meta http-equiv="content-type" content="text/html; charset=utf-8">
|
<meta http-equiv="content-type" content="text/html; charset=utf-8">
|
||||||
|
|
||||||
<link rel="stylesheet" type="text/css" href="css/bestformat.css?v=1.1.11">
|
<link rel="stylesheet" type="text/css" href="css/bestformat.css?v=1.1.12">
|
||||||
|
|
||||||
<link rel="stylesheet" href="php/3rdparty/orderstyle/orderstyle.min.css" />
|
<link rel="stylesheet" href="php/3rdparty/orderstyle/orderstyle.min.css" />
|
||||||
<link rel="stylesheet" href="php/3rdparty/orderstyle/jquery.mobile.icons.min.css" />
|
<link rel="stylesheet" href="php/3rdparty/orderstyle/jquery.mobile.icons.min.css" />
|
||||||
|
|
|
@ -7,8 +7,8 @@
|
||||||
<meta http-equiv="content-type" content="text/html; charset=utf-8">
|
<meta http-equiv="content-type" content="text/html; charset=utf-8">
|
||||||
<meta name="author" content="Stefan Pichel">
|
<meta name="author" content="Stefan Pichel">
|
||||||
|
|
||||||
<link rel="stylesheet" type="text/css" href="css/bestformat.css?v=1.1.11">
|
<link rel="stylesheet" type="text/css" href="css/bestformat.css?v=1.1.12">
|
||||||
<link rel="stylesheet" type="text/css" href="css/numfield.css?v=1.1.11">
|
<link rel="stylesheet" type="text/css" href="css/numfield.css?v=1.1.12">
|
||||||
|
|
||||||
<link rel="stylesheet" href="php/3rdparty/orderstyle/orderstyle.min.css" />
|
<link rel="stylesheet" href="php/3rdparty/orderstyle/orderstyle.min.css" />
|
||||||
<link rel="stylesheet" href="php/3rdparty/orderstyle/jquery.mobile.icons.min.css" />
|
<link rel="stylesheet" href="php/3rdparty/orderstyle/jquery.mobile.icons.min.css" />
|
||||||
|
|
|
@ -679,7 +679,7 @@ $(document).ready(function() {
|
||||||
<tr id=updateline>
|
<tr id=updateline>
|
||||||
<td> </td>
|
<td> </td>
|
||||||
<td align=center>
|
<td align=center>
|
||||||
<button id="updatebtn">Update -> 1.1.11</button>
|
<button id="updatebtn">Update -> 1.1.12</button>
|
||||||
</td>
|
</td>
|
||||||
<td> </td>
|
<td> </td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
|
@ -778,6 +778,30 @@ $ret &= $this->setVersion($prefix, '1.1.11');
|
||||||
return $ret;
|
return $ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function updateUserTable1111_1112($prefix,$version) {
|
||||||
|
$pdo = $this->pdo;
|
||||||
|
try {
|
||||||
|
if ($version != "1.1.11") {
|
||||||
|
$ret = $this->updateUserTable1110_1111($prefix,$version);
|
||||||
|
if (!$ret) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$adminCl = new Admin();
|
||||||
|
DbUtils::overrulePrefix($prefix);
|
||||||
|
|
||||||
|
$sql = "ALTER TABLE %room% ADD `abbreviation` VARCHAR (10) NULL AFTER roomname";
|
||||||
|
$stmt = $pdo->prepare(DbUtils::substTableAlias($sql));
|
||||||
|
$stmt->execute();
|
||||||
|
|
||||||
|
$this->updateVersion($pdo, '1.1.12');
|
||||||
|
return true;
|
||||||
|
} catch (PDOException $e) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
function setVersion($prefix,$theVersion) {
|
function setVersion($prefix,$theVersion) {
|
||||||
$pdo = $this->pdo;
|
$pdo = $this->pdo;
|
||||||
try {
|
try {
|
||||||
|
@ -849,7 +873,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 , '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 , '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 , 'receiptfontsize', '12')");
|
||||||
$this->basedb->doSQL($pdo,"INSERT INTO `%config%` (`id` , `name`, `setting`) VALUES (NULL , 'version', '1.1.11')");
|
$this->basedb->doSQL($pdo,"INSERT INTO `%config%` (`id` , `name`, `setting`) VALUES (NULL , 'version', '1.1.12')");
|
||||||
$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 , '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 , 'remoteaccesscode', null)");
|
||||||
$this->basedb->doSQL($pdo,"INSERT INTO `%config%` (`id` , `name`, `setting`) VALUES (NULL , 'decpoint', '$decpoint')");
|
$this->basedb->doSQL($pdo,"INSERT INTO `%config%` (`id` , `name`, `setting`) VALUES (NULL , 'decpoint', '$decpoint')");
|
||||||
|
@ -1221,8 +1245,8 @@ return;
|
||||||
|
|
||||||
$supportedVersions = array("1.0.22","1.0.23","1.0.24","1.0.25","1.0.26","1.0.27","1.0.28","1.0.29",
|
$supportedVersions = array("1.0.22","1.0.23","1.0.24","1.0.25","1.0.26","1.0.27","1.0.28","1.0.29",
|
||||||
"1.0.30","1.0.31","1.0.32","1.0.33","1.0.34","1.0.35","1.0.36","1.0.37","1.0.38","1.0.39",
|
"1.0.30","1.0.31","1.0.32","1.0.33","1.0.34","1.0.35","1.0.36","1.0.37","1.0.38","1.0.39",
|
||||||
"1.0.40",
|
"1.0.40","1.0.41","1.0.42","1.0.43",
|
||||||
"1.1.0","1.1.1","1.1.2","1.1.3","1.1.4","1.1.5","1.1.6","1.1.7","1.1.8", "1.1.9","1.1.10"
|
"1.1.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"
|
||||||
);
|
);
|
||||||
|
|
||||||
if (!in_array($version, $supportedVersions)) {
|
if (!in_array($version, $supportedVersions)) {
|
||||||
|
@ -1230,7 +1254,7 @@ echo json_encode("Quellversion nicht unterstützt");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
$ret = $admin->updateUserTable1110_1111($_POST['prefix'], $version);
|
$ret = $admin->updateUserTable1111_1112($_POST['prefix'], $version);
|
||||||
|
|
||||||
if(session_id() == '') {
|
if(session_id() == '') {
|
||||||
session_start();
|
session_start();
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
<meta http-equiv="content-type" content="text/html; charset=utf-8">
|
<meta http-equiv="content-type" content="text/html; charset=utf-8">
|
||||||
<meta name="author" content="Stefan Pichel">
|
<meta name="author" content="Stefan Pichel">
|
||||||
|
|
||||||
<link rel="stylesheet" type="text/css" href="css/bestformat.css?v=1.1.11">
|
<link rel="stylesheet" type="text/css" href="css/bestformat.css?v=1.1.12">
|
||||||
|
|
||||||
<link rel="stylesheet" href="php/3rdparty/orderstyle/orderstyle.min.css" />
|
<link rel="stylesheet" href="php/3rdparty/orderstyle/orderstyle.min.css" />
|
||||||
<link rel="stylesheet" href="php/3rdparty/orderstyle/jquery.mobile.icons.min.css" />
|
<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 http-equiv="content-type" content="text/html; charset=utf-8">
|
||||||
<meta name="author" content="Stefan Pichel">
|
<meta name="author" content="Stefan Pichel">
|
||||||
|
|
||||||
<link rel="stylesheet" type="text/css" href="css/bestformat.css?v=1.1.11">
|
<link rel="stylesheet" type="text/css" href="css/bestformat.css?v=1.1.12">
|
||||||
|
|
||||||
<link rel="stylesheet" href="php/3rdparty/orderstyle/orderstyle.min.css" />
|
<link rel="stylesheet" href="php/3rdparty/orderstyle/orderstyle.min.css" />
|
||||||
<link rel="stylesheet" href="php/3rdparty/orderstyle/jquery.mobile.icons.min.css" />
|
<link rel="stylesheet" href="php/3rdparty/orderstyle/jquery.mobile.icons.min.css" />
|
||||||
|
@ -229,6 +229,7 @@ var MAN_ROOM_PRINTER_NO = ["Kategorieeinstellung","Category setting","Configurac
|
||||||
var MAN_ROOM_PRINTER_1 = ["Drucker 1","Printer 1","Imprimadora 1"];
|
var MAN_ROOM_PRINTER_1 = ["Drucker 1","Printer 1","Imprimadora 1"];
|
||||||
var MAN_ROOM_PRINTER_2 = ["Drucker 2","Printer 2","Imprimadora 2"];
|
var MAN_ROOM_PRINTER_2 = ["Drucker 2","Printer 2","Imprimadora 2"];
|
||||||
var MAN_ROOM_PRINTER_TXT = ["Arbeitsdrucker","Work printer","Imprimadora de trabajo"];
|
var MAN_ROOM_PRINTER_TXT = ["Arbeitsdrucker","Work printer","Imprimadora de trabajo"];
|
||||||
|
var MAN_ROOM_ABBR_TXT = ["Kürzel","Abbr.","Abbr."];
|
||||||
|
|
||||||
var MAN_USERNAME = ["Benutzer","User","Usario"];
|
var MAN_USERNAME = ["Benutzer","User","Usario"];
|
||||||
var MAN_BILLSUMALL = ["Gesamtbrutto","Total (brutto)","Todo (brutto)"];
|
var MAN_BILLSUMALL = ["Gesamtbrutto","Total (brutto)","Todo (brutto)"];
|
||||||
|
@ -889,17 +890,9 @@ function binding() {
|
||||||
} else if (theId == "createdbexportxlsx") {
|
} else if (theId == "createdbexportxlsx") {
|
||||||
window.location.href = "php/contenthandler.php?module=bill&command=exportXlsx&" + dateparams;
|
window.location.href = "php/contenthandler.php?module=bill&command=exportXlsx&" + dateparams;
|
||||||
} else if (theId == "createpdfexport") {
|
} else if (theId == "createpdfexport") {
|
||||||
if (numberOfClosings == 0) {
|
window.location.href = "php/contenthandler.php?module=bill&command=exportPdfReport&" + dateparams;
|
||||||
alert(MAN_NO_CLOSINGS[lang]);
|
|
||||||
} else {
|
|
||||||
window.location.href = "php/contenthandler.php?module=bill&command=exportPdfReport&" + dateparams;
|
|
||||||
}
|
|
||||||
} else if (theId == "createpdfsummary") {
|
} else if (theId == "createpdfsummary") {
|
||||||
if (numberOfClosings == 0) {
|
window.location.href = "php/contenthandler.php?module=bill&command=exportPdfSummary&" + dateparams;
|
||||||
alert(MAN_NO_CLOSINGS[lang]);
|
|
||||||
} else {
|
|
||||||
window.location.href = "php/contenthandler.php?module=bill&command=exportPdfSummary&" + dateparams;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -1682,9 +1675,10 @@ function createRoomPrinterSelection(roomid,selectedPrinter) {
|
||||||
function createEmptyRoomField(n,m) {
|
function createEmptyRoomField(n,m) {
|
||||||
var i=0;
|
var i=0;
|
||||||
var text = "<table>";
|
var text = "<table>";
|
||||||
text += '<tr><th>' + MAN_ROOM_LABEL[lang] + '<th>' + MAN_ROOM_PRINTER_TXT[lang] + '<th colspan=' + m + '>' + MAN_TABLE_LABEL[lang] + '</tr>';
|
text += '<tr><th>' + MAN_ROOM_LABEL[lang] + '<th>' + MAN_ROOM_ABBR_TXT[lang] + '<th>' + MAN_ROOM_PRINTER_TXT[lang] + '<th colspan=' + m + '>' + MAN_TABLE_LABEL[lang] + '</tr>';
|
||||||
for (i=0;i<n;i++) {
|
for (i=0;i<n;i++) {
|
||||||
text += '<tr><td><input style="background:white;" type="text" id="r_' + i.toString() + '"' + ' size="10" />';
|
text += '<tr><td><input style="background:white;" type="text" id="r_' + i.toString() + '"' + ' size="10" />';
|
||||||
|
text += '<td><input style="background:white;" type="text" id="rabbr_' + i.toString() + '"' + ' size="10" />';
|
||||||
text += '<td id=roomprintercol_' + i + '>' + createRoomPrinterSelection(i,0);
|
text += '<td id=roomprintercol_' + i + '>' + createRoomPrinterSelection(i,0);
|
||||||
text += tablelist(m,i);
|
text += tablelist(m,i);
|
||||||
}
|
}
|
||||||
|
@ -1710,6 +1704,8 @@ function initroomfield(roomfield_json) {
|
||||||
r_id = "#r_" + room_index.toString();
|
r_id = "#r_" + room_index.toString();
|
||||||
$(r_id).val(aRoom.roomname);
|
$(r_id).val(aRoom.roomname);
|
||||||
|
|
||||||
|
$("#rabbr_" + room_index).val(aRoom.abbreviation);
|
||||||
|
|
||||||
var noOfTables = aRoom.noOfTables;
|
var noOfTables = aRoom.noOfTables;
|
||||||
|
|
||||||
var roomPrinter = aRoom.printer;
|
var roomPrinter = aRoom.printer;
|
||||||
|
@ -1744,6 +1740,7 @@ function roomfield_prefill() {
|
||||||
var endNumber = startNumber + parseInt(m) - 1;
|
var endNumber = startNumber + parseInt(m) - 1;
|
||||||
|
|
||||||
$(id).val(MAN_TABLE_LABEL[lang] + " " + startNumber + "-" + endNumber);
|
$(id).val(MAN_TABLE_LABEL[lang] + " " + startNumber + "-" + endNumber);
|
||||||
|
$("#rabbr_" + i).val('');
|
||||||
for (j=0;j<m;j++) {
|
for (j=0;j<m;j++) {
|
||||||
var t = (i + parseInt((j+1)/10)).toString() + ((j+1)%10).toString();
|
var t = (i + parseInt((j+1)/10)).toString() + ((j+1)%10).toString();
|
||||||
id = "#t_" + i.toString() + "_" + j.toString();
|
id = "#t_" + i.toString() + "_" + j.toString();
|
||||||
|
@ -1767,12 +1764,14 @@ function roomfield_apply() {
|
||||||
r_id = "#r_" + room_index.toString();
|
r_id = "#r_" + room_index.toString();
|
||||||
var roominfo = [];
|
var roominfo = [];
|
||||||
var roomname = $(r_id).val();
|
var roomname = $(r_id).val();
|
||||||
|
var roomabbr = $("#rabbr_" + room_index).val();
|
||||||
|
|
||||||
var selectedPrinter = $("#roomprinter_" + room_index).find(":selected").val();
|
var selectedPrinter = $("#roomprinter_" + room_index).find(":selected").val();
|
||||||
|
|
||||||
if ((roomname.replace(/ /,"")) != "") {
|
if ((roomname.replace(/ /,"")) != "") {
|
||||||
roominfo[0] = roomname;
|
roominfo[0] = roomname;
|
||||||
roominfo[1] = selectedPrinter;
|
roominfo[1] = roomabbr.trim();
|
||||||
|
roominfo[2] = selectedPrinter;
|
||||||
var tablesOfRoom = [];
|
var tablesOfRoom = [];
|
||||||
for (table_index = 0; table_index < m; table_index++) {
|
for (table_index = 0; table_index < m; table_index++) {
|
||||||
t_id = "#t_" + room_index.toString() + "_" + table_index.toString();
|
t_id = "#t_" + room_index.toString() + "_" + table_index.toString();
|
||||||
|
@ -1782,7 +1781,7 @@ function roomfield_apply() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (tablesOfRoom.length > 0) {
|
if (tablesOfRoom.length > 0) {
|
||||||
roominfo[2] = tablesOfRoom;
|
roominfo[3] = tablesOfRoom;
|
||||||
} else {
|
} else {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
<meta http-equiv="content-type" content="text/html; charset=utf-8">
|
<meta http-equiv="content-type" content="text/html; charset=utf-8">
|
||||||
<meta name="author" content="Stefan Pichel">
|
<meta name="author" content="Stefan Pichel">
|
||||||
|
|
||||||
<link rel="stylesheet" type="text/css" href="css/bestformat.css?v=1.1.11">
|
<link rel="stylesheet" type="text/css" href="css/bestformat.css?v=1.1.12">
|
||||||
<link rel="stylesheet" href="php/3rdparty/orderstyle/orderstyle.min.css" />
|
<link rel="stylesheet" href="php/3rdparty/orderstyle/orderstyle.min.css" />
|
||||||
<link rel="stylesheet" href="php/3rdparty/orderstyle/jquery.mobile.icons.min.css" />
|
<link rel="stylesheet" href="php/3rdparty/orderstyle/jquery.mobile.icons.min.css" />
|
||||||
|
|
||||||
|
@ -16,6 +16,7 @@
|
||||||
<script src="receiptutils.js"></script>
|
<script src="receiptutils.js"></script>
|
||||||
<script src="elements/tablemap.js"></script>
|
<script src="elements/tablemap.js"></script>
|
||||||
<script src="elements/localprint.js"></script>
|
<script src="elements/localprint.js"></script>
|
||||||
|
<script src="elements/grouping.js"></script>
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body>
|
<body>
|
||||||
|
@ -116,6 +117,18 @@ var cameFromOrdering = 0;
|
||||||
var billbrutto = 0.0;
|
var billbrutto = 0.0;
|
||||||
var billnetto = 0.0;
|
var billnetto = 0.0;
|
||||||
|
|
||||||
|
// REM* info about items to pay and the table - after products are retrieved for table
|
||||||
|
// REM* this is the list of items, including double entries:
|
||||||
|
var prodsToPayList = [];
|
||||||
|
// REM* this is the list that is grouped of all items in the "oben" list, i.e. still not on the receipt
|
||||||
|
var prodsToPayListGrouping = [];
|
||||||
|
// REM* this is the tablename that shall appear on the receipt and on the lists
|
||||||
|
var payTable = "";
|
||||||
|
//REM* this is the list of items, including double entries, of all entries already marked as being on the receipt
|
||||||
|
var prodsOnReceiptList = [];
|
||||||
|
// REM* this is the list that is grouped of all items in the "unten" list, i.e. on the receipt
|
||||||
|
var prodsOnReceiptListGrouping = [];
|
||||||
|
|
||||||
function getGeneralConfigItems() {
|
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");
|
||||||
}
|
}
|
||||||
|
@ -516,7 +529,7 @@ function getProdsToPayForTable(tableid,tablename) {
|
||||||
|
|
||||||
$("#info-page").data("tableprods",msg);
|
$("#info-page").data("tableprods",msg);
|
||||||
bindPayButton(msg,tableid,tablename);
|
bindPayButton(msg,tableid,tablename);
|
||||||
displayProdsToPayForTable(msg,tablename);
|
initiatePayableView(msg,tablename);
|
||||||
} else {
|
} else {
|
||||||
alert("Fehler: " + msg);
|
alert("Fehler: " + msg);
|
||||||
}
|
}
|
||||||
|
@ -527,32 +540,94 @@ function getProdsToPayForTable(tableid,tablename) {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function displayProdsToPayForTable(jsonContent,tablename) {
|
|
||||||
|
function initiatePayableView(jsonContent,tablename) {
|
||||||
$('#tableinreceipt').html(tablename + '<br> ');
|
$('#tableinreceipt').html(tablename + '<br> ');
|
||||||
clearUntenAndReceipt();
|
clearUntenAndReceipt();
|
||||||
createAllEntriesInReceipt();
|
createAllEntriesInReceipt();
|
||||||
calcSum();
|
calcSum();
|
||||||
|
prodsToPayList = jsonContent;
|
||||||
|
payTable = tablename;
|
||||||
|
displayProdsToPayForTable();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function displayProdsToPayForTable() {
|
||||||
|
// REM* first group the items
|
||||||
|
prodsToPayListGrouping = new Grouping(prodsToPayList,createHashOfPayableItem);
|
||||||
|
prodsToPayListGrouping.group();
|
||||||
|
|
||||||
var size = getProdSizeClass();
|
var size = getProdSizeClass();
|
||||||
$("#oben").empty().promise().done(function () {
|
|
||||||
var li = '<li data-role="list-divider" data-theme="b" data-role="heading">' + P_NOT_PAID[lang] + tablename + '</li>'; // init a list
|
var txt = '<li data-role="list-divider" data-theme="b" data-role="heading">' + P_NOT_PAID[lang] + payTable + '</li>'; // init a list
|
||||||
$("#oben").empty().append(li);
|
txt += '<li data-theme="f" data-icon="check"><a href="#" id="payall" class="' + size + '">' + P_ALL[lang] + '</a></li>';
|
||||||
$("#oben").append('<li data-theme="f" data-icon="check"><a href="#" id="payall" class="' + size + '">' + P_ALL[lang] + '</a></li>');
|
|
||||||
$.each(jsonContent, function (index,aProd) {
|
var listContent = txt + prodsToPayListGrouping.outputList(createPayableItemListElement);
|
||||||
// var queueid = jsonContent[this.id]["id"];
|
$("#oben").html(listContent);
|
||||||
addToOben(aProd["prodid"],toHtml(aProd["longname"]),aProd["price"],aProd["tax"],aProd["pricelevelname"],aProd["extras"],index);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
refreshList("#oben");
|
refreshList("#oben");
|
||||||
|
|
||||||
addAllToUnten(jsonContent,tablename);
|
$(".payable").off("click").on("click", function (e) {
|
||||||
|
e.stopImmediatePropagation();
|
||||||
|
e.preventDefault();
|
||||||
|
// REM* get rowIndex of item
|
||||||
|
var listItem = $(this).closest("li");
|
||||||
|
var rowIndex = $( "#oben li" ).index(listItem) - 2;
|
||||||
|
// REM* get an item from the payableList
|
||||||
|
var removedEntry = prodsToPayListGrouping.popSortedEntry(rowIndex);
|
||||||
|
prodsOnReceiptList[prodsOnReceiptList.length] = removedEntry;
|
||||||
|
displayProdsToPayForTable();
|
||||||
|
displayProdsOnReceipt();
|
||||||
|
});
|
||||||
|
|
||||||
|
$("#payall").off("click").on("click", function (e) {
|
||||||
|
e.stopImmediatePropagation();
|
||||||
|
e.preventDefault();
|
||||||
|
for (var i=0;i<prodsToPayList.length;i++) {
|
||||||
|
prodsOnReceiptList[prodsOnReceiptList.length] = prodsToPayList[i];
|
||||||
|
}
|
||||||
|
prodsToPayList = [];
|
||||||
|
displayProdsToPayForTable();
|
||||||
|
displayProdsOnReceipt();
|
||||||
|
});
|
||||||
|
|
||||||
window.scrollTo(0,0);
|
window.scrollTo(0,0);
|
||||||
}
|
}
|
||||||
|
|
||||||
function generateListItem(theme,icon,id,content) {
|
function displayProdsOnReceipt() {
|
||||||
|
// REM* first group the items
|
||||||
|
prodsOnReceiptListGrouping = new Grouping(prodsOnReceiptList,createHashOfPayableItem);
|
||||||
|
prodsOnReceiptListGrouping.group();
|
||||||
|
|
||||||
|
var size = getProdSizeClass();
|
||||||
|
|
||||||
|
var txt = '<li data-role="list-divider" data-theme="b" data-role="heading">';
|
||||||
|
txt += P_CONTENT_RECEIPT[lang] +': <p id="priceinreceipt">0,00 ' + currency + '</p></li>';
|
||||||
|
|
||||||
|
var listContent = txt + prodsOnReceiptListGrouping.outputList(createOnReceiptItemListElement);
|
||||||
|
$("#unten").html(listContent);
|
||||||
|
refreshList("#unten");
|
||||||
|
|
||||||
|
createAllEntriesInReceipt();
|
||||||
|
|
||||||
|
$(".onreceipt").off("click").on("click", function (e) {
|
||||||
|
e.stopImmediatePropagation();
|
||||||
|
e.preventDefault();
|
||||||
|
// REM* get rowIndex of item
|
||||||
|
var listItem = $(this).closest("li");
|
||||||
|
var rowIndex = $( "#unten li" ).index(listItem) - 1;
|
||||||
|
// REM* get an item from the payableList
|
||||||
|
var removedEntry = prodsOnReceiptListGrouping.popSortedEntry(rowIndex);
|
||||||
|
prodsToPayList[prodsToPayList.length] = removedEntry;
|
||||||
|
displayProdsToPayForTable();
|
||||||
|
displayProdsOnReceipt();
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
function generateListItem(theme,icon,id,content,classname) {
|
||||||
var size = getProdSizeClass();
|
var size = getProdSizeClass();
|
||||||
var li = '<li data-theme="' + theme + '" data-icon="' + icon + '">';
|
var li = '<li data-theme="' + theme + '" data-icon="' + icon + '">';
|
||||||
li += '<a href="#" id="' + id + '" class="info-go ' + size + '">' + content + '</a></li>';
|
li += '<a href="#" id="' + id + '" class="info-go ' + size + ' ' + classname + '">' + content + '</a></li>';
|
||||||
return li;
|
return li;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -591,39 +666,39 @@ function addAllToUnten(jsonContent,tablename) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function createHashOfPayableItem(aProd) {
|
||||||
|
var longname = aProd["longname"];
|
||||||
function addToOben(prodid,longname,price,tax,pricelevelname,extras,index) {
|
if (aProd["pricelevelname"] != "A") {
|
||||||
var jsonContent = $("#info-page").data("tableprods");
|
longname += " (" + aProd["pricelevelname"] + ")";
|
||||||
var tablename = $("#info-page").data("tablename");
|
|
||||||
if (pricelevelname != "A") {
|
|
||||||
longname += " (" + pricelevelname + ")";
|
|
||||||
}
|
}
|
||||||
longname += " - " + (parseFloat(price).toFixed(2).replace(".",decpoint));
|
longname += " - " + (parseFloat(aProd["price"]).toFixed(2).replace(".",decpoint));
|
||||||
|
var extratxt = createExtraParagraph(aProd["extras"]);
|
||||||
var extratxt = createExtraParagraph(extras);
|
return toHtml(longname) + extratxt;
|
||||||
|
|
||||||
var li_item = generateListItem("c","plus",index,toHtml(longname) + extratxt);
|
|
||||||
$("#oben").append(li_item).promise().done(function () {
|
|
||||||
createAllEntriesInReceipt();
|
|
||||||
$(this).off("click").on("click", ".info-go", function (e) {
|
|
||||||
e.stopImmediatePropagation();
|
|
||||||
e.preventDefault();
|
|
||||||
var prodid = jsonContent[this.id]["prodid"];
|
|
||||||
var price = jsonContent[this.id]["price"];
|
|
||||||
var tax = jsonContent[this.id]["tax"];
|
|
||||||
var pricelevelname = jsonContent[this.id]["pricelevelname"];
|
|
||||||
var longname = jsonContent[this.id]["longname"];
|
|
||||||
var extras = jsonContent[this.id]["extras"];
|
|
||||||
addToUnten(prodid,longname,price,tax,pricelevelname,extras,this.id);
|
|
||||||
createAllEntriesInReceipt();
|
|
||||||
$(this).closest("li").remove();
|
|
||||||
refreshList("#oben");
|
|
||||||
});
|
|
||||||
});
|
|
||||||
refreshList("#oben");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function createPayableItemListElement(aProd) {
|
||||||
|
var count = "";
|
||||||
|
if("count" in aProd) {
|
||||||
|
if (aProd["count"] > 1) {
|
||||||
|
count = aProd["count"] + "x ";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
var li_item = generateListItem("c","plus","payable_" + aProd["id"],count + createHashOfPayableItem(aProd),"payable");
|
||||||
|
return li_item;
|
||||||
|
}
|
||||||
|
|
||||||
|
function createOnReceiptItemListElement(aProd) {
|
||||||
|
var count = "";
|
||||||
|
if("count" in aProd) {
|
||||||
|
if (aProd["count"] > 1) {
|
||||||
|
count = aProd["count"] + "x ";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
var li_item = generateListItem("c","plus","payable_" + aProd["id"],count + createHashOfPayableItem(aProd),"onreceipt");
|
||||||
|
return li_item;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// Make table empty...
|
// Make table empty...
|
||||||
function clearUntenAndReceipt() {
|
function clearUntenAndReceipt() {
|
||||||
var untenHeader = '<li data-role="list-divider" data-theme="b" data-role="heading">';
|
var untenHeader = '<li data-role="list-divider" data-theme="b" data-role="heading">';
|
||||||
|
@ -639,36 +714,6 @@ function clearUntenAndReceipt() {
|
||||||
$("#thedate").html('<br><br> <br>');
|
$("#thedate").html('<br><br> <br>');
|
||||||
}
|
}
|
||||||
|
|
||||||
function addToUnten(prodid,longname,price,tax,pricelevelname,extras,index) {
|
|
||||||
var jsonContent = $("#info-page").data("tableprods");
|
|
||||||
var tablename = $("#info-page").data("tablename");
|
|
||||||
if (pricelevelname != "A") {
|
|
||||||
longname += " (" + pricelevelname + ")";
|
|
||||||
}
|
|
||||||
longname += " - " + (parseFloat(price).toFixed(2).replace(".",decpoint));
|
|
||||||
|
|
||||||
var extratxt = createExtraParagraph(extras);
|
|
||||||
|
|
||||||
var li_item = generateListItem("f","minus",index,toHtml(longname) + extratxt);
|
|
||||||
$("#unten").append(li_item).promise().done(function () {
|
|
||||||
createAllEntriesInReceipt();
|
|
||||||
$(this).off("click").on("click", ".info-go", function (e) {
|
|
||||||
e.stopImmediatePropagation();
|
|
||||||
e.preventDefault();
|
|
||||||
var prodid = jsonContent[this.id]["prodid"];
|
|
||||||
var price = jsonContent[this.id]["price"];
|
|
||||||
var tax = jsonContent[this.id]["tax"];
|
|
||||||
var extras = jsonContent[this.id]["extras"];
|
|
||||||
var pricelevelname = jsonContent[this.id]["pricelevelname"];
|
|
||||||
var longname = jsonContent[this.id]["longname"];
|
|
||||||
addToOben(prodid,longname,price,tax,pricelevelname,extras,this.id);
|
|
||||||
$(this).closest("li").remove();
|
|
||||||
createAllEntriesInReceipt();
|
|
||||||
refreshList("#unten");
|
|
||||||
});
|
|
||||||
});
|
|
||||||
refreshList("#unten");
|
|
||||||
}
|
|
||||||
|
|
||||||
// arrayToFill:
|
// arrayToFill:
|
||||||
// [0]: count prodid prodid-pricelevelname queueid longname price pricelevelname
|
// [0]: count prodid prodid-pricelevelname queueid longname price pricelevelname
|
||||||
|
@ -714,18 +759,15 @@ function listTaxes(collectionOfTaxes,decpointx) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function listTaxesBasedOnUntenList(decpointx) {
|
function listTaxesBasedOnUntenList(decpointx) {
|
||||||
var jsonContent = $("#info-page").data("tableprods");
|
|
||||||
|
|
||||||
// REM* which different taxes do we have?
|
// REM* which different taxes do we have?
|
||||||
var mytaxes = [];
|
var mytaxes = [];
|
||||||
var count = 0;
|
var count = 0;
|
||||||
|
|
||||||
$("#unten li a.info-go").each(function() {
|
|
||||||
var id_in_jsonText = this.id;
|
|
||||||
var prodEl = jsonContent[id_in_jsonText];
|
|
||||||
mytaxes.push(prodEl.tax);
|
|
||||||
});
|
|
||||||
|
|
||||||
|
for (var i=0;i<prodsOnReceiptList.length;i++) {
|
||||||
|
var prodEl = prodsOnReceiptList[i];
|
||||||
|
mytaxes.push(prodEl.tax);
|
||||||
|
}
|
||||||
|
|
||||||
return listTaxes(mytaxes,decpoint);
|
return listTaxes(mytaxes,decpoint);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -751,10 +793,10 @@ function calcSum() {
|
||||||
var overallbrutto = 0.0;
|
var overallbrutto = 0.0;
|
||||||
var overallmwst = 0.0;
|
var overallmwst = 0.0;
|
||||||
|
|
||||||
$("#unten li a.info-go").each(function() {
|
for (var k=0;k<prodsOnReceiptList.length;k++) {
|
||||||
var id_in_jsonText = $(this).attr('id');
|
var item = prodsOnReceiptList[k];
|
||||||
var bruttoprice = parseFloat(jsonContent[id_in_jsonText]["price"]);
|
var bruttoprice = parseFloat(item["price"]);
|
||||||
var taxStr = jsonContent[id_in_jsonText]["tax"];
|
var taxStr = item["tax"];
|
||||||
var tax = parseFloat(taxStr);
|
var tax = parseFloat(taxStr);
|
||||||
taxStr = taxStr.replace(".",decpoint);
|
taxStr = taxStr.replace(".",decpoint);
|
||||||
|
|
||||||
|
@ -776,7 +818,7 @@ function calcSum() {
|
||||||
overallnetto += nettoprice;
|
overallnetto += nettoprice;
|
||||||
overallbrutto += bruttoprice;
|
overallbrutto += bruttoprice;
|
||||||
overallmwst += mwst;
|
overallmwst += mwst;
|
||||||
});
|
};
|
||||||
|
|
||||||
|
|
||||||
for (var j=0;j<taxes.length;j++) {
|
for (var j=0;j<taxes.length;j++) {
|
||||||
|
@ -797,27 +839,26 @@ function calcSum() {
|
||||||
$("#priceinreceipt2").html(overallbrutto.toFixed(2).replace(".",decpoint) + " " + currency);
|
$("#priceinreceipt2").html(overallbrutto.toFixed(2).replace(".",decpoint) + " " + currency);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// REM* use prodsOnReceiptListGrouping
|
||||||
function createAllEntriesInReceipt() {
|
function createAllEntriesInReceipt() {
|
||||||
var jsonContent = $("#info-page").data("tableprods");
|
|
||||||
var tablename = $("#info-page").data("tablename");
|
var tablename = $("#info-page").data("tablename");
|
||||||
|
|
||||||
var entryListForReceipt=new Array();
|
var entryListForReceipt=new Array();
|
||||||
// collect all entries in the list #unten
|
// collect all entries in the list #unten
|
||||||
$("#unten li a.info-go").each(function() {
|
|
||||||
//tablecontent += '<tr class="prodlistinreceipt"><td id="count" class="price">1<td>' + longname + '<td id="price" class="price">' + (eval(price)).toFixed(2) + '<td id="total" class="price">' + (eval(price)).toFixed(2) + '</tr>';
|
for (var i=0;i<prodsOnReceiptList.length;i++) {
|
||||||
var id_in_jsonText = $(this).attr('id');
|
var item = prodsOnReceiptList[i];
|
||||||
var entry = {
|
var entry = {
|
||||||
prodid: jsonContent[id_in_jsonText]["prodid"],
|
prodid: item["prodid"],
|
||||||
queueid: jsonContent[id_in_jsonText]["id"],
|
queueid: item["id"],
|
||||||
longname: jsonContent[id_in_jsonText]["longname"],
|
longname: item["longname"],
|
||||||
price: jsonContent[id_in_jsonText]["price"],
|
price: item["price"],
|
||||||
tax: jsonContent[id_in_jsonText]["tax"],
|
tax: item["tax"],
|
||||||
extras: jsonContent[id_in_jsonText]["extras"],
|
extras: item["extras"],
|
||||||
pricelevelname: jsonContent[id_in_jsonText]["pricelevelname"]
|
pricelevelname: item["pricelevelname"]
|
||||||
};
|
};
|
||||||
entryListForReceipt = addEntryOrIncreaseCount(entryListForReceipt,entry);
|
entryListForReceipt = addEntryOrIncreaseCount(entryListForReceipt,entry);
|
||||||
});
|
}
|
||||||
|
|
||||||
var tablecontent = createReceiptHeader();
|
var tablecontent = createReceiptHeader();
|
||||||
|
|
||||||
|
@ -892,18 +933,18 @@ function bindPayButton(jsonContent,tableid,tablename) {
|
||||||
$("#payWithoutPrint").off("click").on("click", function (e) {
|
$("#payWithoutPrint").off("click").on("click", function (e) {
|
||||||
e.stopImmediatePropagation();
|
e.stopImmediatePropagation();
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
selectPayment(jsonContent,tableid,tablename,false);
|
selectPayment(tableid,tablename,false);
|
||||||
});
|
});
|
||||||
$("#payWithPrint").off("click").on("click", function (e) {
|
$("#payWithPrint").off("click").on("click", function (e) {
|
||||||
e.stopImmediatePropagation();
|
e.stopImmediatePropagation();
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
selectPayment(jsonContent,tableid,tablename,true);
|
selectPayment(tableid,tablename,true);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function selectPayment(jsonContent,tableid,tablename,printoption) {
|
function selectPayment(tableid,tablename,printoption) {
|
||||||
// first test if there are items to pay!
|
// first test if there are items to pay!
|
||||||
var itemsToPay = $('#unten li').size() - 1;
|
var itemsToPay = prodsOnReceiptList.length;
|
||||||
if (itemsToPay == 0) {
|
if (itemsToPay == 0) {
|
||||||
$.mobile.changePage("#nocashitems");
|
$.mobile.changePage("#nocashitems");
|
||||||
} else {
|
} else {
|
||||||
|
@ -925,7 +966,7 @@ function selectPayment(jsonContent,tableid,tablename,printoption) {
|
||||||
if ($("#info-page").data("taxtype") == "togo") {
|
if ($("#info-page").data("taxtype") == "togo") {
|
||||||
appliedTax = $("#info-page").data("togotax");
|
appliedTax = $("#info-page").data("togotax");
|
||||||
}
|
}
|
||||||
startPayProcess(jsonContent,printoption,tableid,tablename,paymentId,appliedTax);
|
startPayProcess(printoption,tableid,tablename,paymentId,appliedTax);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -951,16 +992,15 @@ function bindCalcReturn() {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function startPayProcess(jsonContent,printoption,tableid,tablename,paymentid,tax) {
|
function startPayProcess(printoption,tableid,tablename,paymentid,tax) {
|
||||||
checkForLogIn();
|
checkForLogIn();
|
||||||
var ids="";
|
var ids="";
|
||||||
$('#unten li').each(function() {
|
|
||||||
var index = $(this).find("a").attr("id");
|
for (var i=0;i<prodsOnReceiptList.length;i++) {
|
||||||
if (typeof index != 'undefined') {
|
var item = prodsOnReceiptList[i];
|
||||||
var queueid = jsonContent[index]["id"];
|
var queueId = item["id"];
|
||||||
ids += queueid + ",";
|
ids += queueId + ",";
|
||||||
}
|
}
|
||||||
});
|
|
||||||
|
|
||||||
// REM* declarePaidCreateBillReturnBillId
|
// REM* declarePaidCreateBillReturnBillId
|
||||||
var style = ' style="table-layout: fixed; width: 70%; background-color: #cccccc;" ';
|
var style = ' style="table-layout: fixed; width: 70%; background-color: #cccccc;" ';
|
||||||
|
@ -1016,6 +1056,7 @@ function startPayProcess(jsonContent,printoption,tableid,tablename,paymentid,tax
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// bug workaround. reload does not work after pdf-print-so getProd in all cases
|
// bug workaround. reload does not work after pdf-print-so getProd in all cases
|
||||||
|
prodsOnReceiptList = [];
|
||||||
getProdsToPayForTable(tableid,tablename);
|
getProdsToPayForTable(tableid,tablename);
|
||||||
var itemsLeft = $('#oben li').size() - 2;
|
var itemsLeft = $('#oben li').size() - 2;
|
||||||
if (itemsLeft > 0) {
|
if (itemsLeft > 0) {
|
||||||
|
|
|
@ -123,6 +123,8 @@ class Admin {
|
||||||
$this->getPayPrintType();
|
$this->getPayPrintType();
|
||||||
} else if ($command == 'getPayments') {
|
} else if ($command == 'getPayments') {
|
||||||
$this->getPayments();
|
$this->getPayments();
|
||||||
|
} else if ($command == 'autobackup') {
|
||||||
|
$this->backup('auto',$_POST['remoteaccesscode']);
|
||||||
} else if (($command == 'new') || ($command == 'shutdown') || ($command == 'backup') || ($command == 'restore') || ($command == 'drop') || ($command == 'fill') || ($command == 'fillSampleProdType') || ($command == 'fillSpeisekarte') || ($command == 'assignTaxes')) {
|
} else if (($command == 'new') || ($command == 'shutdown') || ($command == 'backup') || ($command == 'restore') || ($command == 'drop') || ($command == 'fill') || ($command == 'fillSampleProdType') || ($command == 'fillSpeisekarte') || ($command == 'assignTaxes')) {
|
||||||
if ($this->isCurrentUserAdmin()) {
|
if ($this->isCurrentUserAdmin()) {
|
||||||
if ($command == 'fill') {
|
if ($command == 'fill') {
|
||||||
|
@ -134,7 +136,7 @@ class Admin {
|
||||||
} else if ($command == 'fillSpeisekarte') {
|
} else if ($command == 'fillSpeisekarte') {
|
||||||
$this->fillSpeisekarte($_POST['speisekarte']);
|
$this->fillSpeisekarte($_POST['speisekarte']);
|
||||||
} else if ($command == 'backup') {
|
} else if ($command == 'backup') {
|
||||||
$this->backup($_GET['type']);
|
$this->backup($_GET['type'],null);
|
||||||
return;
|
return;
|
||||||
} else if ($command == 'restore') {
|
} else if ($command == 'restore') {
|
||||||
$this->restore();
|
$this->restore();
|
||||||
|
@ -1104,19 +1106,19 @@ class Admin {
|
||||||
$right_rating = $_SESSION['right_rating'];
|
$right_rating = $_SESSION['right_rating'];
|
||||||
|
|
||||||
if (!self::isOnlyRatingUser($rights, $right_rating, true)) {
|
if (!self::isOnlyRatingUser($rights, $right_rating, true)) {
|
||||||
if ($_SESSION['right_waiter']) { $mainMenu[] = array("name" => $waitertxt[$lang], "link" => "waiter.html?v=1.1.11"); };
|
if ($_SESSION['right_waiter']) { $mainMenu[] = array("name" => $waitertxt[$lang], "link" => "waiter.html?v=1.1.12"); };
|
||||||
if ($_SESSION['right_kitchen']) { $mainMenu[] = array("name" => $kitchentxt[$lang], "link" => "kitchen.html?v=1.1.11"); };
|
if ($_SESSION['right_kitchen']) { $mainMenu[] = array("name" => $kitchentxt[$lang], "link" => "kitchen.html?v=1.1.12"); };
|
||||||
if ($_SESSION['right_bar']) { $mainMenu[] = array("name" => "Bar", "link" => "bar.html?v=1.1.11"); };
|
if ($_SESSION['right_bar']) { $mainMenu[] = array("name" => "Bar", "link" => "bar.html?v=1.1.12"); };
|
||||||
if ($_SESSION['right_supply']) { $mainMenu[] = array("name" => $supplytxt[$lang], "link" => "supplydesk.html?v=1.1.11"); };
|
if ($_SESSION['right_supply']) { $mainMenu[] = array("name" => $supplytxt[$lang], "link" => "supplydesk.html?v=1.1.12"); };
|
||||||
if ($_SESSION['right_paydesk']) { $mainMenu[] = array("name" => $paydesktxt[$lang], "link" => "paydesk.html"); };
|
if ($_SESSION['right_paydesk']) { $mainMenu[] = array("name" => $paydesktxt[$lang], "link" => "paydesk.html"); };
|
||||||
if ($_SESSION['right_statistics']) { $mainMenu[] = array("name" => $stattxt[$lang], "link" => "reports.html?v=1.1.11"); };
|
if ($_SESSION['right_statistics']) { $mainMenu[] = array("name" => $stattxt[$lang], "link" => "reports.html?v=1.1.12"); };
|
||||||
if ($_SESSION['right_bill']) { $mainMenu[] = array("name" => $bontxt[$lang], "link" => "bill.html?v=1.1.11"); };
|
if ($_SESSION['right_bill']) { $mainMenu[] = array("name" => $bontxt[$lang], "link" => "bill.html?v=1.1.12"); };
|
||||||
if ($_SESSION['right_products']) { $mainMenu[] = array("name" => $prodtxt[$lang], "link" => "products.html?v=1.1.11"); };
|
if ($_SESSION['right_products']) { $mainMenu[] = array("name" => $prodtxt[$lang], "link" => "products.html?v=1.1.12"); };
|
||||||
if ($_SESSION['right_reservation']) { $mainMenu[] = array("name" => $restxt[$lang], "link" => "reservation.html?v=1.1.11"); };
|
if ($_SESSION['right_reservation']) { $mainMenu[] = array("name" => $restxt[$lang], "link" => "reservation.html?v=1.1.12"); };
|
||||||
if ($_SESSION['right_rating']) { $mainMenu[] = array("name" => $ratingtxt[$lang], "link" => "rating.html?v=1.1.11"); };
|
if ($_SESSION['right_rating']) { $mainMenu[] = array("name" => $ratingtxt[$lang], "link" => "rating.html?v=1.1.12"); };
|
||||||
if ($_SESSION['right_manager'] || $_SESSION['is_admin']) { $mainMenu[] = array("name" => $admintxt[$lang], "link" => "manager.html?v=1.1.11"); };
|
if ($_SESSION['right_manager'] || $_SESSION['is_admin']) { $mainMenu[] = array("name" => $admintxt[$lang], "link" => "manager.html?v=1.1.12"); };
|
||||||
$mainMenu[] = array("name" => $settingtxt[$lang], "link" => "preferences.html?v=1.1.11");
|
$mainMenu[] = array("name" => $settingtxt[$lang], "link" => "preferences.html?v=1.1.12");
|
||||||
$mainMenu[] = array("name" => "Feedback", "link" => "feedback.html?v=1.1.11");
|
$mainMenu[] = array("name" => "Feedback", "link" => "feedback.html?v=1.1.12");
|
||||||
}
|
}
|
||||||
|
|
||||||
$mainMenu[] = array("name" => $logout[$lang], "link" => "logout.php");
|
$mainMenu[] = array("name" => $logout[$lang], "link" => "logout.php");
|
||||||
|
@ -1125,7 +1127,7 @@ class Admin {
|
||||||
$waiterMessage = $this->getMessage(null, "waitermessage");
|
$waiterMessage = $this->getMessage(null, "waitermessage");
|
||||||
}
|
}
|
||||||
// CAUTION: change version also in config.txt!!!
|
// CAUTION: change version also in config.txt!!!
|
||||||
$mainMenuAndVersion = array ("version" => "OrderSprinter 1.1.11",
|
$mainMenuAndVersion = array ("version" => "OrderSprinter 1.1.12",
|
||||||
"user" => $currentUser,
|
"user" => $currentUser,
|
||||||
"menu" => $mainMenu,
|
"menu" => $mainMenu,
|
||||||
"waitermessage" => $waiterMessage,
|
"waitermessage" => $waiterMessage,
|
||||||
|
@ -1724,13 +1726,33 @@ class Admin {
|
||||||
"user","reservations","bill","queue","billproducts","comments","histprod","histconfig","histuser","histactions","hist","extras","extrasprods","queueextras");
|
"user","reservations","bill","queue","billproducts","comments","histprod","histconfig","histuser","histactions","hist","extras","extrasprods","queueextras");
|
||||||
}
|
}
|
||||||
|
|
||||||
public function backup($theType) {
|
public function backup($theType,$remoteaccesscode) {
|
||||||
date_default_timezone_set(DbUtils::getTimeZone());
|
date_default_timezone_set(DbUtils::getTimeZone());
|
||||||
$nowtime = date('Y-m-d');
|
$nowtime = date('Y-m-d');
|
||||||
|
|
||||||
ini_set('memory_limit', '1000M');
|
ini_set('memory_limit', '1000M');
|
||||||
|
|
||||||
$pdo = DButils::openDbAndReturnPdoStatic();
|
$pdo = DButils::openDbAndReturnPdoStatic();
|
||||||
|
|
||||||
|
if ($theType == "auto") {
|
||||||
|
$sql = "SELECT count(id) as number,setting FROM %config% WHERE name=?";
|
||||||
|
$stmt = $pdo->prepare(DbUtils::substTableAlias($sql));
|
||||||
|
$stmt->execute(array("remoteaccesscode"));
|
||||||
|
$row = $stmt->fetchObject();
|
||||||
|
if ($row->number == 0) {
|
||||||
|
echo "No remote access code available - backup not allowed";
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
$code = $row->setting;
|
||||||
|
if (is_null($code) || (trim($code) == "")) {
|
||||||
|
echo "No remote access code set - backup not allowed";
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if ($code != md5($remoteaccesscode)) {
|
||||||
|
echo "Wrong remote access code used - backup not allowed";
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
$pdo->beginTransaction();
|
$pdo->beginTransaction();
|
||||||
|
|
||||||
$genInfo = $this->getGeneralConfigItems(false, $pdo);
|
$genInfo = $this->getGeneralConfigItems(false, $pdo);
|
||||||
|
@ -1801,18 +1823,24 @@ class Admin {
|
||||||
}
|
}
|
||||||
|
|
||||||
private function restore() {
|
private function restore() {
|
||||||
|
ini_set('memory_limit', '1000M');
|
||||||
|
set_time_limit(60*5);
|
||||||
|
|
||||||
if ($_FILES['userfile']['error'] != UPLOAD_ERR_OK //checks for errors
|
if ($_FILES['userfile']['error'] != UPLOAD_ERR_OK //checks for errors
|
||||||
&& is_uploaded_file($_FILES['userfile']['tmp_name'])) { //checks that file is uploaded
|
&& is_uploaded_file($_FILES['userfile']['tmp_name'])) { //checks that file is uploaded
|
||||||
header("Location: ../infopage.html?e=manager.html=Kann_Datei_nicht_laden.");
|
header("Location: ../infopage.html?e=manager.html=Kann_Datei_nicht_laden.");
|
||||||
exit();
|
exit();
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!file_exists($_FILES['userfile']['tmp_name']) || !is_uploaded_file($_FILES['userfile']['tmp_name'])) {
|
if(!file_exists($_FILES['userfile']['tmp_name'])) {
|
||||||
header("Location: ../infopage.html?e=manager.html=Datei_nicht_angegeben.");
|
header("Location: ../infopage.html?e=manager.html=Datei_existiert_nicht._Bitte_PHP-Variable_upload_max_filesize_checken.");
|
||||||
exit();
|
exit();
|
||||||
}
|
}
|
||||||
|
|
||||||
ini_set('memory_limit', '1000M');
|
if(!is_uploaded_file($_FILES['userfile']['tmp_name'])) {
|
||||||
|
header("Location: ../infopage.html?e=manager.html=Datei_konnte_nicht_hochgeladen_werden.");
|
||||||
|
exit();
|
||||||
|
}
|
||||||
|
|
||||||
$binaryFields = array("signature","img","setting","content");
|
$binaryFields = array("signature","img","setting","content");
|
||||||
|
|
||||||
|
@ -1822,8 +1850,6 @@ class Admin {
|
||||||
$basedb->setPrefix(TAB_PREFIX);
|
$basedb->setPrefix(TAB_PREFIX);
|
||||||
$basedb->setTimeZone(DbUtils::getTimeZone());
|
$basedb->setTimeZone(DbUtils::getTimeZone());
|
||||||
|
|
||||||
set_time_limit(60*5);
|
|
||||||
|
|
||||||
$pdo = DbUtils::openDbAndReturnPdoStatic();
|
$pdo = DbUtils::openDbAndReturnPdoStatic();
|
||||||
$pdo->beginTransaction();
|
$pdo->beginTransaction();
|
||||||
|
|
||||||
|
|
|
@ -54,7 +54,7 @@ class Bill {
|
||||||
}
|
}
|
||||||
if ($command == 'exportPdfReport') {
|
if ($command == 'exportPdfReport') {
|
||||||
if ($this->hasCurrentUserAdminOrManagerRights()) {
|
if ($this->hasCurrentUserAdminOrManagerRights()) {
|
||||||
$this->exportPdfReport($_GET['lang'],$_GET['startMonth'],$_GET['startYear'],$_GET['endMonth'],$_GET['endYear']);
|
$this->exportPdfReport($_GET['startMonth'],$_GET['startYear'],$_GET['endMonth'],$_GET['endYear']);
|
||||||
} else {
|
} else {
|
||||||
echo "Benutzer nicht berechtigt";
|
echo "Benutzer nicht berechtigt";
|
||||||
}
|
}
|
||||||
|
@ -62,12 +62,16 @@ class Bill {
|
||||||
}
|
}
|
||||||
if ($command == 'exportPdfSummary') {
|
if ($command == 'exportPdfSummary') {
|
||||||
if ($this->hasCurrentUserAdminOrManagerRights()) {
|
if ($this->hasCurrentUserAdminOrManagerRights()) {
|
||||||
$this->exportPdfSummary($_GET['lang'],$_GET['startMonth'],$_GET['startYear'],$_GET['endMonth'],$_GET['endYear']);
|
$this->exportPdfSummary($_GET['startMonth'],$_GET['startYear'],$_GET['endMonth'],$_GET['endYear']);
|
||||||
} else {
|
} else {
|
||||||
echo "Benutzer nicht berechtigt";
|
echo "Benutzer nicht berechtigt";
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
if ($command == 'autoBackupPdfSummary') {
|
||||||
|
$this->autoBackupPdfSummary($_POST['remoteaccesscode']);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if ($command == 'exportCsvOfClosing') {
|
if ($command == 'exportCsvOfClosing') {
|
||||||
if ($this->hasCurrentUserAdminOrManagerRights()) {
|
if ($this->hasCurrentUserAdminOrManagerRights()) {
|
||||||
|
@ -146,14 +150,26 @@ class Bill {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function billIsCancelled($pdo,$billid) {
|
||||||
|
$sql = "SELECT status FROM %bill% WHERE id=?";
|
||||||
|
$stmt = $pdo->prepare(DbUtils::substTableAlias($sql));
|
||||||
|
$stmt->execute(array($billid));
|
||||||
|
$row = $stmt->fetchObject();
|
||||||
|
$status = $row->status;
|
||||||
|
$ret = false;
|
||||||
|
if (($status == "x") || ($status == "s")) {
|
||||||
|
$ret = true;
|
||||||
|
}
|
||||||
|
return $ret;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* get the content of a bill (to be used for printserver etc.)
|
* get the content of a bill (to be used for printserver etc.)
|
||||||
*
|
*
|
||||||
* @param unknown $billid
|
* @param unknown $billid
|
||||||
*/
|
*/
|
||||||
function getBillWithId($billid,$language,$printer) {
|
function getBillWithId($pdo,$billid,$language,$printer) {
|
||||||
set_time_limit(120);
|
set_time_limit(120);
|
||||||
$pdo = $this->dbutils->openDbAndReturnPdo();
|
|
||||||
|
|
||||||
// is bill correct with signature?
|
// is bill correct with signature?
|
||||||
$commonUtils = new CommonUtils();
|
$commonUtils = new CommonUtils();
|
||||||
|
@ -176,25 +192,43 @@ class Bill {
|
||||||
$stmt->execute(array($billid));
|
$stmt->execute(array($billid));
|
||||||
$qrow = $stmt->fetchObject();
|
$qrow = $stmt->fetchObject();
|
||||||
|
|
||||||
|
$tableid = $row->tableid;
|
||||||
if ($qrow->countid == 0) {
|
if ($qrow->countid == 0) {
|
||||||
if ($row->tableid == 0) {
|
if ($tableid == 0) {
|
||||||
// togo
|
// togo
|
||||||
$sql = "SELECT DISTINCT billdate,brutto,netto,'-' as tablename,username,host FROM %bill%,%user% WHERE %bill%.id=? AND userid=%user%.id AND tableid='0' ";
|
$sql = "SELECT DISTINCT billdate,brutto,netto,'-' as tablename,username,host,IFNULL(%bill%.status,'') as status FROM %bill%,%user% WHERE %bill%.id=? AND userid=%user%.id AND tableid='0' ";
|
||||||
} else {
|
} else {
|
||||||
$sql = "SELECT DISTINCT billdate,brutto,netto,tableno as tablename,username,host FROM %bill%,%user%,%resttables% WHERE %bill%.id=? AND userid=%user%.id AND tableid=%resttables%.id ";
|
$sql = "SELECT DISTINCT billdate,brutto,netto,tableno as tablename,username,host,IFNULL(%bill%.status,'') as status FROM %bill%,%user%,%resttables% WHERE %bill%.id=? AND userid=%user%.id AND tableid=%resttables%.id ";
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if ($row->tableid == 0) {
|
if ($tableid == 0) {
|
||||||
// togo
|
// togo
|
||||||
$sql = "SELECT DISTINCT billdate,brutto,netto,'-' as tablename,username,host FROM %bill%,%user%,%queue% WHERE %bill%.id=? AND %bill%.id=%queue%.billid AND userid=%user%.id AND tableid='0' AND paidtime is not null ";
|
$sql = "SELECT DISTINCT billdate,brutto,netto,'-' as tablename,username,host,IFNULL(%bill%.status,'') as status 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 {
|
} else {
|
||||||
$sql = "SELECT DISTINCT billdate,brutto,netto,tableno as tablename,username,host 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 ";
|
$sql = "SELECT DISTINCT billdate,brutto,netto,tableno as tablename,username,host,IFNULL(%bill%.status,'') as status 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 ";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$stmt = $pdo->prepare(DbUtils::substTableAlias($sql));
|
$stmt = $pdo->prepare(DbUtils::substTableAlias($sql));
|
||||||
$stmt->execute(array($billid));
|
$stmt->execute(array($billid));
|
||||||
$row = $stmt->fetchObject();
|
$row = $stmt->fetchObject();
|
||||||
|
|
||||||
|
$status = $row->status;
|
||||||
|
$sign = ($status == "s" ? "-" : "");
|
||||||
|
|
||||||
|
if ($tableid != 0) {
|
||||||
|
$sql = "SELECT abbreviation FROM %room%,%resttables% WHERE %resttables%.id=? AND %resttables%.roomid=%room%.id";
|
||||||
|
$stmt = $pdo->prepare(DbUtils::substTableAlias($sql));
|
||||||
|
$stmt->execute(array($tableid));
|
||||||
|
$trow = $stmt->fetchObject();
|
||||||
|
if (is_null($trow->abbreviation)) {
|
||||||
|
$tablename = $row->tablename;
|
||||||
|
} else {
|
||||||
|
$tablename = $trow->abbreviation . "-" . $row->tablename;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
$tablename = "-";
|
||||||
|
}
|
||||||
|
|
||||||
if ($row == null) {
|
if ($row == null) {
|
||||||
// no rows found -> deliver no content
|
// no rows found -> deliver no content
|
||||||
echo json_encode(array("billoverallinfo" => array()));
|
echo json_encode(array("billoverallinfo" => array()));
|
||||||
|
@ -228,7 +262,7 @@ class Bill {
|
||||||
"billmin" => $min,
|
"billmin" => $min,
|
||||||
"brutto" => $row->brutto,
|
"brutto" => $row->brutto,
|
||||||
"netto" => $row->netto,
|
"netto" => $row->netto,
|
||||||
"table" => $row->tablename,
|
"table" => $tablename,
|
||||||
"username" => $row->username,
|
"username" => $row->username,
|
||||||
"printer" => $printer,
|
"printer" => $printer,
|
||||||
"host" => $host
|
"host" => $host
|
||||||
|
@ -250,7 +284,7 @@ class Bill {
|
||||||
}
|
}
|
||||||
|
|
||||||
// now get all products of this bill
|
// now get all products of this bill
|
||||||
$sql = "select productname,price,%pricelevel%.name as pricelevelname,count(%queue%.productname) as count from %bill%,%queue%,%pricelevel% where %bill%.id=? and %queue%.billid=%bill%.id AND paidtime is not null AND %queue%.pricelevel = %pricelevel%.id group by productname,price,pricelevelname";
|
$sql = "select productname,price,%pricelevel%.name as pricelevelname,count(%queue%.productname) as count from %queue%,%pricelevel%,%billproducts% where %billproducts%.billid=? AND %billproducts%.queueid=%queue%.id AND %queue%.pricelevel = %pricelevel%.id group by productname,price,pricelevelname";
|
||||||
$stmt = $pdo->prepare($this->dbutils->resolveTablenamesInSqlString($sql));
|
$stmt = $pdo->prepare($this->dbutils->resolveTablenamesInSqlString($sql));
|
||||||
$stmt->execute(array($billid));
|
$stmt->execute(array($billid));
|
||||||
$result = $stmt->fetchAll();
|
$result = $stmt->fetchAll();
|
||||||
|
@ -260,16 +294,16 @@ class Bill {
|
||||||
$prodarray[] = array("count" => $zeile['count'],
|
$prodarray[] = array("count" => $zeile['count'],
|
||||||
"productname" => $zeile['productname'],
|
"productname" => $zeile['productname'],
|
||||||
"pricelevel" => $zeile['pricelevelname'],
|
"pricelevel" => $zeile['pricelevelname'],
|
||||||
"price" => $zeile['price']
|
"price" => $sign . $zeile['price']
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
$sql = "select tax,round(sum(price) - sum(price / (1.0 + tax/100.0)),2) as mwst, round(sum(price / (1.0 + tax/100.0)),2) as netto, sum(price) as brutto FROM %queue% WHERE billid=? group by tax ORDER BY tax";
|
$sql = "select tax,concat('$sign',round(sum(price) - sum(price / (1.0 + tax/100.0)),2)) as mwst, concat('$sign',round(sum(price / (1.0 + tax/100.0)),2)) as netto, concat('$sign',sum(price)) as brutto FROM %queue%,%billproducts% WHERE %billproducts%.billid=? AND %billproducts%.queueid=%queue%.id group by tax ORDER BY tax";
|
||||||
$stmt = $pdo->prepare($this->dbutils->resolveTablenamesInSqlString($sql));
|
$stmt = $pdo->prepare(DbUtils::substTableAlias($sql));
|
||||||
$stmt->execute(array($billid));
|
$stmt->execute(array($billid));
|
||||||
$result = $stmt->fetchAll(PDO::FETCH_OBJ);
|
$result = $stmt->fetchAll(PDO::FETCH_OBJ);
|
||||||
|
|
||||||
$out = array("billoverallinfo" => $billoverallinfo,"translations" => $billtranslations,"products" => $prodarray, "taxes" => $result);
|
$out = array("billoverallinfo" => $billoverallinfo,"translations" => $billtranslations,"products" => $prodarray, "taxes" => $result);
|
||||||
return $out;
|
return $out;
|
||||||
}
|
}
|
||||||
|
@ -376,7 +410,7 @@ class Bill {
|
||||||
|
|
||||||
$commonUtils = new CommonUtils();
|
$commonUtils = new CommonUtils();
|
||||||
|
|
||||||
$sql = "SELECT id,billdate,brutto,tableid,closingid,status FROM %bill% WHERE tableid >= '0' AND status is null AND $whenClause ORDER BY billdate DESC ";
|
$sql = "SELECT id,billdate,brutto,tableid,closingid,status FROM %bill% WHERE tableid >= '0' AND $whenClause ORDER BY billdate DESC ";
|
||||||
$stmt = $pdo->prepare(DbUtils::substTableAlias($sql));
|
$stmt = $pdo->prepare(DbUtils::substTableAlias($sql));
|
||||||
$stmt->execute(array($startDate,$endDate));
|
$stmt->execute(array($startDate,$endDate));
|
||||||
$result = $stmt->fetchAll();
|
$result = $stmt->fetchAll();
|
||||||
|
@ -393,13 +427,16 @@ class Bill {
|
||||||
$shortdate = $date->format('H:i');
|
$shortdate = $date->format('H:i');
|
||||||
$closingID = $zeile['closingid'];
|
$closingID = $zeile['closingid'];
|
||||||
$isClosed = (is_null($closingID) ? 0 : 1);
|
$isClosed = (is_null($closingID) ? 0 : 1);
|
||||||
|
if ($this->billIsCancelled($pdo,$theId)) {
|
||||||
|
$isClosed = 1;
|
||||||
|
}
|
||||||
|
|
||||||
$arr = array("id" => $theId,
|
$arr = array("id" => $theId,
|
||||||
"longdate" => $zeile['billdate'],
|
"longdate" => $zeile['billdate'],
|
||||||
"shortdate" => $shortdate,
|
"shortdate" => $shortdate,
|
||||||
"brutto" => $zeile['brutto'],
|
"brutto" => $zeile['brutto'],
|
||||||
"tablename" => $commonUtils->getTableNameFromId($pdo,$zeile['tableid']),
|
"tablename" => $commonUtils->getTableNameFromId($pdo,$zeile['tableid']),
|
||||||
"billcontent" => $this->getBillWithId($theId,$l,0),
|
"billcontent" => $this->getBillWithId($pdo,$theId,$l,0),
|
||||||
"isClosed" => $isClosed
|
"isClosed" => $isClosed
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -580,13 +617,50 @@ class Bill {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private function autoBackupPdfSummary($remoteaccesscode) {
|
||||||
|
$pdo = DbUtils::openDbAndReturnPdoStatic();
|
||||||
|
$sql = "SELECT count(id) as number,setting FROM %config% WHERE name=?";
|
||||||
|
$stmt = $pdo->prepare(DbUtils::substTableAlias($sql));
|
||||||
|
$stmt->execute(array("remoteaccesscode"));
|
||||||
|
$row = $stmt->fetchObject();
|
||||||
|
if ($row->number == 0) {
|
||||||
|
echo "No remote access code available - backup not allowed";
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
$code = $row->setting;
|
||||||
|
if (is_null($code) || (trim($code) == "")) {
|
||||||
|
echo "No remote access code set - backup not allowed";
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($code != md5($remoteaccesscode)) {
|
||||||
|
echo "Wrong remote access code used - backup not allowed";
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
$pdo = null;
|
||||||
|
|
||||||
|
date_default_timezone_set(DbUtils::getTimeZone());
|
||||||
|
$currentYear = date('Y');
|
||||||
|
$currentMonth = date('n');
|
||||||
|
|
||||||
|
$this->exportPdfSummary(1, $currentYear, $currentMonth, $currentYear);
|
||||||
|
}
|
||||||
|
|
||||||
private function exportPdfReport($startMonth,$startYear,$endMonth,$endYear) {
|
private function exportPdfReport($startMonth,$startYear,$endMonth,$endYear) {
|
||||||
$pdfExport = new PdfExport();
|
$pdfExport = new PdfExport();
|
||||||
$pdfExport->exportPdfReport($_GET['lang'],$_GET['startMonth'],$_GET['startYear'],$_GET['endMonth'],$_GET['endYear']);
|
$lang = 0;
|
||||||
|
if(isset($_GET["lang"])) {
|
||||||
|
$lang = $_GET['lang'];
|
||||||
|
}
|
||||||
|
$pdfExport->exportPdfReport($lang,$startMonth,$startYear,$endMonth,$endYear);
|
||||||
}
|
}
|
||||||
private function exportPdfSummary($startMonth,$startYear,$endMonth,$endYear) {
|
private function exportPdfSummary($startMonth,$startYear,$endMonth,$endYear) {
|
||||||
$pdfExport = new PdfExport();
|
$pdfExport = new PdfExport();
|
||||||
$pdfExport->exportPdfSummary($_GET['lang'],$_GET['startMonth'],$_GET['startYear'],$_GET['endMonth'],$_GET['endYear']);
|
$lang = 0;
|
||||||
|
if(isset($_GET["lang"])) {
|
||||||
|
$lang = $_GET['lang'];
|
||||||
|
}
|
||||||
|
$pdfExport->exportPdfSummary($lang,$startMonth,$startYear,$endMonth,$endYear);
|
||||||
}
|
}
|
||||||
|
|
||||||
private function exportCsv($startMonth,$startYear,$endMonth,$endYear,$exportType) {
|
private function exportCsv($startMonth,$startYear,$endMonth,$endYear,$exportType) {
|
||||||
|
|
|
@ -501,7 +501,7 @@ $csv .= "$aBillId; \"$billdate\" ; \"" . $this->t['cashaction'][$l] . "\" ; \"$b
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
$sql = "SELECT DISTINCT productname,price,%queue%.tax as tax FROM %queue%,%billproducts% WHERE %billproducts%.billid=?' AND %billproducts%.queueid=%queue%.id";
|
$sql = "SELECT DISTINCT productname,price,%queue%.tax as tax FROM %queue%,%billproducts% WHERE %billproducts%.billid=? AND %billproducts%.queueid=%queue%.id";
|
||||||
if ($status == 'x') {
|
if ($status == 'x') {
|
||||||
$statusTxt = $this->t["laterCancelled"][$l];
|
$statusTxt = $this->t["laterCancelled"][$l];
|
||||||
} else if ($status == 's') {
|
} else if ($status == 's') {
|
||||||
|
|
|
@ -331,7 +331,7 @@ class PrintQueue {
|
||||||
$printer = $aBill["printer"];
|
$printer = $aBill["printer"];
|
||||||
|
|
||||||
if (in_array($printer, $printersArr)) {
|
if (in_array($printer, $printersArr)) {
|
||||||
$receiptJob = array("id" => $printJobId,"bill" => $bill->getBillWithId($aBillId,$language,$printer));
|
$receiptJob = array("id" => $printJobId,"bill" => $bill->getBillWithId($pdo,$aBillId,$language,$printer));
|
||||||
$billarray[] = $receiptJob;
|
$billarray[] = $receiptJob;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -474,12 +474,16 @@ class QueueContent {
|
||||||
$takeAwayStr = array("Zum Mitnehmen","Take away","Para llevar");
|
$takeAwayStr = array("Zum Mitnehmen","Take away","Para llevar");
|
||||||
$tablename = $takeAwayStr[$lang];
|
$tablename = $takeAwayStr[$lang];
|
||||||
} else {
|
} else {
|
||||||
$sql = "SELECT tableno FROM %resttables% WHERE id=?";
|
$sql = "SELECT tableno,%room%.abbreviation FROM %resttables%,%room% WHERE %resttables%.id=? AND %resttables%.roomid=%room%.id";
|
||||||
$stmt = $pdo->prepare(DbUtils::substTableAlias($sql));
|
$stmt = $pdo->prepare(DbUtils::substTableAlias($sql));
|
||||||
$stmt->execute(array($theTableid));
|
$stmt->execute(array($theTableid));
|
||||||
$row = $stmt->fetchObject();
|
$row = $stmt->fetchObject();
|
||||||
|
|
||||||
$tablename = $row->tableno;
|
if (is_null($row->abbreviation)) {
|
||||||
|
$tablename = $row->tableno;
|
||||||
|
} else {
|
||||||
|
$tablename = $row->abbreviation . "-" . $row->tableno;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
PrintQueue::queueWorkPrintJob($pdo, $tablename, $germanTime, $resultarray, $kind, $printer, $user);
|
PrintQueue::queueWorkPrintJob($pdo, $tablename, $germanTime, $resultarray, $kind, $printer, $user);
|
||||||
|
@ -1025,7 +1029,7 @@ class QueueContent {
|
||||||
$extras = $this->getExtrasOfQueueItem($pdo,$anId);
|
$extras = $this->getExtrasOfQueueItem($pdo,$anId);
|
||||||
|
|
||||||
$prodEntry = array(
|
$prodEntry = array(
|
||||||
"queueid" =>$anId,
|
"id" =>$anId,
|
||||||
"longname" => $row->productname,
|
"longname" => $row->productname,
|
||||||
"option" => $row->anoption,
|
"option" => $row->anoption,
|
||||||
"extras" => $extras,
|
"extras" => $extras,
|
||||||
|
@ -1108,6 +1112,7 @@ class QueueContent {
|
||||||
$stmt = $pdo->prepare(DbUtils::substTableAlias($sql));
|
$stmt = $pdo->prepare(DbUtils::substTableAlias($sql));
|
||||||
$stmt->execute();
|
$stmt->execute();
|
||||||
$result = $stmt->fetchAll();
|
$result = $stmt->fetchAll();
|
||||||
|
$prodsToPay = array();
|
||||||
foreach ($result as $zeile) {
|
foreach ($result as $zeile) {
|
||||||
$thePrice = $zeile['price'];
|
$thePrice = $zeile['price'];
|
||||||
$theTax = $zeile['tax'];
|
$theTax = $zeile['tax'];
|
||||||
|
|
|
@ -275,17 +275,21 @@ class Roomtables {
|
||||||
for ($roomindex = 0;$roomindex < $noOfRooms; $roomindex++) {
|
for ($roomindex = 0;$roomindex < $noOfRooms; $roomindex++) {
|
||||||
$aRoom = $rooms[$roomindex];
|
$aRoom = $rooms[$roomindex];
|
||||||
$aRoomName = $aRoom[0];
|
$aRoomName = $aRoom[0];
|
||||||
$roomPrinter = $aRoom[1];
|
$aRoomAbbr = $aRoom[1];
|
||||||
|
if ($aRoomAbbr == "") {
|
||||||
|
$aRoomAbbr = null;
|
||||||
|
}
|
||||||
|
$roomPrinter = $aRoom[2];
|
||||||
if ($roomPrinter == 0) {
|
if ($roomPrinter == 0) {
|
||||||
$roomPrinter = null;
|
$roomPrinter = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
$sql = "INSERT INTO `%room%` (`id`, `roomname`, `printer`) VALUES (NULL,?,?)";
|
$sql = "INSERT INTO `%room%` (`id`, `roomname`, `abbreviation`, `printer`) VALUES (NULL,?,?,?)";
|
||||||
$stmt = $pdo->prepare($this->dbutils->resolveTablenamesInSqlString($sql));
|
$stmt = $pdo->prepare($this->dbutils->resolveTablenamesInSqlString($sql));
|
||||||
$stmt->execute(array($aRoomName,$roomPrinter));
|
$stmt->execute(array($aRoomName,$aRoomAbbr,$roomPrinter));
|
||||||
$roomId = $pdo->lastInsertId();
|
$roomId = $pdo->lastInsertId();
|
||||||
|
|
||||||
$tablesArr = $aRoom[2];
|
$tablesArr = $aRoom[3];
|
||||||
|
|
||||||
$noOfTables = count($tablesArr);
|
$noOfTables = count($tablesArr);
|
||||||
for ($tableindex = 0; $tableindex < $noOfTables; $tableindex++) {
|
for ($tableindex = 0; $tableindex < $noOfTables; $tableindex++) {
|
||||||
|
@ -302,7 +306,7 @@ class Roomtables {
|
||||||
function getRoomfield() {
|
function getRoomfield() {
|
||||||
$pdo = $this->dbutils->openDbAndReturnPdo();
|
$pdo = $this->dbutils->openDbAndReturnPdo();
|
||||||
|
|
||||||
$sql = "SELECT id,roomname,IFNULL(printer,0) as printer FROM %room% WHERE removed is null ORDER BY 'sorting'";
|
$sql = "SELECT id,roomname,IFNULL(abbreviation,'') as abbreviation,IFNULL(printer,0) as printer FROM %room% WHERE removed is null ORDER BY 'sorting'";
|
||||||
$stmt = $pdo->prepare($this->dbutils->resolveTablenamesInSqlString($sql));
|
$stmt = $pdo->prepare($this->dbutils->resolveTablenamesInSqlString($sql));
|
||||||
$stmt->execute();
|
$stmt->execute();
|
||||||
$result = $stmt->fetchAll();
|
$result = $stmt->fetchAll();
|
||||||
|
@ -315,6 +319,7 @@ class Roomtables {
|
||||||
foreach($result as $row) {
|
foreach($result as $row) {
|
||||||
$roomid = $row['id'];
|
$roomid = $row['id'];
|
||||||
$roomname = $row['roomname'];
|
$roomname = $row['roomname'];
|
||||||
|
$abbreviation = $row['abbreviation'];
|
||||||
$printer = $row['printer'];
|
$printer = $row['printer'];
|
||||||
|
|
||||||
// now get the tables of this room
|
// now get the tables of this room
|
||||||
|
@ -329,7 +334,7 @@ class Roomtables {
|
||||||
foreach($tableresult as $aTable) {
|
foreach($tableresult as $aTable) {
|
||||||
$tableArr[] = array("id" => $aTable['id'], "tablename" => $aTable['tableno']);
|
$tableArr[] = array("id" => $aTable['id'], "tablename" => $aTable['tableno']);
|
||||||
}
|
}
|
||||||
$roomArr[] = array("roomid" => $roomid, "roomname" => $roomname, "printer" => $printer, "tables" => $tableArr, "noOfTables" => $numberOfTables);
|
$roomArr[] = array("roomid" => $roomid, "roomname" => $roomname, "abbreviation" => $abbreviation, "printer" => $printer, "tables" => $tableArr, "noOfTables" => $numberOfTables);
|
||||||
}
|
}
|
||||||
|
|
||||||
echo json_encode(array("status" => "OK", "noOfRooms" => $numberOfRooms, "maxTables" => $maxTables, "roomfield" => $roomArr));
|
echo json_encode(array("status" => "OK", "noOfRooms" => $numberOfRooms, "maxTables" => $maxTables, "roomfield" => $roomArr));
|
||||||
|
|
|
@ -243,6 +243,7 @@ class Basedb {
|
||||||
CREATE TABLE `%room%` (
|
CREATE TABLE `%room%` (
|
||||||
`id` INT (10) NOT NULL AUTO_INCREMENT PRIMARY KEY ,
|
`id` INT (10) NOT NULL AUTO_INCREMENT PRIMARY KEY ,
|
||||||
`roomname` VARCHAR ( 150 ) NOT NULL,
|
`roomname` VARCHAR ( 150 ) NOT NULL,
|
||||||
|
`abbreviation` VARCHAR (10) NULL,
|
||||||
`printer` INT(2) NULL,
|
`printer` INT(2) NULL,
|
||||||
`removed` INT(2) NULL,
|
`removed` INT(2) NULL,
|
||||||
`sorting` INT(2) NULL
|
`sorting` INT(2) NULL
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
<meta http-equiv="content-type" content="text/html; charset=utf-8">
|
<meta http-equiv="content-type" content="text/html; charset=utf-8">
|
||||||
<meta name="author" content="Stefan Pichel">
|
<meta name="author" content="Stefan Pichel">
|
||||||
|
|
||||||
<link rel="stylesheet" type="text/css" href="css/bestformat.css?v=1.1.11">
|
<link rel="stylesheet" type="text/css" href="css/bestformat.css?v=1.1.12">
|
||||||
|
|
||||||
<link rel="stylesheet" href="php/3rdparty/orderstyle/orderstyle.min.css" />
|
<link rel="stylesheet" href="php/3rdparty/orderstyle/orderstyle.min.css" />
|
||||||
<link rel="stylesheet" href="php/3rdparty/orderstyle/jquery.mobile.icons.min.css" />
|
<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 http-equiv="content-type" content="text/html; charset=utf-8">
|
||||||
<meta name="author" content="Stefan Pichel">
|
<meta name="author" content="Stefan Pichel">
|
||||||
|
|
||||||
<link rel="stylesheet" type="text/css" href="css/bestformat.css?v=1.1.11">
|
<link rel="stylesheet" type="text/css" href="css/bestformat.css?v=1.1.12">
|
||||||
<link rel="stylesheet" href="php/3rdparty/orderstyle/orderstyle.min.css" />
|
<link rel="stylesheet" href="php/3rdparty/orderstyle/orderstyle.min.css" />
|
||||||
<link rel="stylesheet" href="php/3rdparty/orderstyle/jquery.mobile.icons.min.css" />
|
<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 http-equiv="content-type" content="text/html; charset=utf-8">
|
||||||
<meta name="author" content="Stefan Pichel">
|
<meta name="author" content="Stefan Pichel">
|
||||||
|
|
||||||
<link rel="stylesheet" type="text/css" href="css/bestformat.css?v=1.1.11">
|
<link rel="stylesheet" type="text/css" href="css/bestformat.css?v=1.1.12">
|
||||||
<link rel="stylesheet" href="php/3rdparty/orderstyle/orderstyle.min.css" />
|
<link rel="stylesheet" href="php/3rdparty/orderstyle/orderstyle.min.css" />
|
||||||
<link rel="stylesheet" href="php/3rdparty/orderstyle/jquery.mobile.icons.min.css" />
|
<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 http-equiv="content-type" content="text/html; charset=utf-8">
|
||||||
<meta name="author" content="Stefan Pichel">
|
<meta name="author" content="Stefan Pichel">
|
||||||
|
|
||||||
<link rel="stylesheet" type="text/css" href="css/bestformat.css?v=1.1.11">
|
<link rel="stylesheet" type="text/css" href="css/bestformat.css?v=1.1.12">
|
||||||
<link rel="stylesheet" href="php/3rdparty/orderstyle/orderstyle.min.css" />
|
<link rel="stylesheet" href="php/3rdparty/orderstyle/orderstyle.min.css" />
|
||||||
<link rel="stylesheet" href="php/3rdparty/orderstyle/jquery.mobile.icons.min.css" />
|
<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 name="viewport" content="width=device-width, initial-scale=1">
|
||||||
<meta http-equiv="content-type" content="text/html; charset=utf-8">
|
<meta http-equiv="content-type" content="text/html; charset=utf-8">
|
||||||
<meta name="author" content="Stefan Pichel">
|
<meta name="author" content="Stefan Pichel">
|
||||||
<link rel="stylesheet" type="text/css" href="css/bestformat.css?v=1.1.11">
|
<link rel="stylesheet" type="text/css" href="css/bestformat.css?v=1.1.12">
|
||||||
<link rel="stylesheet" href="php/3rdparty/orderstyle/orderstyle.min.css" />
|
<link rel="stylesheet" href="php/3rdparty/orderstyle/orderstyle.min.css" />
|
||||||
<link rel="stylesheet" href="php/3rdparty/orderstyle/jquery.mobile.icons.min.css" />
|
<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 http-equiv="content-type" content="text/html; charset=utf-8">
|
||||||
<meta name="author" content="Stefan Pichel">
|
<meta name="author" content="Stefan Pichel">
|
||||||
|
|
||||||
<link rel="stylesheet" type="text/css" href="css/bestformat.css?v=1.1.11">
|
<link rel="stylesheet" type="text/css" href="css/bestformat.css?v=1.1.12">
|
||||||
|
|
||||||
<link rel="stylesheet" href="php/3rdparty/orderstyle/orderstyle.min.css" />
|
<link rel="stylesheet" href="php/3rdparty/orderstyle/orderstyle.min.css" />
|
||||||
<link rel="stylesheet" href="php/3rdparty/orderstyle/jquery.mobile.icons.min.css" />
|
<link rel="stylesheet" href="php/3rdparty/orderstyle/jquery.mobile.icons.min.css" />
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||||
<meta http-equiv="content-type" content="text/html; charset=utf-8">
|
<meta http-equiv="content-type" content="text/html; charset=utf-8">
|
||||||
<meta name="author" content="Stefan Pichel">
|
<meta name="author" content="Stefan Pichel">
|
||||||
<link rel="stylesheet" type="text/css" href="css/bestformat.css?v=1.1.11">
|
<link rel="stylesheet" type="text/css" href="css/bestformat.css?v=1.1.12">
|
||||||
<link rel="stylesheet" href="php/3rdparty/orderstyle/orderstyle.min.css" />
|
<link rel="stylesheet" href="php/3rdparty/orderstyle/orderstyle.min.css" />
|
||||||
<link rel="stylesheet" href="php/3rdparty/orderstyle/jquery.mobile.icons.min.css" />
|
<link rel="stylesheet" href="php/3rdparty/orderstyle/jquery.mobile.icons.min.css" />
|
||||||
|
|
||||||
|
@ -81,6 +81,103 @@ var W_UNDELIVERED = ["nicht serviert (+ unbezahlt)","not served (and unpaid)","n
|
||||||
var W_MOVE_PRODS = ["Produkte verschieben","Move products","Productos a otra mesa"];
|
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_NO_PRODS_SELECTED = ["Es wurden keine Produkte ausgewählt!","You have not chosen any products!","No ha seleccionado ningún producto!"];
|
||||||
|
|
||||||
|
function Grouping(set,hashFct) {
|
||||||
|
// initialization during construction of class
|
||||||
|
this.set = set;
|
||||||
|
|
||||||
|
// setting by group()
|
||||||
|
this.sortedset = [];
|
||||||
|
|
||||||
|
this.group = function() {
|
||||||
|
this.sortedset = [];
|
||||||
|
for (var i=0;i<this.set.length;i++) {
|
||||||
|
var anEntry = this.set[i];
|
||||||
|
|
||||||
|
if (this.sortedset.length == 0) {
|
||||||
|
// new value
|
||||||
|
anEntry["count"] = 1;
|
||||||
|
anEntry["ids"] = [ anEntry["id"]];
|
||||||
|
this.sortedset[this.sortedset.length] = anEntry;
|
||||||
|
} else {
|
||||||
|
// check if the entry must be added to an existing entry
|
||||||
|
var hashOfValueToInsert = hashFct(anEntry);
|
||||||
|
var found = false;
|
||||||
|
for (j=0;j<this.sortedset.length;j++) {
|
||||||
|
var existingVal = this.sortedset[j];
|
||||||
|
var hashOfExistingValue = hashFct(existingVal);
|
||||||
|
|
||||||
|
if (hashOfValueToInsert == hashOfExistingValue) {
|
||||||
|
existingVal["count"] = existingVal["count"] + 1;
|
||||||
|
// now add the id
|
||||||
|
var ids = existingVal["ids"];
|
||||||
|
ids[ids.length] = anEntry["id"];
|
||||||
|
found = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!found) {
|
||||||
|
// new value
|
||||||
|
anEntry["count"] = 1;
|
||||||
|
anEntry["ids"] = [ anEntry["id"]];
|
||||||
|
this.sortedset[this.sortedset.length] = anEntry;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
this.outputList = function(outputFct) {
|
||||||
|
var txt = "";
|
||||||
|
for (var i=0;i<this.sortedset.length;i++) {
|
||||||
|
var anEntry = this.sortedset[i];
|
||||||
|
txt += outputFct(anEntry);
|
||||||
|
}
|
||||||
|
return txt;
|
||||||
|
}
|
||||||
|
|
||||||
|
this.getItemsOfRow = function(rowId) {
|
||||||
|
var anEntrySet = this.sortedset[rowId];
|
||||||
|
var ids = anEntrySet["ids"];
|
||||||
|
var items = [];
|
||||||
|
for (var j=0;j<ids.length;j++) {
|
||||||
|
var anId = ids[j];
|
||||||
|
for (var i=0;i<this.set.length;i++) {
|
||||||
|
var anEntry = this.set[i];
|
||||||
|
if (anEntry.id==anId) {
|
||||||
|
items[items.length] = anEntry;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return items;
|
||||||
|
}
|
||||||
|
|
||||||
|
this.popSortedEntry = function(rowId) {
|
||||||
|
var anEntry = this.sortedset[rowId];
|
||||||
|
var ids = anEntry["ids"];
|
||||||
|
var id = ids.pop();
|
||||||
|
var aSetEntry = this.popSetEntry(id);
|
||||||
|
this.group();
|
||||||
|
return aSetEntry;
|
||||||
|
}
|
||||||
|
|
||||||
|
this.popSetEntry = function(id) {
|
||||||
|
for (var i=0;i<this.set.length;i++) {
|
||||||
|
var anEntry = this.set[i];
|
||||||
|
if (anEntry.id==id) {
|
||||||
|
this.set.splice(i,1);
|
||||||
|
return anEntry;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
this.getSourceSet = function() {
|
||||||
|
return this.set;
|
||||||
|
}
|
||||||
|
|
||||||
|
this.getGroupedList = function() {
|
||||||
|
return this.sortedset;
|
||||||
|
}
|
||||||
|
}
|
||||||
var lang = 0;
|
var lang = 0;
|
||||||
|
|
||||||
var nextPage = "";
|
var nextPage = "";
|
||||||
|
@ -638,12 +735,11 @@ function removeProductFromQueue(queueid,isPaid,isCooking,isReady) {
|
||||||
success : function(text) {
|
success : function(text) {
|
||||||
if (text.status != "OK") {
|
if (text.status != "OK") {
|
||||||
alert (W_REMOVE_ERROR[lang]);
|
alert (W_REMOVE_ERROR[lang]);
|
||||||
var roomtable_info = $(this).data("table-info");
|
|
||||||
var tableid = roomtable_info[1];
|
|
||||||
var urlProdOfTableNotDelivered = "php/contenthandler.php?module=queue&command=getJsonLongNamesOfProdsForTableNotDelivered&" + "tableid=" + tableid;
|
|
||||||
var prodListToFill = "#orderedprod-list-0";
|
|
||||||
fillNotDeliveredProductsOfATable(urlProdOfTableNotDelivered,prodListToFill);
|
|
||||||
}
|
}
|
||||||
|
var roominfo = $("#typprodpage").data("table-info");
|
||||||
|
var tableid = roominfo[1];
|
||||||
|
var urlProdOfTableNotDelivered = "php/contenthandler.php?module=queue&command=getJsonLongNamesOfProdsForTableNotDelivered&" + "tableid=" + tableid;
|
||||||
|
fillNotDeliveredProductsOfATable(urlProdOfTableNotDelivered);
|
||||||
},
|
},
|
||||||
error: function( text ) {
|
error: function( text ) {
|
||||||
alert( "Sorry, Fehler bei Produktentfernung!" );
|
alert( "Sorry, Fehler bei Produktentfernung!" );
|
||||||
|
@ -1483,10 +1579,8 @@ function addProductToNewOrdersList(prodid,extras) {
|
||||||
document.getElementById('audiofile').play();
|
document.getElementById('audiofile').play();
|
||||||
}
|
}
|
||||||
|
|
||||||
var urlProdOfTableNotDelivered = "php/contenthandler.php?module=queue&command=getJsonLongNamesOfProdsForTableNotDelivered&"
|
var urlProdOfTableNotDelivered = "php/contenthandler.php?module=queue&command=getJsonLongNamesOfProdsForTableNotDelivered&tableid=" + tableid;
|
||||||
+ "tableid=" + tableid;
|
fillNotDeliveredProductsOfATable(urlProdOfTableNotDelivered);
|
||||||
var prodListToFill = "#orderedprod-list-0";
|
|
||||||
fillNotDeliveredProductsOfATable(urlProdOfTableNotDelivered,prodListToFill);
|
|
||||||
|
|
||||||
if (keeptypelevel == 0) {
|
if (keeptypelevel == 0) {
|
||||||
displayTypesProds(levelOneType,null);
|
displayTypesProds(levelOneType,null);
|
||||||
|
@ -1521,106 +1615,131 @@ function fillTypeProdList_(ref) {
|
||||||
displayTypesProds(ref,null);
|
displayTypesProds(ref,null);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function createTxtAssignedProd(p) {
|
||||||
|
var optiontext = "";
|
||||||
|
if (p.option != '') {
|
||||||
|
optiontext = " (" + toHtml(p.option) + ")";
|
||||||
|
}
|
||||||
|
|
||||||
|
var status = "";
|
||||||
|
if (p.isready == '1') {
|
||||||
|
status += " ☞";
|
||||||
|
}
|
||||||
|
if (p.isCooking == '1') {
|
||||||
|
status += " ♨";
|
||||||
|
}
|
||||||
|
if (p.isPaid == '1') {
|
||||||
|
status += " ☑";
|
||||||
|
}
|
||||||
|
|
||||||
|
return toHtml(p.longname) + optiontext + status + "<br>" + createExtraParagraph(p.extras);
|
||||||
|
}
|
||||||
|
|
||||||
function fillNotDeliveredProductsOfATable(urlProdOfTableNotDelivered,prodListToFill) {
|
|
||||||
$.getJSON(urlProdOfTableNotDelivered,function(prodOfTable) {
|
function createListElOfAssignedProd(aProd) {
|
||||||
|
var count = "";
|
||||||
if (prodOfTable.length > 0) {
|
if("count" in aProd) {
|
||||||
notDeliveredProdsAvailable = true;
|
if (aProd["count"] > 1) {
|
||||||
} else {
|
count = aProd["count"] + "x ";
|
||||||
notDeliveredProdsAvailable = false;
|
}
|
||||||
}
|
}
|
||||||
var li = "<li data-role=\"list-divider\" data-theme=\"b\" data-role=\"heading\" id='undeliveredheader'>" + W_KIT_BAR[lang] + "</li>";
|
if (aProd.isready == '0') {
|
||||||
$.each(prodOfTable, function (i, name) {
|
return '<li data-theme="c" data-icon="delete" class="notdelprod"><a href="#" >' + count + createTxtAssignedProd(aProd) + '</a></li>';
|
||||||
var optiontext = "";
|
} else {
|
||||||
if (name.option != '') {
|
return '<li data-theme="f" data-icon="delete" class="notdelprod"><a href="#" >' + count + createTxtAssignedProd(aProd) + '</a></li>';
|
||||||
optiontext = " (" + toHtml(name.option) + ")";
|
}
|
||||||
}
|
}
|
||||||
if (name.isready == '0') {
|
|
||||||
li += '<li data-theme="c" data-icon="delete" class="notdelprod"><a href="#" id="' + i + '">' + toHtml(name.longname) + optiontext + '</a></li>';
|
function fillAssignedProdList(assignedProds) {
|
||||||
} else {
|
if (assignedProds.length > 0) {
|
||||||
li += '<li data-theme="f" data-icon="delete" class="notdelprod"><a href="#" id="' + i + '">' + toHtml(name.longname) + optiontext + '</a></li>';
|
notDeliveredProdsAvailable = true;
|
||||||
}
|
} else {
|
||||||
});
|
notDeliveredProdsAvailable = false;
|
||||||
|
}
|
||||||
$("#cancelcodefield").val("");
|
|
||||||
if (cancelunpaidcode != "") {
|
$("#cancelcodefield").val("");
|
||||||
if (prodOfTable.length > 0) {
|
if (cancelunpaidcode != "") {
|
||||||
$("#cancelcodearea").show();
|
if (assignedProds.length > 0) {
|
||||||
} else {
|
$("#cancelcodearea").show();
|
||||||
$("#cancelcodearea").hide();
|
} else {
|
||||||
}
|
$("#cancelcodearea").hide();
|
||||||
} else {
|
}
|
||||||
$("#cancelcodearea").hide();
|
} else {
|
||||||
}
|
$("#cancelcodearea").hide();
|
||||||
|
}
|
||||||
$(prodListToFill).empty().append(li).promise().done(function () {
|
|
||||||
|
var assignedProdsGrouping = new Grouping(assignedProds,createTxtAssignedProd);
|
||||||
$("#undeliveredheader").off("click").on("click", function (e) {
|
assignedProdsGrouping.group();
|
||||||
e.stopImmediatePropagation();
|
|
||||||
e.preventDefault();
|
var listContent = "<li data-role=\"list-divider\" data-theme=\"b\" data-role=\"heading\" id='undeliveredheader'>" + W_KIT_BAR[lang] + "</li>";
|
||||||
alert(W_UNDELIV_INFO[lang]);
|
listContent += assignedProdsGrouping.outputList(createListElOfAssignedProd);
|
||||||
});
|
$("#orderedprod-list-0").html(listContent);
|
||||||
|
refreshList("#orderedprod-list-0");
|
||||||
// now set as data the queueid
|
|
||||||
var index=0;
|
$("#undeliveredheader").off("click").on("click", function (e) {
|
||||||
$(".notdelprod").each(function() {
|
e.stopImmediatePropagation();
|
||||||
$(this).data("queueid",prodOfTable[index].queueid);
|
e.preventDefault();
|
||||||
index++;
|
alert(W_UNDELIV_INFO[lang]);
|
||||||
});
|
});
|
||||||
|
|
||||||
$(this).off("click").on("click", "a", function (e) {
|
bindingOfAssignedProds(assignedProdsGrouping);
|
||||||
e.stopImmediatePropagation();
|
}
|
||||||
e.preventDefault();
|
|
||||||
|
function bindingOfAssignedProds(assignedProdsGrouping) {
|
||||||
if (cancelunpaidcode != "") {
|
$(".notdelprod").off("click").on("click", "a", function (e) {
|
||||||
if ($("#cancelcodefield").val() != cancelunpaidcode) {
|
e.stopImmediatePropagation();
|
||||||
alert(W_WRONG_PIN[lang]);
|
e.preventDefault();
|
||||||
return;
|
|
||||||
}
|
if (cancelunpaidcode != "") {
|
||||||
}
|
if ($("#cancelcodefield").val() != cancelunpaidcode) {
|
||||||
|
alert(W_WRONG_PIN[lang]);
|
||||||
var isReady = prodOfTable[this.id]["isready"];
|
return;
|
||||||
var isPaid = prodOfTable[this.id]["isPaid"];
|
}
|
||||||
var isCooking = prodOfTable[this.id]["isCooking"];
|
}
|
||||||
|
|
||||||
if ((isPaid == "1") && (isReady=="1")) {
|
var listItem = $(this).closest("li");
|
||||||
var dialogText = "Entfernen?";
|
var rowIndex = $( "#orderedprod-list-0 li" ).index(listItem) - 1;
|
||||||
var this_elem = this;
|
var rowEntries = assignedProdsGrouping.getItemsOfRow(rowIndex);
|
||||||
areYouSure("Produkt wurde schon zubereitet und bezahlt", dialogText, "Ja", function() {
|
var anEntry = rowEntries[0];
|
||||||
removeProductFromQueue(prodOfTable[this_elem.id]["queueid"],isPaid,isCooking,isReady);
|
var queueid = anEntry.id;
|
||||||
fillNotDeliveredProductsOfATable(urlProdOfTableNotDelivered,prodListToFill);
|
|
||||||
});
|
var isReady = anEntry.isready;
|
||||||
} else if (isReady=="1") {
|
var isPaid = anEntry.isPaid;
|
||||||
var dialogText = "Entfernen?";
|
var isCooking = anEntry.isCooking;
|
||||||
var this_elem = this;
|
|
||||||
areYouSure("Produkt wurde schon zubereitet.", dialogText, "Ja", function() {
|
if ((isPaid == "1") && (isReady=="1")) {
|
||||||
removeProductFromQueue(prodOfTable[this_elem.id]["queueid"],isPaid,isCooking,isReady);
|
var dialogText = "Entfernen?";
|
||||||
fillNotDeliveredProductsOfATable(urlProdOfTableNotDelivered,prodListToFill);
|
var this_elem = this;
|
||||||
});
|
areYouSure("Produkt wurde schon zubereitet und bezahlt", dialogText, "Ja", function() {
|
||||||
} else if (isPaid == "1") {
|
removeProductFromQueue(queueid,isPaid,isCooking,isReady);
|
||||||
var dialogText = "Entfernen?";
|
});
|
||||||
var this_elem = this;
|
} else if (isReady=="1") {
|
||||||
areYouSure("Produkt wurde schon bezahlt.", dialogText, "Ja", function() {
|
var dialogText = "Entfernen?";
|
||||||
removeProductFromQueue(prodOfTable[this_elem.id]["queueid"],isPaid,isCooking,isReady);
|
var this_elem = this;
|
||||||
fillNotDeliveredProductsOfATable(urlProdOfTableNotDelivered,prodListToFill);
|
areYouSure("Produkt wurde schon zubereitet.", dialogText, "Ja", function() {
|
||||||
});
|
removeProductFromQueue(queueid,isPaid,isCooking,isReady);
|
||||||
} else if (isCooking == "1") {
|
|
||||||
var dialogText = "Entfernen?";
|
|
||||||
var this_elem = this;
|
|
||||||
areYouSure("Produkt wird soeben zubereitet.", dialogText, "Ja", function() {
|
|
||||||
removeProductFromQueue(prodOfTable[this_elem.id]["queueid"],isPaid,isCooking,isReady);
|
|
||||||
fillNotDeliveredProductsOfATable(urlProdOfTableNotDelivered,prodListToFill);
|
|
||||||
});
|
|
||||||
|
|
||||||
} else {
|
|
||||||
removeProductFromQueue(prodOfTable[this.id]["queueid"],isPaid,isCooking,isReady);
|
|
||||||
fillNotDeliveredProductsOfATable(urlProdOfTableNotDelivered,prodListToFill);
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
refreshList(this);
|
} else if (isPaid == "1") {
|
||||||
});
|
var dialogText = "Entfernen?";
|
||||||
}); // ende json call
|
var this_elem = this;
|
||||||
|
areYouSure("Produkt wurde schon bezahlt.", dialogText, "Ja", function() {
|
||||||
|
removeProductFromQueue(queueid,isPaid,isCooking,isReady);
|
||||||
|
});
|
||||||
|
} else if (isCooking == "1") {
|
||||||
|
var dialogText = "Entfernen?";
|
||||||
|
var this_elem = this;
|
||||||
|
areYouSure("Produkt wird soeben zubereitet.", dialogText, "Ja", function() {
|
||||||
|
removeProductFromQueue(queueid,isPaid,isCooking,isReady);
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
removeProductFromQueue(queueid,isPaid,isCooking,isReady);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
function fillNotDeliveredProductsOfATable(urlProdOfTableNotDelivered) {
|
||||||
|
doJsonAjaxAsync("GET", urlProdOfTableNotDelivered, null, fillAssignedProdList);
|
||||||
}
|
}
|
||||||
|
|
||||||
function fillOrderVolume(volume) {
|
function fillOrderVolume(volume) {
|
||||||
|
@ -1669,11 +1788,9 @@ $(document).on("pagebeforeshow", "#typprodpage", function () {
|
||||||
fillTypeProdList(0);
|
fillTypeProdList(0);
|
||||||
|
|
||||||
// now the products that are assigned to table but yet not delivered
|
// now the products that are assigned to table but yet not delivered
|
||||||
var urlProdOfTableNotDelivered = "php/contenthandler.php?module=queue&command=getJsonLongNamesOfProdsForTableNotDelivered&"
|
var urlProdOfTableNotDelivered = "php/contenthandler.php?module=queue&command=getJsonLongNamesOfProdsForTableNotDelivered&tableid=" + tableid;
|
||||||
+ "tableid=" + tableid;
|
|
||||||
|
|
||||||
var prodListToFill = "#orderedprod-list-0";
|
fillNotDeliveredProductsOfATable(urlProdOfTableNotDelivered);
|
||||||
fillNotDeliveredProductsOfATable(urlProdOfTableNotDelivered,prodListToFill);
|
|
||||||
|
|
||||||
$("#workprint_btn").data("tableid",tableid);
|
$("#workprint_btn").data("tableid",tableid);
|
||||||
$("#gopaydesk_btn").data("tableid",tableid);
|
$("#gopaydesk_btn").data("tableid",tableid);
|
||||||
|
@ -1998,8 +2115,7 @@ function bindSendNewOrdersButton() {
|
||||||
var urlProdOfTableNotDelivered = "php/contenthandler.php?module=queue&command=getJsonLongNamesOfProdsForTableNotDelivered&"
|
var urlProdOfTableNotDelivered = "php/contenthandler.php?module=queue&command=getJsonLongNamesOfProdsForTableNotDelivered&"
|
||||||
+ "tableid=" + tableid;
|
+ "tableid=" + tableid;
|
||||||
var prodListToFill = "#orderedprod-list-0";
|
var prodListToFill = "#orderedprod-list-0";
|
||||||
fillNotDeliveredProductsOfATable(urlProdOfTableNotDelivered,
|
fillNotDeliveredProductsOfATable(urlProdOfTableNotDelivered);
|
||||||
prodListToFill);
|
|
||||||
}
|
}
|
||||||
function doJsonAjax(getOrPost, url, data, functionToCallIfSuccess, errorMsg) {
|
function doJsonAjax(getOrPost, url, data, functionToCallIfSuccess, errorMsg) {
|
||||||
$.ajax({
|
$.ajax({
|
||||||
|
|
Loading…
Reference in New Issue