OrderSprinter 1.4.1

This commit is contained in:
Geno 2020-11-19 23:10:09 +01:00
parent 73883ee35b
commit e2ffab3466
31 changed files with 144 additions and 93 deletions

View File

@ -9,8 +9,8 @@
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<meta name="author" content="Stefan Pichel">
<link rel="stylesheet" href="css/gueststyle.css?v=1.4.0" />
<link rel="stylesheet" href="php/3rdparty/orderstyle/orderstyle.min.css?v=1.4.0" />
<link rel="stylesheet" href="css/gueststyle.css?v=1.4.1" />
<link rel="stylesheet" href="php/3rdparty/orderstyle/orderstyle.min.css?v=1.4.1" />
<link rel="stylesheet" href="php/3rdparty/orderstyle/jquery.mobile.icons.min.css" />
<link rel="stylesheet" href="php/3rdparty/jquery.mobile-1.4.0.min.css" type="text/css" />
<script src="php/3rdparty/jquery-1.11.3.min.js"></script>
@ -98,7 +98,7 @@
<div data-role="footer" data-theme="b" id="thefooter1">
<div class="ui-grid-a">
<div class="ui-block-a">&nbsp;&nbsp;OrderSprinter</div>
<div class="ui-block-b grid_right" id="versioninfo">1.4.0&nbsp;&nbsp;</div>
<div class="ui-block-b grid_right" id="versioninfo">1.4.1&nbsp;&nbsp;</div>
</div><!-- /grid-a -->
</div>
</div>

View File

