OrderSprinter 1.1.4

This commit is contained in:
Geno 2020-11-19 22:51:46 +01:00
parent e4869a39c8
commit 637aa62970
8 changed files with 75 additions and 23 deletions

Binary file not shown.

View File

@ -435,15 +435,12 @@ table.prodtable .prodpriceC {
}
.typehigher {
position: absolute;
top: 0px; bottom: 0px; right: 40px;
border: 0;
text-align:right;
background-color: rgb(246, 246, 246, 0.0) !important;
}
.typetop {
position: absolute;
top: 0px; bottom: 0px; left: 40px;
border: 0;
text-align:left;
background-color: rgb(246, 246, 246, 0.0) !important;
}

View File

@ -679,7 +679,7 @@ $(document).ready(function() {
<tr id=updateline>
<td>&nbsp;</td>
<td align=center>
<button id="updatebtn">Update -> 1.1.3</button>
<button id="updatebtn">Update -> 1.1.4</button>
</td>
<td>&nbsp;</td>
</tr>

View File

@ -593,6 +593,10 @@ function updateUserTable1102_1103($prefix) {
return $this->setVersion($prefix, '1.1.3');
}
function updateUserTable1103_1104($prefix) {
return $this->setVersion($prefix, '1.1.4');
}
function setVersion($prefix,$theVersion) {
$pdo = $this->pdo;
try {
@ -664,7 +668,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.1.3')");
$this->basedb->doSQL($pdo,"INSERT INTO `%config%` (`id` , `name`, `setting`) VALUES (NULL , 'version', '1.1.4')");
$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')");
@ -1063,6 +1067,7 @@ $ret &= $admin->updateUserTable1043_1100($_POST['prefix']);
$ret &= $admin->updateUserTable1100_1101($_POST['prefix']);
$ret &= $admin->updateUserTable1101_1102($_POST['prefix']);
$ret &= $admin->updateUserTable1102_1103($_POST['prefix']);
$ret &= $admin->updateUserTable1103_1104($_POST['prefix']);
} else if ($version == "1.0.14") {
$ret &= $admin->updateUserTable1014_1015();
$ret &= $admin->updateUserTable1015_1016();
@ -1093,6 +1098,7 @@ $ret &= $admin->updateUserTable1043_1100($_POST['prefix']);
$ret &= $admin->updateUserTable1100_1101($_POST['prefix']);
$ret &= $admin->updateUserTable1101_1102($_POST['prefix']);
$ret &= $admin->updateUserTable1102_1103($_POST['prefix']);
$ret &= $admin->updateUserTable1103_1104($_POST['prefix']);
} else if ($version == "1.0.15") {
$ret &= $admin->updateUserTable1015_1016();
$ret &= $admin->updateUserTable1016_1017();
@ -1123,6 +1129,7 @@ $ret &= $admin->updateUserTable1043_1100($_POST['prefix']);
$ret &= $admin->updateUserTable1100_1101($_POST['prefix']);
$ret &= $admin->updateUserTable1101_1102($_POST['prefix']);
$ret &= $admin->updateUserTable1102_1103($_POST['prefix']);
$ret &= $admin->updateUserTable1103_1104($_POST['prefix']);
} else if ($version == "1.0.16") {
$ret &= $admin->updateUserTable1016_1017();
$ret &= $admin->updateUserTable1017_1018();
@ -1152,6 +1159,7 @@ $ret &= $admin->updateUserTable1043_1100($_POST['prefix']);
$ret &= $admin->updateUserTable1100_1101($_POST['prefix']);
$ret &= $admin->updateUserTable1101_1102($_POST['prefix']);
$ret &= $admin->updateUserTable1102_1103($_POST['prefix']);
$ret &= $admin->updateUserTable1103_1104($_POST['prefix']);
} else if (($version == "1.0.17") || ($version == "1.0.18")) {
$ret &= $admin->updateUserTable1018_1019();
$ret &= $admin->updateUserTable1019_1020();
@ -1180,6 +1188,7 @@ $ret &= $admin->updateUserTable1043_1100($_POST['prefix']);
$ret &= $admin->updateUserTable1100_1101($_POST['prefix']);
$ret &= $admin->updateUserTable1101_1102($_POST['prefix']);
$ret &= $admin->updateUserTable1102_1103($_POST['prefix']);
$ret &= $admin->updateUserTable1103_1104($_POST['prefix']);
} else if ($version == "1.0.19") {
$ret &= $admin->updateUserTable1019_1020();
$ret &= $admin->updateUserTable1022_1023($_POST['prefix']);
@ -1207,6 +1216,7 @@ $ret &= $admin->updateUserTable1043_1100($_POST['prefix']);
$ret &= $admin->updateUserTable1100_1101($_POST['prefix']);
$ret &= $admin->updateUserTable1101_1102($_POST['prefix']);
$ret &= $admin->updateUserTable1102_1103($_POST['prefix']);
$ret &= $admin->updateUserTable1103_1104($_POST['prefix']);
} else if (($version == "1.0.20") || ($version == "1.0.21")) {
// nothing to do... :) (but maybe user has pressed though)
} else if (($version == "1.0.22")) {
@ -1235,6 +1245,7 @@ $ret &= $admin->updateUserTable1043_1100($_POST['prefix']);
$ret &= $admin->updateUserTable1100_1101($_POST['prefix']);
$ret &= $admin->updateUserTable1101_1102($_POST['prefix']);
$ret &= $admin->updateUserTable1102_1103($_POST['prefix']);
$ret &= $admin->updateUserTable1103_1104($_POST['prefix']);
} else if (($version == "1.0.23")) {
$ret &= $admin->updateUserTable1023_1024($_POST['prefix']);
$ret &= $admin->updateUserTable1024_1025($_POST['prefix']);
@ -1260,6 +1271,7 @@ $ret &= $admin->updateUserTable1043_1100($_POST['prefix']);
$ret &= $admin->updateUserTable1100_1101($_POST['prefix']);
$ret &= $admin->updateUserTable1101_1102($_POST['prefix']);
$ret &= $admin->updateUserTable1102_1103($_POST['prefix']);
$ret &= $admin->updateUserTable1103_1104($_POST['prefix']);
} else if (($version == "1.0.24")) {
$ret &= $admin->updateUserTable1024_1025($_POST['prefix']);
$ret &= $admin->updateUserTable1025_1026($_POST['prefix']);
@ -1284,6 +1296,7 @@ $ret &= $admin->updateUserTable1043_1100($_POST['prefix']);
$ret &= $admin->updateUserTable1100_1101($_POST['prefix']);
$ret &= $admin->updateUserTable1101_1102($_POST['prefix']);
$ret &= $admin->updateUserTable1102_1103($_POST['prefix']);
$ret &= $admin->updateUserTable1103_1104($_POST['prefix']);
} else if (($version == "1.0.25")) {
$ret &= $admin->updateUserTable1025_1026($_POST['prefix']);
$ret &= $admin->updateUserTable1026_1027($_POST['prefix']);
@ -1307,6 +1320,7 @@ $ret &= $admin->updateUserTable1043_1100($_POST['prefix']);
$ret &= $admin->updateUserTable1100_1101($_POST['prefix']);
$ret &= $admin->updateUserTable1101_1102($_POST['prefix']);
$ret &= $admin->updateUserTable1102_1103($_POST['prefix']);
$ret &= $admin->updateUserTable1103_1104($_POST['prefix']);
} else if (($version == "1.0.26")) {
$ret &= $admin->updateUserTable1026_1027($_POST['prefix']);
$ret &= $admin->updateUserTable1027_1028($_POST['prefix']);
@ -1329,6 +1343,7 @@ $ret &= $admin->updateUserTable1043_1100($_POST['prefix']);
$ret &= $admin->updateUserTable1100_1101($_POST['prefix']);
$ret &= $admin->updateUserTable1101_1102($_POST['prefix']);
$ret &= $admin->updateUserTable1102_1103($_POST['prefix']);
$ret &= $admin->updateUserTable1103_1104($_POST['prefix']);
} else if (($version == "1.0.27")) {
$ret &= $admin->updateUserTable1027_1028($_POST['prefix']);
$ret &= $admin->updateUserTable1028_1029($_POST['prefix']);
@ -1350,6 +1365,7 @@ $ret &= $admin->updateUserTable1043_1100($_POST['prefix']);
$ret &= $admin->updateUserTable1100_1101($_POST['prefix']);
$ret &= $admin->updateUserTable1101_1102($_POST['prefix']);
$ret &= $admin->updateUserTable1102_1103($_POST['prefix']);
$ret &= $admin->updateUserTable1103_1104($_POST['prefix']);
} else if (($version == "1.0.28")) {
$ret &= $admin->updateUserTable1028_1029($_POST['prefix']);
$ret &= $admin->updateUserTable1029_1030($_POST['prefix']);
@ -1370,6 +1386,7 @@ $ret &= $admin->updateUserTable1043_1100($_POST['prefix']);
$ret &= $admin->updateUserTable1100_1101($_POST['prefix']);
$ret &= $admin->updateUserTable1101_1102($_POST['prefix']);
$ret &= $admin->updateUserTable1102_1103($_POST['prefix']);
$ret &= $admin->updateUserTable1103_1104($_POST['prefix']);
} else if (($version == "1.0.29")) {
$ret &= $admin->updateUserTable1029_1030($_POST['prefix']);
$ret &= $admin->updateUserTable1030_1031($_POST['prefix']);
@ -1389,6 +1406,7 @@ $ret &= $admin->updateUserTable1043_1100($_POST['prefix']);
$ret &= $admin->updateUserTable1100_1101($_POST['prefix']);
$ret &= $admin->updateUserTable1101_1102($_POST['prefix']);
$ret &= $admin->updateUserTable1102_1103($_POST['prefix']);
$ret &= $admin->updateUserTable1103_1104($_POST['prefix']);
} else if (($version == "1.0.30")) {
$ret &= $admin->updateUserTable1030_1031($_POST['prefix']);
$ret &= $admin->updateUserTable1031_1032($_POST['prefix']);
@ -1407,6 +1425,7 @@ $ret &= $admin->updateUserTable1043_1100($_POST['prefix']);
$ret &= $admin->updateUserTable1100_1101($_POST['prefix']);
$ret &= $admin->updateUserTable1101_1102($_POST['prefix']);
$ret &= $admin->updateUserTable1102_1103($_POST['prefix']);
$ret &= $admin->updateUserTable1103_1104($_POST['prefix']);
} else if (($version == "1.0.31")) {
$ret &= $admin->updateUserTable1031_1032($_POST['prefix']);
$ret &= $admin->updateUserTable1032_1033($_POST['prefix']);
@ -1424,6 +1443,7 @@ $ret &= $admin->updateUserTable1043_1100($_POST['prefix']);
$ret &= $admin->updateUserTable1100_1101($_POST['prefix']);
$ret &= $admin->updateUserTable1101_1102($_POST['prefix']);
$ret &= $admin->updateUserTable1102_1103($_POST['prefix']);
$ret &= $admin->updateUserTable1103_1104($_POST['prefix']);
} else if (($version == "1.0.32")) {
$ret &= $admin->updateUserTable1032_1033($_POST['prefix']);
$ret &= $admin->updateUserTable1033_1034($_POST['prefix']);
@ -1440,6 +1460,7 @@ $ret &= $admin->updateUserTable1043_1100($_POST['prefix']);
$ret &= $admin->updateUserTable1100_1101($_POST['prefix']);
$ret &= $admin->updateUserTable1101_1102($_POST['prefix']);
$ret &= $admin->updateUserTable1102_1103($_POST['prefix']);
$ret &= $admin->updateUserTable1103_1104($_POST['prefix']);
} else if (($version == "1.0.33")) {
$ret &= $admin->updateUserTable1033_1034($_POST['prefix']);
$ret &= $admin->updateUserTable1034_1035($_POST['prefix']);
@ -1455,6 +1476,7 @@ $ret &= $admin->updateUserTable1043_1100($_POST['prefix']);
$ret &= $admin->updateUserTable1100_1101($_POST['prefix']);
$ret &= $admin->updateUserTable1101_1102($_POST['prefix']);
$ret &= $admin->updateUserTable1102_1103($_POST['prefix']);
$ret &= $admin->updateUserTable1103_1104($_POST['prefix']);
} else if (($version == "1.0.34")) {
$ret &= $admin->updateUserTable1034_1035($_POST['prefix']);
$ret &= $admin->updateUserTable1035_1036($_POST['prefix']);
@ -1469,6 +1491,7 @@ $ret &= $admin->updateUserTable1043_1100($_POST['prefix']);
$ret &= $admin->updateUserTable1100_1101($_POST['prefix']);
$ret &= $admin->updateUserTable1101_1102($_POST['prefix']);
$ret &= $admin->updateUserTable1102_1103($_POST['prefix']);
$ret &= $admin->updateUserTable1103_1104($_POST['prefix']);
} else if (($version == "1.0.35")) {
$ret &= $admin->updateUserTable1035_1036($_POST['prefix']);
$ret &= $admin->updateUserTable1036_1037($_POST['prefix']);
@ -1482,6 +1505,7 @@ $ret &= $admin->updateUserTable1043_1100($_POST['prefix']);
$ret &= $admin->updateUserTable1100_1101($_POST['prefix']);
$ret &= $admin->updateUserTable1101_1102($_POST['prefix']);
$ret &= $admin->updateUserTable1102_1103($_POST['prefix']);
$ret &= $admin->updateUserTable1103_1104($_POST['prefix']);
} else if (($version == "1.0.36")) {
$ret &= $admin->updateUserTable1036_1037($_POST['prefix']);
$ret &= $admin->updateUserTable1037_1038($_POST['prefix']);
@ -1494,6 +1518,7 @@ $ret &= $admin->updateUserTable1043_1100($_POST['prefix']);
$ret &= $admin->updateUserTable1100_1101($_POST['prefix']);
$ret &= $admin->updateUserTable1101_1102($_POST['prefix']);
$ret &= $admin->updateUserTable1102_1103($_POST['prefix']);
$ret &= $admin->updateUserTable1103_1104($_POST['prefix']);
} else if (($version == "1.0.37")) {
$ret &= $admin->updateUserTable1037_1038($_POST['prefix']);
$ret &= $admin->updateUserTable1038_1039($_POST['prefix']);
@ -1505,6 +1530,7 @@ $ret &= $admin->updateUserTable1043_1100($_POST['prefix']);
$ret &= $admin->updateUserTable1100_1101($_POST['prefix']);
$ret &= $admin->updateUserTable1101_1102($_POST['prefix']);
$ret &= $admin->updateUserTable1102_1103($_POST['prefix']);
$ret &= $admin->updateUserTable1103_1104($_POST['prefix']);
} else if (($version == "1.0.38")) {
$ret &= $admin->updateUserTable1038_1039($_POST['prefix']);
$ret &= $admin->updateUserTable1039_1040($_POST['prefix']);
@ -1515,6 +1541,7 @@ $ret &= $admin->updateUserTable1043_1100($_POST['prefix']);
$ret &= $admin->updateUserTable1100_1101($_POST['prefix']);
$ret &= $admin->updateUserTable1101_1102($_POST['prefix']);
$ret &= $admin->updateUserTable1102_1103($_POST['prefix']);
$ret &= $admin->updateUserTable1103_1104($_POST['prefix']);
} else if (($version == "1.0.39")) {
$ret &= $admin->updateUserTable1039_1040($_POST['prefix']);
$ret &= $admin->updateUserTable1040_1041($_POST['prefix']);
@ -1524,6 +1551,7 @@ $ret &= $admin->updateUserTable1043_1100($_POST['prefix']);
$ret &= $admin->updateUserTable1100_1101($_POST['prefix']);
$ret &= $admin->updateUserTable1101_1102($_POST['prefix']);
$ret &= $admin->updateUserTable1102_1103($_POST['prefix']);
$ret &= $admin->updateUserTable1103_1104($_POST['prefix']);
} else if (($version == "1.0.40")) {
$ret &= $admin->updateUserTable1040_1041($_POST['prefix']);
$ret &= $admin->updateUserTable1041_1042($_POST['prefix']);
@ -1532,6 +1560,7 @@ $ret &= $admin->updateUserTable1043_1100($_POST['prefix']);
$ret &= $admin->updateUserTable1100_1101($_POST['prefix']);
$ret &= $admin->updateUserTable1101_1102($_POST['prefix']);
$ret &= $admin->updateUserTable1102_1103($_POST['prefix']);
$ret &= $admin->updateUserTable1103_1104($_POST['prefix']);
} else if (($version == "1.0.41")) {
$ret &= $admin->updateUserTable1041_1042($_POST['prefix']);
$ret &= $admin->updateUserTable1042_1043($_POST['prefix']);
@ -1539,26 +1568,34 @@ $ret &= $admin->updateUserTable1043_1100($_POST['prefix']);
$ret &= $admin->updateUserTable1100_1101($_POST['prefix']);
$ret &= $admin->updateUserTable1101_1102($_POST['prefix']);
$ret &= $admin->updateUserTable1102_1103($_POST['prefix']);
$ret &= $admin->updateUserTable1103_1104($_POST['prefix']);
} else if (($version == "1.0.42")) {
$ret &= $admin->updateUserTable1042_1043($_POST['prefix']);
$ret &= $admin->updateUserTable1043_1100($_POST['prefix']);
$ret &= $admin->updateUserTable1100_1101($_POST['prefix']);
$ret &= $admin->updateUserTable1101_1102($_POST['prefix']);
$ret &= $admin->updateUserTable1102_1103($_POST['prefix']);
$ret &= $admin->updateUserTable1103_1104($_POST['prefix']);
} else if (($version == "1.0.43")) {
$ret &= $admin->updateUserTable1043_1100($_POST['prefix']);
$ret &= $admin->updateUserTable1100_1101($_POST['prefix']);
$ret &= $admin->updateUserTable1101_1102($_POST['prefix']);
$ret &= $admin->updateUserTable1102_1103($_POST['prefix']);
$ret &= $admin->updateUserTable1103_1104($_POST['prefix']);
} else if (($version == "1.1.0")) {
$ret &= $admin->updateUserTable1100_1101($_POST['prefix']);
$ret &= $admin->updateUserTable1101_1102($_POST['prefix']);
$ret &= $admin->updateUserTable1102_1103($_POST['prefix']);
$ret &= $admin->updateUserTable1103_1104($_POST['prefix']);
} else if (($version == "1.1.1")) {
$ret &= $admin->updateUserTable1101_1102($_POST['prefix']);
$ret &= $admin->updateUserTable1102_1103($_POST['prefix']);
$ret &= $admin->updateUserTable1103_1104($_POST['prefix']);
} else if (($version == "1.1.2")) {
$ret &= $admin->updateUserTable1102_1103($_POST['prefix']);
$ret &= $admin->updateUserTable1103_1104($_POST['prefix']);
} else if (($version == "1.1.3")) {
$ret &= $admin->updateUserTable1103_1104($_POST['prefix']);
} else {
echo json_encode("Quellversion nicht unterstützt");
return;

View File

@ -84,7 +84,7 @@ var P_NO_ELEM_DETAILS = ["Es wurden keine abrechenbaren Produkte festgelegt (der
var P_CASHACTION_OK = ["Kassenaktion abgeschlossen.","Action completed.","Acción terminado."];
var P_NAV = ["Navigation","Navigation","Navigación"];
var P_ORDER_ACTION = ["-> Bestellansicht","-> Order view", "-> Vista de Orden"];
var P_TO_PAY = ["Zu Zahlen: ","To pay: ", "Pagar Total: "];
var P_TO_PAY = ["Zu zahlen: ","To pay: ", "Pagar total: "];
var P_PAY_RETURN = ["Zurück: ", "Return: ","Torna: "];
var P_CALC_PAYBACK = ["Berechne","Calculate","Calcular"];
var P_HAS_PAID = ["Bezahlt: ","Paid: ","Pagado: "];

View File

@ -1091,7 +1091,7 @@ class Admin {
$waiterMessage = $this->getMessage(null, "waitermessage");
}
// CAUTION: change version also in config.txt!!!
$mainMenuAndVersion = array ("version" => "OrderSprinter 1.1.3",
$mainMenuAndVersion = array ("version" => "OrderSprinter 1.1.4",
"user" => $currentUser,
"menu" => $mainMenu,
"waitermessage" => $waiterMessage,
@ -1690,15 +1690,18 @@ class Admin {
date_default_timezone_set(DbUtils::getTimeZone());
$nowtime = date('Y-m-d');
$fileName = "backup-" . $nowtime . "-configuration.json";
if ($theType == "all") {
$fileName = "backup-" . $nowtime . "-all.json";
}
ini_set('memory_limit', '1000M');
$pdo = DButils::openDbAndReturnPdoStatic();
$pdo->beginTransaction();
$genInfo = $this->getGeneralConfigItems(false, $pdo);
$version = $genInfo["version"];
$fileName = "backup-" . $version . "_" . $nowtime . "-configuration.json";
if ($theType == "all") {
$fileName = "backup-" . $version . "_" . $nowtime . "-all.json";
}
if ($theType == "configuration") {
$tables = $this->getConfigTablesToBackupRestore();
} else {
@ -1786,7 +1789,6 @@ class Admin {
$pdo = DbUtils::openDbAndReturnPdoStatic();
$pdo->beginTransaction();
$genInfo = $this->getGeneralConfigItems(false, $pdo);
$version = $genInfo["version"];
@ -1808,6 +1810,12 @@ class Admin {
$typeIsOnlyConfig = false;
}
if ($table['table'] == "bill") {
$sql = "SET FOREIGN_KEY_CHECKS = 0";
$stmt = $pdo->prepare(DbUtils::substTableAlias($sql));
$stmt->execute();
}
foreach($tablecontent as $row) {
$cols = array();
$vals = array();
@ -1824,12 +1832,19 @@ class Admin {
$quests[] = '?';
}
$colstr = implode(",",$cols);
$queststr = implode(",",$quests);
$sql = "INSERT INTO $tablename ($colstr) VALUES ($queststr)";
$stmt = $pdo->prepare($this->dbutils->resolveTablenamesInSqlString($sql));
$stmt->execute($vals);
}
if ($table['table'] == "bill") {
$sql = "SET FOREIGN_KEY_CHECKS = 1";
$stmt = $pdo->prepare(DbUtils::substTableAlias($sql));
$stmt->execute();
}
}
if (!$typeIsOnlyConfig) {

View File

@ -1182,12 +1182,15 @@ function listOfTypesProds(ref) {
return li;
}
function createHigherLine(size) {
var li = '<li data-theme="f" data-icon="false"><a href="#" id="higherline" class="' + size + '"><i>&nbsp;</i>';
li += "<div class='typehigher'><img src='img/higher.png' /></div>";
li += "<div class='typetop'><img src='img/top.png' /></div>";
li += '</a></li>';
return li;
var txt = '<li data-theme="f" data-icon="false">';
txt += '<div class="ui-grid-a">';
txt += '<div class="ui-block-a typetop"><img src="img/top.png" /></div>';
txt += '<div class="ui-block-b typehigher"><img src="img/higher.png" /></div>';
txt += '</div>';
txt += '</li>';
return txt;
}
function createProdInfoTxt(prodid) {