@ -90,10 +90,10 @@ if (isset($_POST['code'])) {
} else {
echo "<html>";
echo "<head><title>Installation Gastsystem</title>";
echo '<link rel="stylesheet" type="text/css" href="css/gueststyle.css?v=1.4.0">';
echo '<link rel="stylesheet" type="text/css" href="css/gueststyle.css?v=1.4.1">';
echo "</head>";
echo "<body><div class=surround>";
echo "<span class=headerline>Installation OrderSprinter-Gastsystem 1.4.0</span><br><br>";
echo "<span class=headerline>Installation OrderSprinter-Gastsystem 1.4.1</span><br><br>";
echo "<form action='install.php' method='post'><input class=installfield name=code id=code type=text placeholder='Installationscode' />";
echo "<br><input type=submit value='Installation starten' class=installbtn />";
echo "</form></div></html>";

View File

@ -85,7 +85,7 @@ class Installer {
}
Database::dropTables($pdo);
Database::createEmptyTables($pdo, $prefix);
Database::setVersion($pdo,$prefix,"1.4.0");
Database::setVersion($pdo,$prefix,"1.4.1");
Database::setAccessPassword($pdo,$prefix,$adminpass);
Database::setRefreshRate($pdo,$prefix,"5"); // default: 5 times per hour
return array("status" => "OK","msg" => "Installation successful");

Binary file not shown.

View File

@ -5,7 +5,7 @@
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<meta name="author" content="Stefan Pichel">
<link rel="stylesheet" type="text/css" href="css/bestformat.css?v=1.4.0">
<link rel="stylesheet" type="text/css" href="css/bestformat.css?v=1.4.1">
<link rel="stylesheet" href="php/contenthandler.php?module=admin&command=getmobilecss" />
<link rel="stylesheet" href="php/3rdparty/orderstyle/jquery.mobile.icons.min.css" />

View File

@ -5,7 +5,7 @@
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<meta name="author" content="Stefan Pichel">
<link rel="stylesheet" type="text/css" href="css/bestformat.css?v=1.4.0">
<link rel="stylesheet" type="text/css" href="css/bestformat.css?v=1.4.1">
<link rel="stylesheet" href="php/contenthandler.php?module=admin&command=getmobilecss" />
<link rel="stylesheet" href="php/3rdparty/orderstyle/jquery.mobile.icons.min.css" />
@ -334,7 +334,7 @@ function getBillWithId(id) {
for (var i=0;i<bills.length;i++) {
if (bills[i].id == id) {
entry = bills[i];
break
break;
}
}

View File

@ -4,7 +4,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<link rel="stylesheet" type="text/css" href="css/bestformat.css?v=1.4.0">
<link rel="stylesheet" type="text/css" href="css/bestformat.css?v=1.4.1">
<link rel="stylesheet" href="php/contenthandler.php?module=admin&command=getmobilecss" />
<link rel="stylesheet" href="php/3rdparty/orderstyle/jquery.mobile.icons.min.css" />

View File

@ -9,8 +9,8 @@
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<meta name="author" content="Stefan Pichel">
<link rel="stylesheet" type="text/css" href="css/bestformat.css?v=1.4.0">
<link rel="stylesheet" type="text/css" href="css/numfield.css?v=1.4.0">
<link rel="stylesheet" type="text/css" href="css/bestformat.css?v=1.4.1">
<link rel="stylesheet" type="text/css" href="css/numfield.css?v=1.4.1">
<link rel="stylesheet" href="php/3rdparty/orderstyle/orderstyle.min.css" />
<link rel="stylesheet" href="php/3rdparty/orderstyle/jquery.mobile.icons.min.css" />
@ -215,7 +215,7 @@ function handleResultOfInstallCheck(is_installed) {
if (is_installed == "Yes") {
useInstallation();
} else {
setTimeout(function(){document.location.href = "install.html?v=1.4.0"},500);
setTimeout(function(){document.location.href = "install.html?v=1.4.1"},500);
}
}

View File

@ -727,7 +727,7 @@ $(document).ready(function() {
<tr id=updateline>
<td>&nbsp;</td>
<td align=center>
<button id="updatebtn">Update -> 1.4.0</button>
<button id="updatebtn">Update -> 1.4.1</button>
<span id="updateinprogresstxt" style="display:none;">Update... bitte warten.</span>
</td>
<td>&nbsp;</td>

View File

@ -2621,7 +2621,7 @@ $stmt->execute(array(null));
$sql = "OPTIMIZE TABLE %user%";
$stmt = $pdo->prepare($this->basedb->resolveTablenamesInSqlString($sql));
$stmt->execute(array(null));
$stmt->execute();
}
$this->updateVersion($pdo, '1.3.23');
@ -2760,6 +2760,38 @@ return false;
}
}
function updateUserTable1400_1401($prefix, $version, $dbname) {
$pdo = $this->pdo;
try {
if ($version != "1.4.0") {
$ret = $this->updateUserTable1326_1400($prefix, $version, $dbname);
if (!$ret) {
echo "Version update v1.3.26 to 1.4.0 not successful.";
return false;
}
}
DbUtils::overrulePrefix($prefix);
$sql = "ALTER TABLE %bill% MODIFY netto DECIMAL (17,6) NULL";
$stmt = $pdo->prepare(DbUtils::substTableAlias($sql));
$stmt->execute();
$this->updateNettoValuesOfBill($pdo);
$sql = "OPTIMIZE TABLE %bill%";
$stmt = $pdo->prepare($this->basedb->resolveTablenamesInSqlString($sql));
$stmt->execute();
$this->updateVersion($pdo, '1.4.1');
return true;
} catch (PDOException $e) {
echo "Error in v1.4.0 to 1.4.1: $e";
return false;
}
}
function insertIntRow($pdo,$table,$rowToInsert,$afterRow) {
$this->insertTypeRow($pdo, $table, $rowToInsert, $afterRow, 'INT(1) NULL');
}
@ -2840,6 +2872,19 @@ $rect .= "s: zu storn. Arb.bon: ;q:v\n";
return $rect;
}
function updateNettoValuesOfBill($pdo) {
$sql = "SELECT %bill%.id as billid,IF(status='s',-1,1)*ROUND(SUM(price/(1 + %queue%.tax/100.0)),6) as netto FROM %queue%,%billproducts%,%bill% WHERE %billproducts%.billid=%bill%.id AND %billproducts%.queueid=%queue%.id AND (status is null OR status=? OR status=?) GROUP by billid";
$stmt = $pdo->prepare(DbUtils::substTableAlias($sql));
$stmt->execute(array('x','s'));
$result = $stmt->fetchAll(PDO::FETCH_ASSOC);
$sql = "UPDATE %bill% SET netto=? WHERE id=?";
$stmt = $pdo->prepare(DbUtils::substTableAlias($sql));
foreach($result as $r) {
$stmt->execute(array($r["netto"],$r["billid"]));
}
}
function createTables($decpoint,$billlanguage,$currency,$timezone)
{
$pdo = $this->pdo;
@ -2922,7 +2967,7 @@ $this->basedb->doSQL($pdo,"INSERT INTO `%config%` (`id` , `name`, `setting`) VAL
$this->basedb->doSQL($pdo,"INSERT INTO `%config%` (`id` , `name`, `setting`) VALUES (NULL , 'billlanguage', $billlanguage)");
$this->basedb->doSQL($pdo,"INSERT INTO `%config%` (`id` , `name`, `setting`) VALUES (NULL , 'currency', '$currency')");
$this->basedb->doSQL($pdo,"INSERT INTO `%config%` (`id` , `name`, `setting`) VALUES (NULL , 'receiptfontsize', '12')");
$this->basedb->doSQL($pdo,"INSERT INTO `%config%` (`id` , `name`, `setting`) VALUES (NULL , 'version', '1.4.0')");
$this->basedb->doSQL($pdo,"INSERT INTO `%config%` (`id` , `name`, `setting`) VALUES (NULL , 'version', '1.4.1')");
$this->basedb->doSQL($pdo,"INSERT INTO `%config%` (`id` , `name`, `setting`) VALUES (NULL , 'paymentconfig', '0')");
$this->basedb->doSQL($pdo,"INSERT INTO `%config%` (`id` , `name`, `setting`) VALUES (NULL , 'remoteaccesscode', null)");
$this->basedb->doSQL($pdo,"INSERT INTO `%config%` (`id` , `name`, `setting`) VALUES (NULL , 'decpoint', '$decpoint')");
@ -3369,7 +3414,7 @@ $zones[] = $timezone_identifiers[$i];
}
echo json_encode($zones);
} else if ($command == 'update') {
$installerVersion = "1.4.0";
$installerVersion = "1.4.1";
$admin = new InstallAdmin();
$pdo = $admin->openDbAndReturnPdo($_POST['host'],$_POST['db'],$_POST['user'],$_POST['password']);
@ -3400,7 +3445,7 @@ $supportedVersions = array("1.0.22","1.0.23","1.0.24","1.0.25","1.0.26","1.0.27"
"1.1.18","1.1.19","1.1.20","1.1.21","1.1.22","1.1.23","1.1.24","1.1.25","1.1.26","1.1.27","1.1.28","1.1.29","1.1.30",
"1.2.0","1.2.1","1.2.2", "1.2.3", "1.2.4","1.2.5","1.2.6","1.2.7","1.2.8","1.2.9","1.2.10","1.2.11","1.2.12","1.2.13","1.2.14","1.2.15","1.2.16","1.2.17",
"1.2.18","1.2.19","1.2.20","1.2.21","1.2.22","1.3.0","1.3.1","1.3.2","1.3.3","1.3.4","1.3.5","1.3.6","1.3.7","1.3.8","1.3.9","1.3.10","1.3.11","1.3.12",
"1.3.13","1.3.14","1.3.15","1.3.16","1.3.17","1.3.18","1.3.19","1.3.20","1.3.21","1.3.22","1.3.23","1.3.24","1.3.25","1.3.26"
"1.3.13","1.3.14","1.3.15","1.3.16","1.3.17","1.3.18","1.3.19","1.3.20","1.3.21","1.3.22","1.3.23","1.3.24","1.3.25","1.3.26","1.4.0"
);
if (!in_array($version, $supportedVersions)) {
@ -3408,7 +3453,7 @@ echo json_encode("Quellversion nicht unterstützt");
return;
}
$ret = $admin->updateUserTable1326_1400($_POST['prefix'], $version, $_POST['db']);
$ret = $admin->updateUserTable1400_1401($_POST['prefix'], $version, $_POST['db']);
if(session_id() == '') {
session_start();

View File

@ -5,7 +5,7 @@
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<meta name="author" content="Stefan Pichel">
<link rel="stylesheet" type="text/css" href="css/bestformat.css?v=1.4.0">
<link rel="stylesheet" type="text/css" href="css/bestformat.css?v=1.4.1">
<link rel="stylesheet" href="php/contenthandler.php?module=admin&command=getmobilecss" />
<link rel="stylesheet" href="php/3rdparty/orderstyle/jquery.mobile.icons.min.css" />

View File

@ -5,7 +5,7 @@
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<meta name="author" content="Stefan Pichel">
<link rel="stylesheet" type="text/css" href="css/bestformat.css?v=1.4.0">
<link rel="stylesheet" type="text/css" href="css/bestformat.css?v=1.4.1">
<link rel="stylesheet" href="php/contenthandler.php?module=admin&command=getmobilecss" />
<link rel="stylesheet" href="php/3rdparty/orderstyle/jquery.mobile.icons.min.css" />
@ -382,7 +382,7 @@ var MAN_PRINT_INSTANCE = ["Druckerinstanz","Printer instance","Impresora"];
var MAN_RECEIPT_TXT = ["Kasse","Receipts","Recibos"];
var MAN_DRINKS_REC_TXT = ["Getränke","Drinks","Bebidas"];
var MAN_FOOD_REC_TXT = ["Speisen","Food","Comidas"];
var MAN_PRINSTANCE_HINT = ["Die Zuordnungen wirken nur bei Printserverversionen ab 1.3.14!","The assignments only work with print server versions 1.3.14 and higher!","Esta configuración sólo funciona con printservers de una version 1.3.14 o despues!"];
var MAN_PRINSTANCE_HINT = ["Die Zuordnungen wirken erst ab Printserverversion 1.3.14 oder höher!","The assignments only work with print server versions 1.3.14 and higher!","Esta configuración sólo funciona con printservers de una version 1.3.14 o despues!"];
var MAN_DASHSLOT1 = ["Dashboard Slot 1","Dashboard Slot 1","Dashboard Slot 1"];
var MAN_DASHSLOT2 = ["Dashboard Slot 2","Dashboard Slot 2","Dashboard Slot 2"];
var MAN_DASHSLOT3 = ["Dashboard Slot 3","Dashboard Slot 3","Dashboard Slot 3"];
@ -1227,7 +1227,7 @@ function initRestoreFileUpload() {
} else {
alert("Import war erfolgreich.");
setTimeout(function(){
document.location.href = "index.html?v=1.4.0";
document.location.href = "index.html?v=1.4.1";
},250);
}
},
@ -1764,9 +1764,9 @@ function handleUpdateCheckResult(answer) {
var millis=getMillis();
setTimeout(function(){
document.location.href = "install.html?v=1.4.0&mode=onlyupdate&n=" + millis;
document.location.href = "install.html?v=1.4.1&mode=onlyupdate&n=" + millis;
},250);
document.location.href = "install.html?v=1.4.0&mode=onlyupdate&n=" + millis;
document.location.href = "install.html?v=1.4.1&mode=onlyupdate&n=" + millis;
}
function handleUpdateReplace(answer) {

View File

@ -5,7 +5,7 @@
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<meta name="author" content="Stefan Pichel">
<link rel="stylesheet" type="text/css" href="css/bestformat.css?v=1.4.0">
<link rel="stylesheet" type="text/css" href="css/bestformat.css?v=1.4.1">
<link rel="stylesheet" href="php/contenthandler.php?module=admin&command=getmobilecss" />
<link rel="stylesheet" href="php/3rdparty/orderstyle/jquery.mobile.icons.min.css" />

View File

@ -1245,7 +1245,7 @@ class Admin {
$view = "preferences.html";
}
echo json_encode($view . "?v=1.4.0");
echo json_encode($view . "?v=1.4.1");
}
}
@ -1452,27 +1452,27 @@ class Admin {
if (!self::isOnlyRatingUser($rights, $right_rating, true)) {
if ($_SESSION['modus'] == 0) {
if ($_SESSION['right_waiter']) { $mainMenu[] = array("name" => $waitertxt[$lang], "link" => "waiter.html?v=1.4.0"); };
if ($_SESSION['right_waiter']) { $mainMenu[] = array("name" => $waitertxt[$lang], "link" => "waiter.html?v=1.4.1"); };
} else {
if ($_SESSION['right_waiter']) { $mainMenu[] = array("name" => $waiterdesktxt[$lang], "link" => "waiterdesktop.php?v=1.4.0"); };
if ($_SESSION['right_waiter']) { $mainMenu[] = array("name" => $waiterdesktxt[$lang], "link" => "waiterdesktop.php?v=1.4.1"); };
}
if ($_SESSION['right_kitchen']) { $mainMenu[] = array("name" => $kitchentxt[$lang], "link" => "kitchen.html?v=1.4.0"); };
if ($_SESSION['right_bar']) { $mainMenu[] = array("name" => "Bar", "link" => "bar.html?v=1.4.0"); };
if ($_SESSION['right_supply']) { $mainMenu[] = array("name" => $supplytxt[$lang], "link" => "supplydesk.html?v=1.4.0"); };
if ($_SESSION['right_kitchen']) { $mainMenu[] = array("name" => $kitchentxt[$lang], "link" => "kitchen.html?v=1.4.1"); };
if ($_SESSION['right_bar']) { $mainMenu[] = array("name" => "Bar", "link" => "bar.html?v=1.4.1"); };
if ($_SESSION['right_supply']) { $mainMenu[] = array("name" => $supplytxt[$lang], "link" => "supplydesk.html?v=1.4.1"); };
if ($_SESSION['modus'] == 0) {
if ($_SESSION['right_paydesk']) { $mainMenu[] = array("name" => $paydesktxt[$lang], "link" => "paydesk.html?v=1.4.0"); };
if ($_SESSION['right_paydesk']) { $mainMenu[] = array("name" => $paydesktxt[$lang], "link" => "paydesk.html?v=1.4.1"); };
}
if ($_SESSION['right_statistics']) { $mainMenu[] = array("name" => $stattxt[$lang], "link" => "reports.html?v=1.4.0"); };
if ($_SESSION['right_bill']) { $mainMenu[] = array("name" => $bontxt[$lang], "link" => "bill.html?v=1.4.0"); };
if ($_SESSION['right_products']) { $mainMenu[] = array("name" => $prodtxt[$lang], "link" => "products.html?v=1.4.0"); };
if ($_SESSION['right_reservation']) { $mainMenu[] = array("name" => $restxt[$lang], "link" => "reservation.html?v=1.4.0"); };
if ($_SESSION['right_rating']) { $mainMenu[] = array("name" => $ratingtxt[$lang], "link" => "rating.html?v=1.4.0"); };
if ($_SESSION['right_customers']) { $mainMenu[] = array("name" => $customerstxt[$lang], "link" => "customers.html?v=1.4.0"); };
if ($_SESSION['right_dash']) { $mainMenu[] = array("name" => $dashtxt[$lang], "link" => "dash.php?v=1.4.0"); };
if ($_SESSION['right_manager'] || $_SESSION['is_admin'] || $_SESSION['right_closing']) { $mainMenu[] = array("name" => $admintxt[$lang], "link" => "manager.html?v=1.4.0"); };
$mainMenu[] = array("name" => $settingtxt[$lang], "link" => "preferences.html?v=1.4.0");
$mainMenu[] = array("name" => "Hilfe", "link" => "help.php?v=1.4.0");
$mainMenu[] = array("name" => "Feedback", "link" => "feedback.html?v=1.4.0");
if ($_SESSION['right_statistics']) { $mainMenu[] = array("name" => $stattxt[$lang], "link" => "reports.html?v=1.4.1"); };
if ($_SESSION['right_bill']) { $mainMenu[] = array("name" => $bontxt[$lang], "link" => "bill.html?v=1.4.1"); };
if ($_SESSION['right_products']) { $mainMenu[] = array("name" => $prodtxt[$lang], "link" => "products.html?v=1.4.1"); };
if ($_SESSION['right_reservation']) { $mainMenu[] = array("name" => $restxt[$lang], "link" => "reservation.html?v=1.4.1"); };
if ($_SESSION['right_rating']) { $mainMenu[] = array("name" => $ratingtxt[$lang], "link" => "rating.html?v=1.4.1"); };
if ($_SESSION['right_customers']) { $mainMenu[] = array("name" => $customerstxt[$lang], "link" => "customers.html?v=1.4.1"); };
if ($_SESSION['right_dash']) { $mainMenu[] = array("name" => $dashtxt[$lang], "link" => "dash.php?v=1.4.1"); };
if ($_SESSION['right_manager'] || $_SESSION['is_admin'] || $_SESSION['right_closing']) { $mainMenu[] = array("name" => $admintxt[$lang], "link" => "manager.html?v=1.4.1"); };
$mainMenu[] = array("name" => $settingtxt[$lang], "link" => "preferences.html?v=1.4.1");
$mainMenu[] = array("name" => "Hilfe", "link" => "help.php?v=1.4.1");
$mainMenu[] = array("name" => "Feedback", "link" => "feedback.html?v=1.4.1");
}
$mainMenu[] = array("name" => $logout[$lang], "link" => "logout.php");
@ -1480,7 +1480,7 @@ class Admin {
$waiterMessage = $this->getMessage(null, "waitermessage");
}
$mainMenuAndVersion = array ("version" => "OrderSprinter 1.4.0",
$mainMenuAndVersion = array ("version" => "OrderSprinter 1.4.1",
"user" => $currentUser,
"menu" => $mainMenu,
"waitermessage" => $waiterMessage,
@ -2119,8 +2119,9 @@ class Admin {
$roleid = $_POST['roleid'];
$is_admin_role = self::isRoleAdmin($pdo, $roleid);
$isRoleOfUserAdmin = self::isRoleOfUserAdmin($pdo, $theUserId);
if (!$this->isCurrentUserAdmin() && $is_admin_role) {
if (!$this->isCurrentUserAdmin() && ($is_admin_role || $isRoleOfUserAdmin)) {
echo json_encode("noadmin");
} else {
$sql = "UPDATE %user% SET roleid=? WHERE id=?";

View File

@ -207,15 +207,15 @@ class Bill {
$tableid = $row->tableid;
if ($qrow->countid == 0) {
if ($tableid == 0) {
$sql = "SELECT DISTINCT billdate,brutto,netto,'-' as tablename,username,host,IFNULL(%bill%.status,'') as status,guestinfo,paymentid FROM %bill%,%user% WHERE %bill%.id=? AND userid=%user%.id AND tableid='0' ";
$sql = "SELECT DISTINCT billdate,brutto,ROUND(netto,2) as netto,'-' as tablename,username,host,IFNULL(%bill%.status,'') as status,guestinfo,paymentid FROM %bill%,%user% WHERE %bill%.id=? AND userid=%user%.id AND tableid='0' ";
} else {
$sql = "SELECT DISTINCT billdate,brutto,netto,tableno as tablename,username,host,IFNULL(%bill%.status,'') as status,guestinfo,paymentid FROM %bill%,%user%,%resttables% WHERE %bill%.id=? AND userid=%user%.id AND tableid=%resttables%.id ";
$sql = "SELECT DISTINCT billdate,brutto,ROUND(netto,2) as netto,tableno as tablename,username,host,IFNULL(%bill%.status,'') as status,guestinfo,paymentid FROM %bill%,%user%,%resttables% WHERE %bill%.id=? AND userid=%user%.id AND tableid=%resttables%.id ";
}
} else {
if ($tableid == 0) {
$sql = "SELECT DISTINCT billdate,brutto,netto,'-' as tablename,username,host,IFNULL(%bill%.status,'') as status,guestinfo,paymentid 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,ROUND(netto,2) as netto,'-' as tablename,username,host,IFNULL(%bill%.status,'') as status,guestinfo,paymentid FROM %bill%,%user%,%queue% WHERE %bill%.id=? AND %bill%.id=%queue%.billid AND userid=%user%.id AND tableid='0' AND paidtime is not null ";
} else {
$sql = "SELECT DISTINCT billdate,brutto,netto,tableno as tablename,username,host,IFNULL(%bill%.status,'') as status,guestinfo,paymentid 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,ROUND(netto,2) as netto,tableno as tablename,username,host,IFNULL(%bill%.status,'') as status,guestinfo,paymentid 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));
@ -566,7 +566,7 @@ class Bill {
if (!is_null($maxbillid)) {
$nextbillid = intval($maxbillid) + 1;
$sql = "SELECT brutto,netto,prevbrutto,prevnetto FROM %bill% WHERE id=?";
$sql = "SELECT brutto,ROUND(netto,2) as netto,prevbrutto,prevnetto FROM %bill% WHERE id=?";
$row = CommonUtils::getRowSqlObject($pdo, $sql, array(intval($maxbillid)));
$newprevbrutto = $row->prevbrutto ;
$newprevnetto = $row->prevnetto;
@ -979,6 +979,7 @@ class Bill {
$this->t['Date'][$l],
$this->t['Brutto'][$l] ."($currency)",
$this->t['Netto'][$l] . "($currency)",
$this->t['Tablename'][$l],
$this->t['State'][$l],
$this->t['Ref'][$l],
$this->t['host'][$l],
@ -1005,7 +1006,7 @@ class Bill {
$payment_col = $payment_lang[$l];
$pdo = DbUtils::openDbAndReturnPdoStatic();
$sql = "SELECT DISTINCT %bill%.id,%bill%.signature,billdate,brutto,netto,IF(tax is not null, tax, '0.00') as tax,status,closingdate,remark,%bill%.host,%bill%.closingid,%payment%.$payment_col as payway,userid,ref,username,IF(%bill%.reason is not null,reason,'') as reason FROM %bill%,%closing%,%payment%,%user% ";
$sql = "SELECT DISTINCT %bill%.id,IF(tableid > '0',(SELECT tableno FROM %resttables% WHERE id=tableid),'') as tablename,%bill%.signature,billdate,brutto,ROUND(netto,2) as netto,IF(tax is not null, tax, '0.00') as tax,status,closingdate,remark,%bill%.host,%bill%.closingid,%payment%.$payment_col as payway,userid,ref,username,IF(%bill%.reason is not null,reason,'') as reason FROM %bill%,%closing%,%payment%,%user% ";
$sql .= "WHERE closingid is not null AND %bill%.closingid=%closing%.id ";
$sql .= " AND %bill%.paymentid=%payment%.id ";
if ($onlyClosingId == null) {
@ -1027,6 +1028,7 @@ class Bill {
$dbresult = $stmt->fetchAll();
foreach($dbresult as $zeile) {
$billid = $zeile['id'];
$tablename = $zeile['tablename'];
$billdate = $zeile['billdate'];
$brutto_orig = $zeile['brutto'];
@ -1068,9 +1070,9 @@ class Bill {
}
if ($onlyClosingId == null) {
$line = array($billid , $billdate, $brutto, $netto, $status, $ref, $host, $reason, $userid,$username , $closingid, $closingdate, $paymentname, $remark);
$line = array($billid , $billdate, $brutto, $netto, $tablename, $status, $ref, $host, $reason, $userid,$username , $closingid, $closingdate, $paymentname, $remark);
} else {
$line = array($billid , $billdate, $brutto, $netto, $status, $ref, $host, $reason, $userid,$username , $paymentname);
$line = array($billid , $billdate, $brutto, $netto, $tablename, $status, $ref, $host, $reason, $userid,$username , $paymentname);
}
$allcells[] = $line;
}
@ -1122,4 +1124,3 @@ class Bill {
unset($objPHPExcel);
}
}
?>

View File

@ -532,7 +532,7 @@ $count = count($result);
if ($count == 0) {
return "";
} else {
$msg = "Umsätze aufgeschlüsselt nach Benutzer und Steuersatz:\n\n";
$msg = "Umsätze aufgeschlüsselt nach Benutzer und Steuersatz (ohne Ein-/Auslagen):\n\n";
$msg .= "Benutzer;Steuersatz;Umsatz (Brutto)\n";
foreach($result as $res) {
// sumprice | thetax | username
@ -542,8 +542,8 @@ $msg .= $res['username'] . ";$tax;$sumprice\n";
}
return $msg . "\n";
}
}
private function retrieveClosingFromDb($pdo,$closingid,$doCsvExport,$onlyresultreturn) {
if(session_id() == '') {
session_start();
@ -566,7 +566,7 @@ header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
header("Pragma: no-cache");
header("Expires: 0");
$csv .= $this->t['ID'][$l] . ";" . $this->t['Date'][$l] . ";" . $this->t['Prod'][$l] . ";" . $this->t['Brutto'][$l] . "($currency);";
$csv .= $this->t['ID'][$l] . ";" . $this->t['Date'][$l] . ";" . $this->t['Tablename'][$l] . ";" . $this->t['Prod'][$l] . ";" . $this->t['Brutto'][$l] . "($currency);";
$csv .= $this->t['Netto'][$l] . "($currency);";
$csv .= $this->t['Tax'][$l] . ";";
$csv .= $this->t['PayWay'][$l] . ";";
@ -587,7 +587,7 @@ $billsum = $row->billsum;
$billcount = $row->billcount;
$signature = $row->signature;
$sql = "SELECT %bill%.id as id,paymentid,billdate,userid,ref,username,status,brutto,netto,IF(tax is not null, tax, '0.00') as tax FROM %bill%,%user% WHERE closingid=? AND %bill%.userid = %user%.id ORDER BY billdate";
$sql = "SELECT %bill%.id as id,IF(tableid > '0',(SELECT tableno FROM %resttables% WHERE id=tableid),'') as tablename,paymentid,billdate,userid,ref,username,status,brutto,netto,IF(tax is not null, tax, '0.00') as tax FROM %bill%,%user% WHERE closingid=? AND %bill%.userid = %user%.id ORDER BY billdate";
$stmt = $pdo->prepare(DbUtils::substTableAlias($sql));
$stmt->execute(array($closingid));
$billIdsAndPaymentsForThatClosing = $stmt->fetchAll();
@ -620,6 +620,7 @@ $this->returnErrorInconsDB($doCsvExport, $onlyresultreturn);
return;
}
$tablename = $billIdsAndPaymentsForThatClosing[$index]['tablename'];
$billdate = $billIdsAndPaymentsForThatClosing[$index]['billdate'];
$paymentid = $billIdsAndPaymentsForThatClosing[$index]['paymentid'];
$userid = $billIdsAndPaymentsForThatClosing[$index]['userid'];
@ -638,6 +639,7 @@ $netto = number_format($netto, 2, $decpoint, '');
$tax = number_format($tax, 2, $decpoint, '');
$retValues[] = array (
"billid" => $aBillId,
"tablename" => '',
"paidtime" => $billdate,
"productname" => $this->t['cashaction'][$l], // Kassenaktion
"price" => $brutto,
@ -649,7 +651,7 @@ $retValues[] = array (
"status" => $statusTxt,
"ref" => $ref);
if ($doCsvExport || $onlyresultreturn) {
$csv .= "$aBillId; \"$billdate\" ; \"" . $this->t['cashaction'][$l] . "\" ; \"$brutto\" ; \"$netto\" ; \"$tax\" ; \"$paymentArray[$paymentid]\";$userid; \"$username\"; \"$statusTxt\"; $ref\n";
$csv .= "$aBillId; \"$billdate\" ; \"$tablename\" ; \"" . $this->t['cashaction'][$l] . "\" ; \"$brutto\" ; \"$netto\" ; \"$tax\" ; \"$paymentArray[$paymentid]\";$userid; \"$username\"; \"$statusTxt\"; $ref\n";
}
} else {
@ -680,6 +682,7 @@ $price = number_format($price, 2, $decpoint, '');
$formattedtax = number_format($tax, 2, $decpoint, '');
$retValues[] = array (
"billid" => $aBillId,
"tablename" => $tablename,
"paidtime" => $paidtime,
"productname" => $productname,
"price" => $price,
@ -692,7 +695,7 @@ $retValues[] = array (
"ref" => $ref);
$productname = str_replace('"','""',$productname);
if ($doCsvExport || $onlyresultreturn) {
$csv .= "$aBillId; \"$paidtime\" ; \"$productname\" ; \"$price\" ; \"$netto\" ; \"$formattedtax\" ; \"$paymentArray[$paymentid]\"; $userid; \"$username\"; \"$statusTxt\"; $ref\n";
$csv .= "$aBillId; \"$paidtime\" ; \"$tablename\" ; \"$productname\" ; \"$price\" ; \"$netto\" ; \"$formattedtax\" ; \"$paymentArray[$paymentid]\"; $userid; \"$username\"; \"$statusTxt\"; $ref\n";
}
}
}
@ -758,7 +761,7 @@ return null;
}
}
$sql = "select sum(%bill%.brutto) as sum,sum(%bill%.netto) as netto,%payment%.name,%bill%.status from %bill%,%payment% where ";
$sql = "select sum(%bill%.brutto) as sum,round(sum(%bill%.netto),2) as netto,%payment%.name,%bill%.status from %bill%,%payment% where ";
$sql .= "%bill%.closingid=? and ";
$sql .= "%bill%.paymentid=%payment%.id ";
$sql .= "group by %bill%.tax,%payment%.name,%bill%.status";
@ -827,5 +830,3 @@ return $retVal;
}
}
}
?>

View File

@ -102,7 +102,7 @@ class CommonUtils {
$pdo = $this->dbutils->openDbAndReturnPdo();
}
$sql = "SELECT billdate,brutto,netto,userid,IF(tax is not null, tax, '0.00') as tax,signature,status FROM %bill% WHERE id=?";
$sql = "SELECT billdate,brutto,ROUND(netto,2) as netto,userid,IF(tax is not null, tax, '0.00') as tax,signature,status FROM %bill% WHERE id=?";
$stmt = $pdo->prepare($this->dbutils->resolveTablenamesInSqlString($sql));
$stmt->execute(array($id));
$row = $stmt->fetchObject();

View File

@ -15,8 +15,8 @@ if (isset($_POST["cmd"])) {
if (strlen($cmd) > 150) {
$cmd = substr($cmd, 0,149);
}
if (strlen($xhr) > 700) {
$xhr = substr($xhr, 0,699);
if (strlen($xhr) > 900) {
$xhr = substr($xhr, 0,899);
}
if (strlen($fct) > 100) {
$fct = substr($fct, 0,99);
@ -27,7 +27,7 @@ if (isset($_POST["cmd"])) {
if (strlen($status) > 150) {
$status = substr($status, 0,149);
}
$version = "1.4.0";
$version = "1.4.1";
$arr = array("cmd" => $cmd,"fct" => $fct, "xhr" => $xhr,"errormsg" => $errormsg,"status" => $status,"version" => $version,"phpversion" => $phpversion);
} else {

View File

@ -1730,7 +1730,7 @@ class QueueContent {
* Create bill
* Return a bill id
*/
function declarePaidCreateBillReturnBillId($pdo,$ids,$tableid,$paymentId,$declareready,$host,$calledInternally = false,$reservationid,$guestinfo,$intguestid) {
function declarePaidCreateBillReturnBillId($pdo,$ids,$tableid,$paymentId,$declareready,$host,$calledInternally = false,$reservationid='',$guestinfo='',$intguestid='') {
if ($intguestid == '') {
$intguestid = null;
@ -1792,7 +1792,7 @@ class QueueContent {
$row =$stmt->fetchObject();
if ($row != null) {
$billid = intval($row->id)+1;
$sql = "SELECT brutto,netto,prevbrutto,prevnetto FROM %bill% WHERE id=?";
$sql = "SELECT brutto,ROUND(netto,2) as netto,prevbrutto,prevnetto FROM %bill% WHERE id=?";
$row = CommonUtils::getRowSqlObject($pdo, $sql, array($row->id));
$newprevbrutto = $row->prevbrutto + $row->brutto;
$newprevnetto = $row->prevnetto + $row->netto;
@ -1822,7 +1822,7 @@ class QueueContent {
}
$idlist = join("','",$ids_array);
$sql = "SELECT SUM(price) as brutto,ROUND(SUM(price/(1 + %queue%.tax/100.0)),2) as netto FROM %queue% WHERE id IN ('$idlist')";
$sql = "SELECT SUM(price) as brutto,ROUND(SUM(price/(1 + %queue%.tax/100.0)),6) as netto FROM %queue% WHERE id IN ('$idlist')";
$row = CommonUtils::getRowSqlObject($pdo, $sql, null);
$brutto = $row->brutto;
$netto = $row->netto;
@ -1878,5 +1878,3 @@ class QueueContent {
return $_SESSION['userid'];
}
}
?>

View File

@ -1,6 +1,7 @@
<?php
$this->t = array(
"ID" => array("Bonid","ID",""),
"Tablename" => array("Tisch","Table","Mesa"),
"Date" => array("Zahlungsdatum","Pay date","Fecha de pago"),
"Prod" => array("Produkt","Product","Producto"),
"Brutto" => array("Bruttopreis","Gross","Bruto"),

View File

@ -478,7 +478,7 @@ class Basedb {
`id` INT (10) NOT NULL AUTO_INCREMENT PRIMARY KEY ,
`billdate` DATETIME NOT NULL ,
`brutto` " . DECIMALMIDDLE . " NULL,
`netto` " . DECIMALMIDDLE . " NULL,
`netto` " . DECIMALMIDDLEEXACT . " NULL,
`prevbrutto` " . DECIMALBIG . " NULL,
`prevnetto` " . DECIMALBIG . " NULL,
`tableid` VARCHAR ( 150 ) NOT NULL,

View File

@ -2,4 +2,5 @@
defined('DECIMALSMALL') || define ( 'DECIMALSMALL','DECIMAL (15,2)' );
defined('DECIMALMIDDLE') || define ( 'DECIMALMIDDLE','DECIMAL (17,2)' );
defined('DECIMALMIDDLEEXACT') || define ( 'DECIMALMIDDLEEXACT','DECIMAL (17,6)' );
defined('DECIMALBIG') || define ( 'DECIMALBIG','DECIMAL (19,2)' );

View File

@ -259,6 +259,9 @@ class PdfExport extends FPDF {
$nettosum += str_replace($this->decpoint,".",$line[3]);
for ($j=0;$j<count($line);$j++) {
$aVal = $line[$j];
if ($j == 3) {
$aVal = number_format(floatval(str_replace(',','.',$aVal)),2,$this->decpoint,'');
}
$this->Cell($this->flengths[$j],6,$aVal,"LR",0,"R",$fill);
}
$this->Ln();

View File

@ -5,7 +5,7 @@
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<meta name="author" content="Stefan Pichel">
<link rel="stylesheet" type="text/css" href="css/bestformat.css?v=1.4.0">
<link rel="stylesheet" type="text/css" href="css/bestformat.css?v=1.4.1">
<link rel="stylesheet" href="php/contenthandler.php?module=admin&command=getmobilecss" />
<link rel="stylesheet" href="php/3rdparty/orderstyle/jquery.mobile.icons.min.css" />

View File

@ -7,7 +7,7 @@
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<meta name="author" content="Stefan Pichel">
<link rel="stylesheet" type="text/css" href="css/bestformat.css?v=1.4.0">
<link rel="stylesheet" type="text/css" href="css/bestformat.css?v=1.4.1">
<link rel="stylesheet" href="php/contenthandler.php?module=admin&command=getmobilecss" />
<link rel="stylesheet" href="php/3rdparty/orderstyle/jquery.mobile.icons.min.css" />

View File

@ -7,7 +7,7 @@
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<meta name="author" content="Stefan Pichel">
<link rel="stylesheet" type="text/css" href="css/bestformat.css?v=1.4.0">
<link rel="stylesheet" type="text/css" href="css/bestformat.css?v=1.4.1">
<link rel="stylesheet" href="php/contenthandler.php?module=admin&command=getmobilecss" />
<link rel="stylesheet" href="php/3rdparty/orderstyle/jquery.mobile.icons.min.css" />

View File

@ -7,7 +7,7 @@
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<meta name="author" content="Stefan Pichel">
<link rel="stylesheet" type="text/css" href="css/bestformat.css?v=1.4.0">
<link rel="stylesheet" type="text/css" href="css/bestformat.css?v=1.4.1">
<link rel="stylesheet" href="php/contenthandler.php?module=admin&command=getmobilecss" />
<link rel="stylesheet" href="php/3rdparty/orderstyle/jquery.mobile.icons.min.css" />

View File

@ -5,7 +5,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<meta name="author" content="Stefan Pichel">
<link rel="stylesheet" type="text/css" href="css/bestformat.css?v=1.4.0">
<link rel="stylesheet" type="text/css" href="css/bestformat.css?v=1.4.1">
<link rel="stylesheet" href="php/contenthandler.php?module=admin&command=getmobilecss" />
<link rel="stylesheet" href="php/3rdparty/orderstyle/jquery.mobile.icons.min.css" />

View File

@ -5,7 +5,7 @@
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<meta name="author" content="Stefan Pichel">
<link rel="stylesheet" type="text/css" href="css/bestformat.css?v=1.4.0">
<link rel="stylesheet" type="text/css" href="css/bestformat.css?v=1.4.1">
<link rel="stylesheet" href="php/contenthandler.php?module=admin&command=getmobilecss" />
<link rel="stylesheet" href="php/3rdparty/orderstyle/jquery.mobile.icons.min.css" />

View File

@ -4,8 +4,8 @@
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<meta name="author" content="Stefan Pichel">
<link rel="stylesheet" type="text/css" href="css/bestformat.css?v=1.4.0">
<link rel="stylesheet" type="text/css" href="css/numfield.css?v=1.4.0">
<link rel="stylesheet" type="text/css" href="css/bestformat.css?v=1.4.1">
<link rel="stylesheet" type="text/css" href="css/numfield.css?v=1.4.1">
<link rel="stylesheet" href="php/contenthandler.php?module=admin&command=getmobilecss" />
<link rel="stylesheet" href="php/3rdparty/orderstyle/jquery.mobile.icons.min.css" />