OrderSprinter 1.2.11

This commit is contained in:
Geno 2020-11-19 23:00:31 +01:00
parent 7128cb4196
commit cd2ff7c097
30 changed files with 382 additions and 3015 deletions

Binary file not shown.

View File

@ -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.2.10"> <link rel="stylesheet" type="text/css" href="css/bestformat.css?v=1.2.11">
<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" />

View File

@ -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.2.10"> <link rel="stylesheet" type="text/css" href="css/bestformat.css?v=1.2.11">
<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" />

File diff suppressed because one or more lines are too long

View File

@ -6,12 +6,13 @@ function createProdTableHeaderLine() {
var txt = "<tr><th>Name" var txt = "<tr><th>Name"
+ "<th>Typ&nbsp;&nbsp;" + "<th>Typ&nbsp;&nbsp;"
+ "<th>Durchlauf Küche" + "<th>Durchlauf Küche"
+ "<th>Durchlauf Bereitst." + + "<th>Durchlauf Bereitst."
+ "<th>Drucker" + + "<th>Drucker" +
"<th id=shortnameheader class='prodheader'>Kurzname<th>Preis (A)" + "<th id=shortnameheader class='prodheader'>Kurzname<th>Preis (A)" +
"<th class='prodheader'>Preis (B)" + "<th class='prodheader'>Preis (B)" +
"<th class='prodheader'>Preis (C)" + "<th class='prodheader'>Preis (C)" +
"<th class='prodheader'>Steuersatz" + "<th class='prodheader'>Steuersatz" +
"<th class='prodheader'>Steuersatz Österreich" +
"<th class='prodheader'>Audio" + "<th class='prodheader'>Audio" +
"<th class='prodheader'>Verfügbar"; "<th class='prodheader'>Verfügbar";
return txt; return txt;
@ -26,7 +27,7 @@ function ident(depth) {
return txt; return txt;
} }
function newProduct(id, longname, shortname,priceA,priceB,priceC,tax,available,audio,favorite) { function newProduct(id, longname, shortname,priceA,priceB,priceC,tax,taxaustria,amount,available,audio,favorite) {
var product = { var product = {
id:id, id:id,
longname:longname, longname:longname,
@ -35,6 +36,8 @@ function newProduct(id, longname, shortname,priceA,priceB,priceC,tax,available,a
priceB: priceB, priceB: priceB,
priceC: priceC, priceC: priceC,
tax: tax, tax: tax,
taxaustria: taxaustria,
amount: amount,
available: available, available: available,
audio: audio, audio: audio,
favorite: favorite, favorite: favorite,
@ -49,6 +52,8 @@ function newProduct(id, longname, shortname,priceA,priceB,priceC,tax,available,a
+ "<td><input type='text' class='prodpriceB'></input>" + "<td><input type='text' class='prodpriceB'></input>"
+ "<td><input type='text' class='prodpriceC'></input>" + "<td><input type='text' class='prodpriceC'></input>"
+ "<td><input type='text' class='prodtax'></input>" + "<td><input type='text' class='prodtax'></input>"
+ "<td>" + this.createTaxAustriaSelection("prodtaxaustriasel_" + this.id)
+ "<td><input type='text' class='prodamount'></input>"
+ "<td>" + this.createAudioSelection(audiofiles,"audiosel_" + this.id) + "<td>" + this.createAudioSelection(audiofiles,"audiosel_" + this.id)
+ "<td>" + this.createAvailSelection("prodavail_" + this.id,PROD_NO,PROD_YES) + "<td>" + this.createAvailSelection("prodavail_" + this.id,PROD_NO,PROD_YES)
+ "<td>" + this.createAvailSelection("prodfav_" + this.id,PROD_NO,PROD_YES) + "<td>" + this.createAvailSelection("prodfav_" + this.id,PROD_NO,PROD_YES)
@ -63,6 +68,7 @@ function newProduct(id, longname, shortname,priceA,priceB,priceC,tax,available,a
$("#prodleaf_" + this.id + " input.prodpriceB").val(this.priceB); $("#prodleaf_" + this.id + " input.prodpriceB").val(this.priceB);
$("#prodleaf_" + this.id + " input.prodpriceC").val(this.priceC); $("#prodleaf_" + this.id + " input.prodpriceC").val(this.priceC);
$("#prodleaf_" + this.id + " input.prodtax").val(this.tax); $("#prodleaf_" + this.id + " input.prodtax").val(this.tax);
$("#prodleaf_" + this.id + " input.prodamount").val(this.amount);
}, },
createAudioSelection:function(audiofiles,id) { createAudioSelection:function(audiofiles,id) {
@ -88,6 +94,41 @@ function newProduct(id, longname, shortname,priceA,priceB,priceC,tax,available,a
} }
}, },
createOption:function(value,selected,txt) {
if (value == selected) {
return "<option value='" +value + "' selected>" + txt + "</option>";
} else {
return "<option value='" +value + "'>" + txt + "</option>";
}
},
createTaxAustriaSelection:function(id) {
var txt = "<select id='" + id + "'>";
if ((this.taxaustria == 0) || (this.taxaustria == 'null')) {
this.taxaustria = 1;
}
txt += this.createOption(1,this.taxaustria,"Steuersatz 'Normal'");
txt += this.createOption(2,this.taxaustria,"Steuersatz 'Ermäßigt 1'");
txt += this.createOption(3,this.taxaustria,"Steuersatz 'Ermäßigt 2'");
txt += this.createOption(4,this.taxaustria,"Steuersatz 'Besonders'");
txt += "</select>";
return txt;
},
createTaxAustriaSel:function(id) {
var visi = ""
if (austria == 0) {
visi = " style='display:none;' ";
}
var txt = '<p><div data-role="fieldcontain" ' + visi + '>'
+ '<label for="' + id + '">Steuersatz Österreich:</label>'
+ this.createTaxAustriaSelection(id)
+ '</div></p>';
return txt;
},
createFavoriteSelection:function(id,text0,text1) { createFavoriteSelection:function(id,text0,text1) {
if (this.favorite == 1) { if (this.favorite == 1) {
return "<select id=" + id + "><option value=0>" + text0[lang] + "</option><option value=1 selected>" + text1[lang] + "</option></select>"; return "<select id=" + id + "><option value=0>" + text0[lang] + "</option><option value=1 selected>" + text1[lang] + "</option></select>";
@ -138,6 +179,12 @@ function newProduct(id, longname, shortname,priceA,priceB,priceC,tax,available,a
+ createInputField("prodtax_" + this.id,"prodtax_input_" + this.id,"tax") + createInputField("prodtax_" + this.id,"prodtax_input_" + this.id,"tax")
+ '</div></p>' + '</div></p>'
+ createInputField("prodamount_" + this.id,"prodamount_input_" + this.id,"amount")
+ "<div id=prodtaxaustriadiv_" + this.id + ">"
+ this.createTaxAustriaSel("taxaustriasel_" + this.id)
+ "</div>"
+ "<div id=audiocont_" + this.id + ">" + "<div id=audiocont_" + this.id + ">"
+ this.createMobileAudioSel(audiofiles,"audiosel_" + this.id) + this.createMobileAudioSel(audiofiles,"audiosel_" + this.id)
+ "</div>" + "</div>"
@ -179,6 +226,8 @@ function newProduct(id, longname, shortname,priceA,priceB,priceC,tax,available,a
$("#prodpriceB_" + this.id).html(PROD_PRICE[lang] + ' (B)'); $("#prodpriceB_" + this.id).html(PROD_PRICE[lang] + ' (B)');
$("#prodpriceC_" + this.id).html(PROD_PRICE[lang] + ' (C)'); $("#prodpriceC_" + this.id).html(PROD_PRICE[lang] + ' (C)');
$("#prodtax_" + this.id).html(PROD_TAX[lang]); $("#prodtax_" + this.id).html(PROD_TAX[lang]);
$("#prodtaxaustria_" + this.id).html(PROD_TAXAUSTRIA[lang]);
$("#prodamount_" + this.id).html(PROD_AMOUNT[lang]);
$("#prodpriceA_input_" + this.id).val(this.priceA.toString().replace(".",decpoint)); $("#prodpriceA_input_" + this.id).val(this.priceA.toString().replace(".",decpoint));
$("#prodpriceB_input_" + this.id).val(this.priceB.toString().replace(".",decpoint)); $("#prodpriceB_input_" + this.id).val(this.priceB.toString().replace(".",decpoint));
$("#prodpriceC_input_" + this.id).val(this.priceC.toString().replace(".",decpoint)); $("#prodpriceC_input_" + this.id).val(this.priceC.toString().replace(".",decpoint));
@ -187,6 +236,10 @@ function newProduct(id, longname, shortname,priceA,priceB,priceC,tax,available,a
$("#prodtax_input_" + this.id).val(this.tax.toString().replace(".",decpoint)); $("#prodtax_input_" + this.id).val(this.tax.toString().replace(".",decpoint));
} }
if (this.amount != "null") {
$("#prodamount_input_" + this.id).val(this.amount.toString().replace(".",decpoint));
}
$("#availcont_" + this.id).html(this.createMobileAvail("prodavail_" + this.id,PROD_AVAILABLE[lang])); $("#availcont_" + this.id).html(this.createMobileAvail("prodavail_" + this.id,PROD_AVAILABLE[lang]));
$("#favcont_" + this.id).html(this.createMobileFavorite("prodfav_" + this.id,PROD_FAVORITE[lang])); $("#favcont_" + this.id).html(this.createMobileFavorite("prodfav_" + this.id,PROD_FAVORITE[lang]));
$("#audiocont_" + this.id).html(this.createMobileAudioSel(audiofiles,"audiosel_" + this.id)); $("#audiocont_" + this.id).html(this.createMobileAudioSel(audiofiles,"audiosel_" + this.id));

View File

@ -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.2.10"> <link rel="stylesheet" type="text/css" href="css/bestformat.css?v=1.2.11">
<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" />

View File

@ -6,8 +6,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.2.10"> <link rel="stylesheet" type="text/css" href="css/bestformat.css?v=1.2.11">
<link rel="stylesheet" type="text/css" href="css/numfield.css?v=1.2.10"> <link rel="stylesheet" type="text/css" href="css/numfield.css?v=1.2.11">
<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" />

View File

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

View File

@ -1445,6 +1445,37 @@ return false;
} }
} }
function updateUserTable1210_1211($prefix, $version, $dbname) {
$pdo = $this->pdo;
try {
if ($version != "1.2.10") {
$ret = $this->updateUserTable1209_1210($prefix, $version, $dbname);
if (!$ret) {
return false;
}
}
DbUtils::overrulePrefix($prefix);
$sql = "INSERT INTO `%config%` (`id` , `name`, `setting`) VALUES (NULL,?,?)";
$stmt = $pdo->prepare($this->basedb->resolveTablenamesInSqlString($sql));
$stmt->execute(array('taxaustrianormal','20.0'));
$stmt->execute(array('taxaustriaerm1','10.0'));
$stmt->execute(array('taxaustriaerm2','13.0'));
$stmt->execute(array('taxaustriaspecial','19.0'));
$this->execSql($pdo, "ALTER TABLE %products% ADD taxaustria INT (1) NULL AFTER tax");
$this->execSql($pdo, "ALTER TABLE %products% ADD amount INT (5) NULL AFTER taxaustria");
$this->execSql($pdo, "ALTER TABLE %histprod% ADD taxaustria INT (1) NULL AFTER tax");
$this->execSql($pdo, "ALTER TABLE %queue% ADD taxaustria INT (1) NULL AFTER tax");
$this->updateVersion($pdo, '1.2.11');
return true;
} catch (PDOException $e) {
return false;
}
}
function setVersion($prefix,$theVersion) { function setVersion($prefix,$theVersion) {
$pdo = $this->pdo; $pdo = $this->pdo;
try { try {
@ -1543,6 +1574,10 @@ $this->basedb->doSQL($pdo,"INSERT INTO `%pricelevel%` (`id` , `name`,`info`,`inf
$this->basedb->doSQL($pdo,"INSERT INTO `%config%` (`id` , `name`, `setting`) VALUES (NULL , 'pricelevel', '1')"); $this->basedb->doSQL($pdo,"INSERT INTO `%config%` (`id` , `name`, `setting`) VALUES (NULL , 'pricelevel', '1')");
$this->basedb->doSQL($pdo,"INSERT INTO `%config%` (`id` , `name`, `setting`) VALUES (NULL , 'tax', '19.0')"); $this->basedb->doSQL($pdo,"INSERT INTO `%config%` (`id` , `name`, `setting`) VALUES (NULL , 'tax', '19.0')");
$this->basedb->doSQL($pdo,"INSERT INTO `%config%` (`id` , `name`, `setting`) VALUES (NULL , 'togotax', '7.0')"); $this->basedb->doSQL($pdo,"INSERT INTO `%config%` (`id` , `name`, `setting`) VALUES (NULL , 'togotax', '7.0')");
$this->basedb->doSQL($pdo,"INSERT INTO `%config%` (`id` , `name`, `setting`) VALUES (NULL , 'taxaustrianormal', '20.0')");
$this->basedb->doSQL($pdo,"INSERT INTO `%config%` (`id` , `name`, `setting`) VALUES (NULL , 'taxaustriaerm1', '10.0')");
$this->basedb->doSQL($pdo,"INSERT INTO `%config%` (`id` , `name`, `setting`) VALUES (NULL , 'taxaustriaerm2', '13.0')");
$this->basedb->doSQL($pdo,"INSERT INTO `%config%` (`id` , `name`, `setting`) VALUES (NULL , 'taxaustriaspecial', '19.0')");
$this->basedb->doSQL($pdo,"INSERT INTO `%config%` (`id` , `name`, `setting`) VALUES (NULL , 'stornocode', '123')"); $this->basedb->doSQL($pdo,"INSERT INTO `%config%` (`id` , `name`, `setting`) VALUES (NULL , 'stornocode', '123')");
$this->basedb->doSQL($pdo,"INSERT INTO `%config%` (`id` , `name`, `setting`) VALUES (NULL , 'printpass', '$printpass')"); $this->basedb->doSQL($pdo,"INSERT INTO `%config%` (`id` , `name`, `setting`) VALUES (NULL , 'printpass', '$printpass')");
$this->basedb->doSQL($pdo,"INSERT INTO `%config%` (`id` , `name`, `setting`) VALUES (NULL , 'companyinfo', 'Musterrestaurant\nBeispielstrasse 123\n12345 Musterort')"); $this->basedb->doSQL($pdo,"INSERT INTO `%config%` (`id` , `name`, `setting`) VALUES (NULL , 'companyinfo', 'Musterrestaurant\nBeispielstrasse 123\n12345 Musterort')");
@ -1558,7 +1593,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.2.10')"); $this->basedb->doSQL($pdo,"INSERT INTO `%config%` (`id` , `name`, `setting`) VALUES (NULL , 'version', '1.2.11')");
$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')");
@ -1927,7 +1962,7 @@ $zones[] = $timezone_identifiers[$i];
echo json_encode($zones); echo json_encode($zones);
} else if ($command == 'update') { } else if ($command == 'update') {
$installerVersion = "1.2.10"; $installerVersion = "1.2.11";
$admin = new InstallAdmin(); $admin = new InstallAdmin();
$pdo = $admin->openDbAndReturnPdo($_POST['host'],$_POST['db'],$_POST['user'],$_POST['password']); $pdo = $admin->openDbAndReturnPdo($_POST['host'],$_POST['db'],$_POST['user'],$_POST['password']);
@ -1957,7 +1992,7 @@ $supportedVersions = array("1.0.22","1.0.23","1.0.24","1.0.25","1.0.26","1.0.27"
"1.0.40","1.0.41","1.0.42","1.0.43", "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.11","1.1.12","1.1.13","1.1.14","1.1.15","1.1.16","1.1.17", "1.1.0","1.1.1","1.1.2","1.1.3","1.1.4","1.1.5","1.1.6","1.1.7","1.1.8", "1.1.9","1.1.10","1.1.11","1.1.12","1.1.13","1.1.14","1.1.15","1.1.16","1.1.17",
"1.1.18","1.1.19","1.1.20","1.1.21","1.1.22","1.1.23","1.1.24","1.1.25","1.1.26","1.1.27","1.1.28","1.1.29","1.1.30", "1.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.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"
); );
if (!in_array($version, $supportedVersions)) { if (!in_array($version, $supportedVersions)) {
@ -1965,7 +2000,7 @@ echo json_encode("Quellversion nicht unterstützt");
return; return;
} }
$ret = $admin->updateUserTable1209_1210($_POST['prefix'], $version, $_POST['db']); $ret = $admin->updateUserTable1210_1211($_POST['prefix'], $version, $_POST['db']);
if(session_id() == '') { if(session_id() == '') {
session_start(); session_start();

View File

@ -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.2.10"> <link rel="stylesheet" type="text/css" href="css/bestformat.css?v=1.2.11">
<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" />

View File

@ -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.2.10"> <link rel="stylesheet" type="text/css" href="css/bestformat.css?v=1.2.11">
<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" />
@ -247,18 +247,18 @@ var MAN_SMTPSECURE = ["SMTP-Protokoll","SMTP Protocol","SMTP Seguridad"];
var MAN_SMTPPORT = ["SMTP-Port","SMTP Port","SMTP Port"]; var MAN_SMTPPORT = ["SMTP-Port","SMTP Port","SMTP Port"];
var MAN_WEBIMPRESSUM = ["Webimpressum","Web company info","www café info"]; var MAN_WEBIMPRESSUM = ["Webimpressum","Web company info","www café info"];
var MAN_TAX_ASSIGN = ["Umsatzsteuer-Zuweisung","Taxes assigment","Asignar impuestos"]; var MAN_TAX_ASSIGN = ["Umsatzsteuer-Zuweisung","Taxes assigment","Asignar impuestos"];
var MAN_TAX_ASS_DESC = ["An dieser Stelle können pauschal zwei unterschiedliche Steuersätze den Speisen und den Getränken zugewiesen werden. Das ist vor allem für die Nutzung der Software in Ländern wie Österreich interessant.", var MAN_TAX_ASS_DESC = ["An dieser Stelle können pauschal zwei unterschiedliche Steuersätze den Speisen und den Getränken zugewiesen werden. Das ist für die Nutzung der Software in Österreich interessant. <b>Die Zuweisungen wirken sich nur im Betriebsmodus 'Österreich' aus!</b></b>",
"At this place it is possible to assign two different taxes to the foods and to the drinks. This is of interest for the use of this software in countries like Austria", "At this place it is possible to assign two different taxes to the foods and to the drinks. This is of interest for the use of this software in Austria. <b>Only in the mode 'Austria' the assignment are used!</b>",
"En esta locación se puede asignar impuestos diferentes a comidas y a bebidas" "En esta locación se puede asignar impuestos diferentes a comidas y a bebidas"
]; ];
var MAN_TAX_ASS_DESC2 = ["Wenn den Produkten kein spezifischer Steuersatz zugeordnet ist, wird für Tischbestellungen der normale Steuersatz und für Außer-Haus-Bestellungen der ToGo-Steuersatz verwendet.", var MAN_TAX_ASS_DESC2 = ["(Die vorausgewählten Werte stellen nicht die aktuelle Zuweisung dar.)",
"If you do not assign a specific tax to products the normal tax (table order) or togo tax is applied.", "(The displayed values do not show the current assignments.)",
"Si no ha asignado un IVA a productos, la IVA normal (order a la mesa) or la IVA para llevar esta aplicada."]; "(Los valores mostrados no son los valores asignados de momento.)"];
var MAN_FOOD = ["Speisen/Küche","Food/Kitchen","Comidas/Cocina"]; var MAN_FOOD = ["Speisen/Küche","Food/Kitchen","Comidas/Cocina"];
var MAN_DRINKS = ["Getränke/Bar","Beverage/Bar","Bebidas/Bar"]; var MAN_DRINKS = ["Getränke/Bar","Beverage/Bar","Bebidas/Bar"];
var MAN_WRONG_NUMBER_FORMAT = ["Zuweisung unmöglich. Stimmt das Zahlenformat?","Assignment impossible. Is the number format correct?","Asignar no es posible. Es corecto el formato de los numeros?"]; var MAN_WRONG_NUMBER_FORMAT = ["Zuweisung unmöglich. Stimmt das Zahlenformat?","Assignment impossible. Is the number format correct?","Asignar no es posible. Es corecto el formato de los numeros?"];
var MAN_TAX_USE = ["Wenn kein Steuersatz beim Produkt angegeben ist: MwSt/Tax/IVA für Tischbestellungen, -Togo für Außer-Haus-Verkauf.", var MAN_TAX_USE = ["Wenn kein Steuersatz beim Produkt angegeben ist: MwSt/Tax/IVA für Tischbestellungen, -Togo für Außer-Haus-Verkauf. <b>Für Österreich gelten andere Steuersätze</b>, siehe Einstellungen unten!",
"If no tax is specified for a product, these tax settings are used.", "If no tax is specified for a product, these tax settings are used. <b>For Austria other tax settings are relevant</b>, see above!",
"Si no un producto no tiene un IVA asignado, se usa estas IVAs"]; "Si no un producto no tiene un IVA asignado, se usa estas IVAs"];
var MAN_CANCEL_UNPAID_CODE = ["Stornierungscode unbez. Best.", "Cancel code unpaid items","Codigo para cancelor productos impagados"]; var MAN_CANCEL_UNPAID_CODE = ["Stornierungscode unbez. Best.", "Cancel code unpaid items","Codigo para cancelor productos impagados"];
@ -304,6 +304,10 @@ var unpaidTables = "";
var generalValuesSettings = [ var generalValuesSettings = [
["usstval","MwSt","i",2,"Mehrwertsteuer ist kein Zahlenwert"], ["usstval","MwSt","i",2,"Mehrwertsteuer ist kein Zahlenwert"],
["togotaxval","ToGo-MwSt","i",2,"Togo-Mehrwertsteuer ist kein Zahlenwert"], ["togotaxval","ToGo-MwSt","i",2,"Togo-Mehrwertsteuer ist kein Zahlenwert"],
["taxaustrianormalval","Österreich Steuer 'Normal'","i",2,"Angabe Österreich-Steuersatz 'normal' ist kein Zahlenwert"],
["taxaustriaerm1val","Österreich Steuer 'Ermäßigt 1'","i",2,"Angabe Österreich-Steuersatz 'Ermäßigt 1' ist kein Zahlenwert"],
["taxaustriaerm2val","Österreich Steuer 'Ermäßigt 2'","i",2,"Angabe Österreich-Steuersatz 'Ermäßigt 2' ist kein Zahlenwert"],
["taxaustriaspecialval","Österreich Steuer 'Besonders'","i",2,"Angabe Österreich-Steuersatz 'Besonders' ist kein Zahlenwert"],
["stornocode","Stornocode","i",1,"Stornocode wurde nicht angegeben!"], ["stornocode","Stornocode","i",1,"Stornocode wurde nicht angegeben!"],
["printpass","Printcode","i",1,"Printcode wurde nicht angegeben"], ["printpass","Printcode","i",1,"Printcode wurde nicht angegeben"],
["companyinfo","Betriebsinfo","i",0], ["companyinfo","Betriebsinfo","i",0],
@ -496,6 +500,11 @@ 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");
} }
function saveValueIntoForm(aValue, decpoint, formid) {
var formattedVal = aValue.replace(".", decpoint);
$(formid).val(formattedVal);
}
function insertGeneralConfigItems(configResult) { function insertGeneralConfigItems(configResult) {
if (configResult.status == "OK") { if (configResult.status == "OK") {
var values = configResult.msg; var values = configResult.msg;
@ -504,13 +513,12 @@ function insertGeneralConfigItems(configResult) {
var decpoint = values.decpoint; var decpoint = values.decpoint;
$("#admin-page").data("decpoint",values.decpoint); $("#admin-page").data("decpoint",values.decpoint);
var taxval = values.tax; saveValueIntoForm(values.tax,decpoint,"#usstval");
var usstGerVal = taxval.replace(".", decpoint); saveValueIntoForm(values.togotax,decpoint,"#togotaxval");
$("#usstval").val(usstGerVal); saveValueIntoForm(values.taxaustrianormal,decpoint,"#taxaustrianormalval");
saveValueIntoForm(values.taxaustriaerm1,decpoint,"#taxaustriaerm1val");
taxval = values.togotax; saveValueIntoForm(values.taxaustriaerm2,decpoint,"#taxaustriaerm2val");
usstGerVal = taxval.replace(".", decpoint); saveValueIntoForm(values.taxaustriaspecial,decpoint,"#taxaustriaspecialval");
$("#togotaxval").val(usstGerVal);
$("#companyinfo").val(values.companyinfo); $("#companyinfo").val(values.companyinfo);
$("#rectemplate").val(values.rectemplate); $("#rectemplate").val(values.rectemplate);
@ -1220,11 +1228,11 @@ function binding() {
$("#taxass_apply").off("click").on("click", function (e) { $("#taxass_apply").off("click").on("click", function (e) {
e.stopImmediatePropagation(); e.stopImmediatePropagation();
e.preventDefault(); e.preventDefault();
var foodTax = $("#taxesassfood").val().trim(); var foodTax = $("#taxesassfood option:selected").val();
if (foodTax == "") { if (foodTax == "") {
foodTax = -1; foodTax = -1;
} }
var drinksTax = $("#taxesassdrinks").val().trim(); var drinksTax = $("#taxesassdrinks option:selected").val();
if (drinksTax == "") { if (drinksTax == "") {
drinksTax = -1; drinksTax = -1;
} }
@ -2472,6 +2480,26 @@ $(document).on("pageinit", "#admin-page", function () {
<label for="certificatesn"><span id="certificatesntxt">Zert.Seriennummer:</span></label> <label for="certificatesn"><span id="certificatesntxt">Zert.Seriennummer:</span></label>
<input type="text" value="" data-mini="true" placeholder="1234567" id="certificatesn" data-theme="c" class="genConfigEl"/> <input type="text" value="" data-mini="true" placeholder="1234567" id="certificatesn" data-theme="c" class="genConfigEl"/>
</div> </div>
<div data-role="fieldcontain">
<label for="taxaustrianormalval">Steuersatz 'Normal':</label>
<input type="text" value="" data-mini="true" placeholder="7,0" id="taxaustrianormalval" data-theme="c" class="genConfigEl"/>
</div>
<div data-role="fieldcontain">
<label for="taxaustriaerm1val">Steuersatz 'Ermäßigt-1':</label>
<input type="text" value="" data-mini="true" placeholder="7,0" id="taxaustriaerm1val" data-theme="c" class="genConfigEl"/>
</div>
<div data-role="fieldcontain">
<label for="taxaustriaerm2val">Steuersatz 'Ermäßigt-2':</label>
<input type="text" value="" data-mini="true" placeholder="7,0" id="taxaustriaerm2val" data-theme="c" class="genConfigEl"/>
</div>
<div data-role="fieldcontain">
<label for="taxaustriaspecialval">Steuersatz 'Besonders':</label>
<input type="text" value="" data-mini="true" placeholder="7,0" id="taxaustriaspecialval" data-theme="c" class="genConfigEl"/>
</div>
</div> </div>
<button type="submit" data-theme="f" data-icon="check" id="changeConfig">Ändern</button> <button type="submit" data-theme="f" data-icon="check" id="changeConfig">Ändern</button>
@ -2559,6 +2587,8 @@ $(document).on("pageinit", "#admin-page", function () {
<li><b>Fixsteuersatz</b>: Es ist möglich, einem Produkt einen fixen Umsatzsteuersatz zuzuordnen, so dass das Produkt bei der Bestellung <li><b>Fixsteuersatz</b>: Es ist möglich, einem Produkt einen fixen Umsatzsteuersatz zuzuordnen, so dass das Produkt bei der Bestellung
unabhängig von der Zuordnung <i>Tischbestellung</i> oder <i>Außer-Haus-Bestellung</i> immer den hier zugeordneten Steuersatz zugeordnet unabhängig von der Zuordnung <i>Tischbestellung</i> oder <i>Außer-Haus-Bestellung</i> immer den hier zugeordneten Steuersatz zugeordnet
bekommt. bekommt.
<li><b>Steuersatz-Austria</b>: Diese Einstellung ist für Österreichische Betriebe wichtig: 1: Steuersatz 'Normal', 2: Ermäßigt-1, 3: Ermäßigt-2, 4: Steuersatz 'Besonders'. Ist der Betriebsmodus 'Österreich' ausgewählt, so wird <u><i>immer</i></u> dieser Steuersatz verwendet.
<li><b>Menge</b>: Die verfügbare Menge. Bei jeder Bestellung wird die Anzahl um 1 vermindert. Kurz vor Erreichen der Anzahl 0 bekommt der Kellner einen Warnhinweis bei dem Produkt.
</ul> </ul>
<p>Ein Produkteintrag mit weiteren Eigenschaften kann beispielsweise so aussehen: <p>Ein Produkteintrag mit weiteren Eigenschaften kann beispielsweise so aussehen:
@ -2626,8 +2656,22 @@ $(document).on("pageinit", "#admin-page", function () {
<p id="taxesassdescr2"></p> <p id="taxesassdescr2"></p>
<p> <p>
<table> <table>
<tr><td><span id=taxesfoodtxt></span> (%): <td><input type="text" id="taxesassfood" size="3" data-theme="a" placeholder="10" /></tr> <tr><td><span id=taxesfoodtxt></span> (%): <td>
<tr><td><span id=taxesdrinkstxt></span> (%): <td><input type="text" id="taxesassdrinks" size="3" data-theme="a" placeholder="20" /></tr> <select id='taxesassfood'>
<option value='1'>Steuersatz 'Normal'</option>
<option value='2'>Steuersatz 'Ermäßigt-1'</option>
<option value='3'>Steuersatz 'Ermäßigt-2'</option>
<option value='4'>Steuersatz 'Besonders'</option>
</select>
</tr>
<tr><td><span id=taxesdrinkstxt></span> (%): <td>
<select id='taxesassdrinks'>
<option value='1'>Steuersatz 'Normal'</option>
<option value='2'>Steuersatz 'Ermäßigt-1'</option>
<option value='3'>Steuersatz 'Ermäßigt-2'</option>
<option value='4'>Steuersatz 'Besonders'</option>
</select>
</tr>
<tr><td colspan=2><button type="submit" data-theme="e" id="taxass_apply"><span id=taxapplytxt>Anwenden</span></button></tr> <tr><td colspan=2><button type="submit" data-theme="e" id="taxass_apply"><span id=taxapplytxt>Anwenden</span></button></tr>
</table> </table>
</p> </p>

File diff suppressed because one or more lines are too long

View File

@ -707,7 +707,7 @@ class Admin {
return; return;
} }
$configItems = join(",",array("'decpoint'","'version'","'cancelunpaidcode'","'tax'","'togotax'","'currency'","'workflowconfig'","'prominentsearch'","'discount1'","'discount2'","'discount3'","'waitergopayprint'")); $configItems = join(",",array("'decpoint'","'version'","'cancelunpaidcode'","'tax'","'togotax'","'taxaustrianormal'","'taxaustriaerm1'","'taxaustriaerm2'","'taxaustriaspecial'","'currency'","'workflowconfig'","'prominentsearch'","'discount1'","'discount2'","'discount3'","'waitergopayprint'"));
$sql = "select name,setting FROM %config% WHERE name in ($configItems)"; $sql = "select name,setting FROM %config% WHERE name in ($configItems)";
$stmt = $pdo->prepare(DbUtils::substTableAlias($sql)); $stmt = $pdo->prepare(DbUtils::substTableAlias($sql));
$stmt->execute(); $stmt->execute();
@ -797,6 +797,22 @@ class Admin {
$row = $stmt->fetchObject(); $row = $stmt->fetchObject();
$togotax = $row->setting; $togotax = $row->setting;
$stmt->execute(array("taxaustrianormal"));
$row = $stmt->fetchObject();
$taxaustrianormal = $row->setting;
$stmt->execute(array("taxaustriaerm1"));
$row = $stmt->fetchObject();
$taxaustriaerm1 = $row->setting;
$stmt->execute(array("taxaustriaerm2"));
$row = $stmt->fetchObject();
$taxaustriaerm2 = $row->setting;
$stmt->execute(array("taxaustriaspecial"));
$row = $stmt->fetchObject();
$taxaustriaspecial = $row->setting;
$stmt->execute(array("serverurl")); $stmt->execute(array("serverurl"));
$row = $stmt->fetchObject(); $row = $stmt->fetchObject();
$serverurl = $row->setting; $serverurl = $row->setting;
@ -954,6 +970,7 @@ class Admin {
"version" => $version, "decpoint" => $decpoint, "version" => $version, "decpoint" => $decpoint,
"serverurl" => $serverurl, "email" => $email, "receiveremail" => $receiveremail, "billlanguage" => $billlanguage, "serverurl" => $serverurl, "email" => $email, "receiveremail" => $receiveremail, "billlanguage" => $billlanguage,
"payprinttype" => $payprinttype, "tax" => $tax, "togotax" => $togotax, "currency" => $currency, "payprinttype" => $payprinttype, "tax" => $tax, "togotax" => $togotax, "currency" => $currency,
"taxaustrianormal" => $taxaustrianormal, "taxaustriaerm1" => $taxaustriaerm1, "taxaustriaerm2" => $taxaustriaerm2, "taxaustriaspecial" => $taxaustriaspecial,
"userlanguage" => $userlang, "receiptprinter" => $receiptprinter, "userlanguage" => $userlang, "receiptprinter" => $receiptprinter,
"receiptfontsize" => $receiptfontsize, "reservationnote" => $reservationnote, "paymentconfig" => $paymentconfig, "receiptfontsize" => $receiptfontsize, "reservationnote" => $reservationnote, "paymentconfig" => $paymentconfig,
"workflowconfig" => $workflowconfig, "emailratingcontact" => $emailratingcontact,"emailbadrating" => $emailbadrating, "workflowconfig" => $workflowconfig, "emailratingcontact" => $emailratingcontact,"emailbadrating" => $emailbadrating,
@ -1074,7 +1091,7 @@ class Admin {
$view = "preferences.html"; $view = "preferences.html";
} }
echo json_encode($view . "?v=1.2.10"); echo json_encode($view . "?v=1.2.11");
} }
} }
@ -1169,18 +1186,7 @@ class Admin {
$pdo->beginTransaction(); $pdo->beginTransaction();
try { try {
if ($foodTax < 0) { $sql = "UPDATE %products%,%prodtype% SET %products%.taxaustria=? WHERE %products%.category=%prodtype%.id AND %prodtype%.kind=? AND %products%.removed is null AND %prodtype%.removed is null";
$foodTax = null;
} else {
$foodTax = str_replace(",",".",$foodTax);
}
if ($drinksTax < 0) {
$drinksTax = null;
} else {
$drinksTax = str_replace(",",".",$drinksTax);
}
$sql = "UPDATE %products%,%prodtype% SET %products%.tax=? WHERE %products%.category=%prodtype%.id AND %prodtype%.kind=? AND %products%.removed is null AND %prodtype%.removed is null";
$stmt = $pdo->prepare(DbUtils::substTableAlias($sql)); $stmt = $pdo->prepare(DbUtils::substTableAlias($sql));
$stmt->execute(array($foodTax,0)); $stmt->execute(array($foodTax,0));
@ -1291,24 +1297,24 @@ class Admin {
if (!self::isOnlyRatingUser($rights, $right_rating, true)) { if (!self::isOnlyRatingUser($rights, $right_rating, true)) {
if ($_SESSION['modus'] == 0) { if ($_SESSION['modus'] == 0) {
if ($_SESSION['right_waiter']) { $mainMenu[] = array("name" => $waitertxt[$lang], "link" => "waiter.html?v=1.2.10"); }; if ($_SESSION['right_waiter']) { $mainMenu[] = array("name" => $waitertxt[$lang], "link" => "waiter.html?v=1.2.11"); };
} else { } else {
if ($_SESSION['right_waiter']) { $mainMenu[] = array("name" => $waiterdesktxt[$lang], "link" => "waiterdesktop.php?v=1.2.10"); }; if ($_SESSION['right_waiter']) { $mainMenu[] = array("name" => $waiterdesktxt[$lang], "link" => "waiterdesktop.php?v=1.2.11"); };
} }
if ($_SESSION['right_kitchen']) { $mainMenu[] = array("name" => $kitchentxt[$lang], "link" => "kitchen.html?v=1.2.10"); }; if ($_SESSION['right_kitchen']) { $mainMenu[] = array("name" => $kitchentxt[$lang], "link" => "kitchen.html?v=1.2.11"); };
if ($_SESSION['right_bar']) { $mainMenu[] = array("name" => "Bar", "link" => "bar.html?v=1.2.10"); }; if ($_SESSION['right_bar']) { $mainMenu[] = array("name" => "Bar", "link" => "bar.html?v=1.2.11"); };
if ($_SESSION['right_supply']) { $mainMenu[] = array("name" => $supplytxt[$lang], "link" => "supplydesk.html?v=1.2.10"); }; if ($_SESSION['right_supply']) { $mainMenu[] = array("name" => $supplytxt[$lang], "link" => "supplydesk.html?v=1.2.11"); };
if ($_SESSION['modus'] == 0) { if ($_SESSION['modus'] == 0) {
if ($_SESSION['right_paydesk']) { $mainMenu[] = array("name" => $paydesktxt[$lang], "link" => "paydesk.html?v=1.2.10"); }; if ($_SESSION['right_paydesk']) { $mainMenu[] = array("name" => $paydesktxt[$lang], "link" => "paydesk.html?v=1.2.11"); };
} }
if ($_SESSION['right_statistics']) { $mainMenu[] = array("name" => $stattxt[$lang], "link" => "reports.html?v=1.2.10"); }; if ($_SESSION['right_statistics']) { $mainMenu[] = array("name" => $stattxt[$lang], "link" => "reports.html?v=1.2.11"); };
if ($_SESSION['right_bill']) { $mainMenu[] = array("name" => $bontxt[$lang], "link" => "bill.html?v=1.2.10"); }; if ($_SESSION['right_bill']) { $mainMenu[] = array("name" => $bontxt[$lang], "link" => "bill.html?v=1.2.11"); };
if ($_SESSION['right_products']) { $mainMenu[] = array("name" => $prodtxt[$lang], "link" => "products.html?v=1.2.10"); }; if ($_SESSION['right_products']) { $mainMenu[] = array("name" => $prodtxt[$lang], "link" => "products.html?v=1.2.11"); };
if ($_SESSION['right_reservation']) { $mainMenu[] = array("name" => $restxt[$lang], "link" => "reservation.html?v=1.2.10"); }; if ($_SESSION['right_reservation']) { $mainMenu[] = array("name" => $restxt[$lang], "link" => "reservation.html?v=1.2.11"); };
if ($_SESSION['right_rating']) { $mainMenu[] = array("name" => $ratingtxt[$lang], "link" => "rating.html?v=1.2.10"); }; if ($_SESSION['right_rating']) { $mainMenu[] = array("name" => $ratingtxt[$lang], "link" => "rating.html?v=1.2.11"); };
if ($_SESSION['right_manager'] || $_SESSION['is_admin'] || $_SESSION['right_closing']) { $mainMenu[] = array("name" => $admintxt[$lang], "link" => "manager.html?v=1.2.10"); }; if ($_SESSION['right_manager'] || $_SESSION['is_admin'] || $_SESSION['right_closing']) { $mainMenu[] = array("name" => $admintxt[$lang], "link" => "manager.html?v=1.2.11"); };
$mainMenu[] = array("name" => $settingtxt[$lang], "link" => "preferences.html?v=1.2.10"); $mainMenu[] = array("name" => $settingtxt[$lang], "link" => "preferences.html?v=1.2.11");
$mainMenu[] = array("name" => "Feedback", "link" => "feedback.html?v=1.2.10"); $mainMenu[] = array("name" => "Feedback", "link" => "feedback.html?v=1.2.11");
} }
$mainMenu[] = array("name" => $logout[$lang], "link" => "logout.php"); $mainMenu[] = array("name" => $logout[$lang], "link" => "logout.php");
@ -1317,7 +1323,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.2.10", $mainMenuAndVersion = array ("version" => "OrderSprinter 1.2.11",
"user" => $currentUser, "user" => $currentUser,
"menu" => $mainMenu, "menu" => $mainMenu,
"waitermessage" => $waiterMessage, "waitermessage" => $waiterMessage,
@ -1522,6 +1528,10 @@ class Admin {
$assoc_vals = array( $assoc_vals = array(
"usstval" => array("dbcol" => "tax","checknum" => 1), "usstval" => array("dbcol" => "tax","checknum" => 1),
"togotaxval" => array("dbcol" => "togotax","checknum" => 1), "togotaxval" => array("dbcol" => "togotax","checknum" => 1),
"taxaustrianormalval" => array("dbcol" => "taxaustrianormal","checknum" => 1),
"taxaustriaerm1val" => array("dbcol" => "taxaustriaerm1","checknum" => 1),
"taxaustriaerm2val" => array("dbcol" => "taxaustriaerm2","checknum" => 1),
"taxaustriaspecialval" => array("dbcol" => "taxaustriaspecial","checknum" => 1),
"stornocode" => array("dbcol" => "stornocode","checknum" => 0), "stornocode" => array("dbcol" => "stornocode","checknum" => 0),
"printpass" => array("dbcol" => "printpass","checknum" => 0), "printpass" => array("dbcol" => "printpass","checknum" => 0),
"companyinfo" => array("dbcol" => "companyinfo","checknum" => 0), "companyinfo" => array("dbcol" => "companyinfo","checknum" => 0),

View File

@ -327,6 +327,13 @@ class Bill {
return $out; return $out;
} }
public function getAustriaTaxes($pdo,$billid) {
$sql = "select tax,IF(taxaustria is not null, taxaustria, 0) as taxaustria,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 taxaustria";
$stmt = $pdo->prepare(DbUtils::substTableAlias($sql));
$stmt->execute(array($billid));
$result = $stmt->fetchAll(PDO::FETCH_OBJ);
return $result;
}
/* /*
* insert or take out cash money. The direction done by sign of $money value * insert or take out cash money. The direction done by sign of $money value

View File

@ -286,13 +286,17 @@ class CommonUtils {
if ($row->countid == 0) { if ($row->countid == 0) {
return $default; return $default;
} else { } else {
self::getExistingConfigValue($pdo, $item);
}
}
public static function getExistingConfigValue($pdo,$item) {
$sql = "SELECT setting FROM %config% WHERE name=?"; $sql = "SELECT setting FROM %config% WHERE name=?";
$stmt = $pdo->prepare(DbUtils::substTableAlias($sql)); $stmt = $pdo->prepare(DbUtils::substTableAlias($sql));
$stmt->execute(array($item)); $stmt->execute(array($item));
$row = $stmt->fetchObject(); $row = $stmt->fetchObject();
return $row->setting; return $row->setting;
} }
}
public static function callPlugin($pdo,$fct,$condition) { public static function callPlugin($pdo,$fct,$condition) {
try { try {

View File

@ -197,6 +197,8 @@ class DbUtils {
array("col" => 'priceB', "hist" => 1), array("col" => 'priceB', "hist" => 1),
array("col" => 'priceC', "hist" => 1), array("col" => 'priceC', "hist" => 1),
array("col" => 'tax', "hist" => 1), array("col" => 'tax', "hist" => 1),
array("col" => 'taxaustria', "hist" => 1),
array("col" => 'amount', "hist" => 0),
array("col" => 'category', "hist" => 0), array("col" => 'category', "hist" => 0),
array("col" => 'favorite', "hist" => 1), array("col" => 'favorite', "hist" => 1),
array("col" => 'sorting', "hist" => 1), array("col" => 'sorting', "hist" => 1),

View File

@ -84,7 +84,7 @@ class Products {
if(isset($_POST['extras'])) { if(isset($_POST['extras'])) {
$extras = $_POST['extras']; $extras = $_POST['extras'];
} }
$this->applySingleProdData($_POST['id'],$_POST['longname'],$_POST['shortname'],$_POST['priceA'],$_POST['priceB'],$_POST['priceC'],$_POST['tax'],$_POST['available'],$_POST['audioFile'],$_POST['changeExtras'],$extras,$_POST['favorite'],$_POST['assignextrastotype']); $this->applySingleProdData($_POST['id'],$_POST['longname'],$_POST['shortname'],$_POST['priceA'],$_POST['priceB'],$_POST['priceC'],$_POST['tax'],$_POST['taxaustria'],$_POST['amount'],$_POST['available'],$_POST['audioFile'],$_POST['changeExtras'],$extras,$_POST['favorite'],$_POST['assignextrastotype']);
} else if ($command == 'createExtra') { } else if ($command == 'createExtra') {
$this->createExtra($_POST['name'],$_POST['price']); $this->createExtra($_POST['name'],$_POST['price']);
} else if ($command == 'delExtra') { } else if ($command == 'delExtra') {
@ -98,7 +98,7 @@ class Products {
} else if ($command == 'delproduct') { } else if ($command == 'delproduct') {
$this->delproduct($_POST['prodid']); $this->delproduct($_POST['prodid']);
} else if ($command == 'createProduct') { } else if ($command == 'createProduct') {
$this->createProduct($_POST['longname'],$_POST['shortname'],$_POST['priceA'],$_POST['priceB'],$_POST['priceC'],$_POST['tax'],$_POST['available'],$_POST['prodTypeId'],$_POST['audioFile'],$_POST['favorite']); $this->createProduct($_POST['longname'],$_POST['shortname'],$_POST['priceA'],$_POST['priceB'],$_POST['priceC'],$_POST['tax'],$_POST['taxaustria'],$_POST['amount'],$_POST['available'],$_POST['prodTypeId'],$_POST['audioFile'],$_POST['favorite']);
} else if ($command == 'reassign') { } else if ($command == 'reassign') {
$this->reassign($_POST['productid'],$_POST['typeid']); $this->reassign($_POST['productid'],$_POST['typeid']);
} else if ($command == 'createProdType') { } else if ($command == 'createProdType') {
@ -177,7 +177,7 @@ class Products {
$typeArray[] = array("id" => $row['id'], "name" => $row['name'], "ref" => $ref); $typeArray[] = array("id" => $row['id'], "name" => $row['name'], "ref" => $ref);
} }
$sql = "select id,shortname,longname,audio,category as ref,favorite,$priceTxt as price,IF(tax is not null, tax, 'null') as tax from %products% where available='1' AND removed is null ORDER BY sorting"; $sql = "select id,shortname,longname,audio,category as ref,favorite,$priceTxt as price,IF(tax is not null, tax, 'null') as tax,IF(taxaustria is not null, taxaustria, 'null') as taxaustria,IF(amount is not null, amount, 'null') as amount from %products% where available='1' AND 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();
@ -203,7 +203,7 @@ class Products {
$stmt->execute(array($row['id'])); $stmt->execute(array($row['id']));
$extras = $stmt->fetchAll(PDO::FETCH_OBJ); $extras = $stmt->fetchAll(PDO::FETCH_OBJ);
$prodArray[] = array("id" => $row['id'], "name" => $row['shortname'], "longname" => $row['longname'], "audio" => $audio, "ref" => $ref, "favorite" => $fav, "price" => $row['price'], "tax" => $row['tax'], "extras" => $extras); $prodArray[] = array("id" => $row['id'], "name" => $row['shortname'], "longname" => $row['longname'], "audio" => $audio, "ref" => $ref, "favorite" => $fav, "price" => $row['price'], "tax" => $row['tax'], "taxaustria" => $row['taxaustria'],"amount" => $row['amount'],"extras" => $extras);
} }
$pdo->commit(); $pdo->commit();
@ -250,9 +250,9 @@ class Products {
*/ */
private function getProductsWithReferenz($pdo,$ref) { private function getProductsWithReferenz($pdo,$ref) {
$prods = array(); $prods = array();
$sql = "SELECT id,shortname,longname,priceA,priceB,priceC,IF(tax is not null, tax, 'null') as tax,available,audio from %products% where removed is null AND category is null ORDER BY sorting"; $sql = "SELECT id,shortname,longname,priceA,priceB,priceC,IF(tax is not null, tax, 'null') as tax,IF(taxaustria is not null, taxaustria, 'null') as taxaustria,available,IF(amount is not null, amount, 'null') as amount,audio from %products% where removed is null AND category is null ORDER BY sorting";
if ($ref > 0) { if ($ref > 0) {
$sql = "SELECT id,shortname,longname,priceA,priceB,priceC,IF(tax is not null, tax, 'null') as tax,available,audio from %products% where removed is null AND category=$ref ORDER BY sorting"; $sql = "SELECT id,shortname,longname,priceA,priceB,priceC,IF(tax is not null, tax, 'null') as tax,IF(taxaustria is not null, taxaustria, 'null') as taxaustria,available,IF(amount is not null, amount, 'null') as amount,audio from %products% where removed is null AND category=$ref ORDER BY sorting";
} }
$stmt = $pdo->prepare(DbUtils::substTableAlias($sql)); $stmt = $pdo->prepare(DbUtils::substTableAlias($sql));
$stmt->execute(); $stmt->execute();
@ -268,6 +268,8 @@ class Products {
"priceB" => $zeile['priceB'], "priceB" => $zeile['priceB'],
"priceC" => $zeile['priceC'], "priceC" => $zeile['priceC'],
"tax" => $zeile['tax'], "tax" => $zeile['tax'],
"taxaustria" => $zeile['taxaustria'],
"amount" => $zeile['amount'],
"audio" => ($zeile['audio'] == null ? '' : $zeile['audio']), "audio" => ($zeile['audio'] == null ? '' : $zeile['audio']),
"type" => "p"); "type" => "p");
$prods[] = $prod_entry; $prods[] = $prod_entry;
@ -373,11 +375,11 @@ class Products {
$containedTypes = $stmt->fetchAll(PDO::FETCH_OBJ); $containedTypes = $stmt->fetchAll(PDO::FETCH_OBJ);
if (!is_null($ref) && ($ref>0)) { if (!is_null($ref) && ($ref>0)) {
$sql = "SELECT id,shortname,longname,priceA,priceB,priceC,IF(tax is not null, tax, 'null') as tax,available,favorite,audio,'p' as type from %products% where removed is null AND category=? ORDER BY sorting"; $sql = "SELECT id,shortname,longname,priceA,priceB,priceC,IF(tax is not null, tax, 'null') as tax,IF(taxaustria is not null, taxaustria, 'null') as taxaustria,available,IF(amount is not null, amount, 'null') as amount,favorite,audio,'p' as type from %products% where removed is null AND category=? ORDER BY sorting";
$stmt = $pdo->prepare($this->dbutils->resolveTablenamesInSqlString($sql)); $stmt = $pdo->prepare($this->dbutils->resolveTablenamesInSqlString($sql));
$stmt->execute(array($ref)); $stmt->execute(array($ref));
} else { } else {
$sql = "SELECT id,shortname,longname,priceA,priceB,priceC,IF(tax is not null, tax, 'null') as tax,available,favorite,audio,'p' as type from %products% where removed is null AND category is null ORDER BY sorting"; $sql = "SELECT id,shortname,longname,priceA,priceB,priceC,IF(tax is not null, tax, 'null') as tax,IF(taxaustria is not null, taxaustria, 'null') as taxaustria,available,IF(amount is not null, amount, 'null') as amount,favorite,audio,'p' as type from %products% where removed is null AND category is null ORDER BY sorting";
$stmt = $pdo->prepare($this->dbutils->resolveTablenamesInSqlString($sql)); $stmt = $pdo->prepare($this->dbutils->resolveTablenamesInSqlString($sql));
$stmt->execute(); $stmt->execute();
} }
@ -890,7 +892,7 @@ class Products {
} }
function applySingleProdData($id,$longname,$shortname,$priceA,$priceB,$priceC,$tax,$available,$audioFile,$changeExtras,$extras,$favorite,$assignextrastotype) { function applySingleProdData($id,$longname,$shortname,$priceA,$priceB,$priceC,$tax,$taxaustria,$amount,$available,$audioFile,$changeExtras,$extras,$favorite,$assignextrastotype) {
if (!is_numeric($id) || !is_numeric($available) || !is_numeric($favorite) ||!is_numeric($priceA) || !is_numeric($priceB) || !is_numeric($priceC) || (!is_numeric($tax) && ($tax != "null")) ) { if (!is_numeric($id) || !is_numeric($available) || !is_numeric($favorite) ||!is_numeric($priceA) || !is_numeric($priceB) || !is_numeric($priceC) || (!is_numeric($tax) && ($tax != "null")) ) {
return; return;
} }
@ -898,15 +900,18 @@ class Products {
if ($tax == "null") { if ($tax == "null") {
$tax = null; $tax = null;
} }
if ($amount == "null") {
$amount = null;
}
if ($audioFile == '') { if ($audioFile == '') {
$audioFile = null; $audioFile = null;
} }
$updateSql = "UPDATE %products% SET shortname=?, longname=?, priceA=?, priceB=?, priceC=?, tax=?, available=?, audio=?, favorite=? WHERE id=?"; $updateSql = "UPDATE %products% SET shortname=?, longname=?, priceA=?, priceB=?, priceC=?, tax=?, taxaustria=?, amount=?,available=?, audio=?, favorite=? WHERE id=?";
$pdo = $this->dbutils->openDbAndReturnPdo(); $pdo = $this->dbutils->openDbAndReturnPdo();
$pdo->beginTransaction(); $pdo->beginTransaction();
$stmt = $pdo->prepare($this->dbutils->resolveTablenamesInSqlString($updateSql)); $stmt = $pdo->prepare($this->dbutils->resolveTablenamesInSqlString($updateSql));
$stmt->execute(array($shortname,$longname,$priceA,$priceB,$priceC,$tax,$available,$audioFile,$favorite,$id)); $stmt->execute(array($shortname,$longname,$priceA,$priceB,$priceC,$tax,$taxaustria,$amount,$available,$audioFile,$favorite,$id));
if ($assignextrastotype == 0) { if ($assignextrastotype == 0) {
if ($changeExtras == 1) { if ($changeExtras == 1) {
@ -996,7 +1001,7 @@ class Products {
echo json_encode(array("status" => "OK")); echo json_encode(array("status" => "OK"));
} }
function createProduct($longname,$shortname,$priceA,$priceB,$priceC,$tax,$available,$typeId,$audioFile,$favorite) { function createProduct($longname,$shortname,$priceA,$priceB,$priceC,$tax,$taxaustria,$amount,$available,$typeId,$audioFile,$favorite) {
if (!is_numeric($typeId) || !is_numeric($available) || !is_numeric($favorite)|| !is_numeric($priceA) || !is_numeric($priceB) || !is_numeric($priceC)) { if (!is_numeric($typeId) || !is_numeric($available) || !is_numeric($favorite)|| !is_numeric($priceA) || !is_numeric($priceB) || !is_numeric($priceC)) {
return; return;
} }
@ -1013,12 +1018,12 @@ class Products {
$shortname = $longname; $shortname = $longname;
} }
$sql = "INSERT INTO `%products%` (`id`, `shortname`, `longname`, `priceA`, `priceB`, `priceC`, `tax`, `category`,`favorite`,`available`,`audio`) VALUES (NULL,?,?,?,?,?,?,?,?,?,?)"; $sql = "INSERT INTO `%products%` (`id`, `shortname`, `longname`, `priceA`, `priceB`, `priceC`, `tax`, `taxaustria`,`amount`,`category`,`favorite`,`available`,`audio`) VALUES (NULL,?,?,?,?,?,?,?,?,?,?)";
$pdo = $this->dbutils->openDbAndReturnPdo(); $pdo = $this->dbutils->openDbAndReturnPdo();
$pdo->beginTransaction(); $pdo->beginTransaction();
$stmt = $pdo->prepare($this->dbutils->resolveTablenamesInSqlString($sql)); $stmt = $pdo->prepare($this->dbutils->resolveTablenamesInSqlString($sql));
$stmt->execute(array($shortname,$longname,$priceA,$priceB,$priceC,$tax,$typeId,$favorite,$available,$audioFile)); $stmt->execute(array($shortname,$longname,$priceA,$priceB,$priceC,$tax,$taxaustria,$amount,$typeId,$favorite,$available,$audioFile));
$newProdId = $pdo->lastInsertId(); $newProdId = $pdo->lastInsertId();
$this->sorter->setMaxSortingForProdId($pdo, $newProdId); $this->sorter->setMaxSortingForProdId($pdo, $newProdId);

View File

@ -820,17 +820,10 @@ class QueueContent {
$pdo->beginTransaction(); $pdo->beginTransaction();
$sql = "SELECT setting FROM %config% where name=?"; $togotax = CommonUtils::getExistingConfigValue($pdo, 'togotax');
$stmt = $pdo->prepare(DbUtils::substTableAlias($sql)); $normaltax = CommonUtils::getExistingConfigValue($pdo, 'tax');
$stmt->execute(array('togotax')); $workflowconfig = CommonUtils::getExistingConfigValue($pdo, 'workflowconfig');
$row = $stmt->fetchObject(); $austria = CommonUtils::getExistingConfigValue($pdo, 'austria');
$togotax = $row->setting;
$stmt->execute(array('tax'));
$row = $stmt->fetchObject();
$normaltax = $row->setting;
$stmt->execute(array('workflowconfig'));
$row = $stmt->fetchObject();
$workflowconfig = $row->setting;
// get current pricelevel // get current pricelevel
$currentPriceLevel = $this->commonUtils->getCurrentPriceLevel($pdo); $currentPriceLevel = $this->commonUtils->getCurrentPriceLevel($pdo);
@ -847,7 +840,7 @@ class QueueContent {
$theChangedPrice = str_replace(',','.',$theChangedPrice); $theChangedPrice = str_replace(',','.',$theChangedPrice);
// now get the price for this pricelevel // now get the price for this pricelevel
$getPriceSql = "SELECT priceA,priceB,priceC,longname,tax FROM %products% where id=?"; $getPriceSql = "SELECT priceA,priceB,priceC,longname,tax,taxaustria,amount FROM %products% where id=?";
$stmt = $pdo->prepare($this->dbutils->resolveTablenamesInSqlString($getPriceSql)); $stmt = $pdo->prepare($this->dbutils->resolveTablenamesInSqlString($getPriceSql));
$stmt->execute(array($productid)); $stmt->execute(array($productid));
$row = $stmt->fetchObject(); $row = $stmt->fetchObject();
@ -856,6 +849,13 @@ class QueueContent {
return; return;
} }
if (!is_null($row->amount)) {
$amount = max(($row->amount -1),0);
$sql = "UPDATE %products% SET amount=? WHERE id=?";
$stmt = $pdo->prepare(DbUtils::substTableAlias($sql));
$stmt->execute(array($amount,$productid));
}
$productname = $row->longname; $productname = $row->longname;
if (($theChangedPrice == "NO") || (!is_numeric($theChangedPrice))) { if (($theChangedPrice == "NO") || (!is_numeric($theChangedPrice))) {
$price_for_level_A = $row->priceA; $price_for_level_A = $row->priceA;
@ -882,9 +882,33 @@ class QueueContent {
if ($togo == 1) { if ($togo == 1) {
$tax = $togotax; $tax = $togotax;
} }
if ($austria == 1) {
$taxaustrianumber = $row->taxaustria;
$configItem = "";
switch($taxaustrianumber) {
case 1:
$configItem = "taxaustrianormal";
break;
case 2:
$configItem = "taxaustriaerm1";
break;
case 3:
$configItem = "taxaustriaerm2";
break;
case 4:
$configItem = "taxaustriaspecial";
break;
default:
$configItem = "taxaustrianormal";
}
$tax = CommonUtils::getExistingConfigValue($pdo, $configItem);
} else {
$taxaustrianumber = null;
if (!is_null($row->tax)) { if (!is_null($row->tax)) {
$tax = $row->tax; $tax = $row->tax;
} }
}
$extras = null; $extras = null;
if (array_key_exists("extras",$aProd)) { if (array_key_exists("extras",$aProd)) {
@ -912,12 +936,12 @@ class QueueContent {
$ordertime = date('Y-m-d H:i:s'); $ordertime = date('Y-m-d H:i:s');
$insertSql = "INSERT INTO `%queue%` ( $insertSql = "INSERT INTO `%queue%` (
`id` , `tablenr`,`productid`,`pricelevel`,`price`,`tax`,`productname`,`ordertime`,`orderuser`,`anoption`,`pricechanged`,`togo`,`readytime`,`delivertime`,`paidtime`,`billid`,`toremove`,`cooking`,`workprinted`) `id` , `tablenr`,`productid`,`pricelevel`,`price`,`tax`,`taxaustria`,`productname`,`ordertime`,`orderuser`,`anoption`,`pricechanged`,`togo`,`readytime`,`delivertime`,`paidtime`,`billid`,`toremove`,`cooking`,`workprinted`)
VALUES ( VALUES (
NULL , ?,?,?,?,?,?,?,?,?,?,?, '0000-00-00 00:00:00', '0000-00-00 00:00:00', NULL,NULL,'0',NULL,'0');"; NULL , ?,?,?,?,?,?,?,?,?,?,?,?, '0000-00-00 00:00:00', '0000-00-00 00:00:00', NULL,NULL,'0',NULL,'0');";
$stmt = $pdo->prepare(DbUtils::substTableAlias($insertSql)); $stmt = $pdo->prepare(DbUtils::substTableAlias($insertSql));
$stmt->execute(array($theTableid,$productid,$currentPriceLevelId,$price,$tax,$productname,$ordertime,$_SESSION['userid'],$theOption,($theChangedPrice == "NO" ? 0 : 1),$togo)); $stmt->execute(array($theTableid,$productid,$currentPriceLevelId,$price,$tax,$taxaustrianumber,$productname,$ordertime,$_SESSION['userid'],$theOption,($theChangedPrice == "NO" ? 0 : 1),$togo));
$queueid = $pdo->lastInsertId(); $queueid = $pdo->lastInsertId();
if (!is_null($extras) && ($extras != "")) { if (!is_null($extras) && ($extras != "")) {

View File

@ -7,6 +7,8 @@ class ProductEntry {
private $priceB; // price level B private $priceB; // price level B
private $priceC; // price level C private $priceC; // price level C
private $tax; private $tax;
private $taxaustria;
private $amount;
private $longName; // the name that shall appear on the receipt private $longName; // the name that shall appear on the receipt
private $prodid = null; private $prodid = null;
private $available = 1; private $available = 1;
@ -14,6 +16,8 @@ class ProductEntry {
private static $PRICE_B = "PreisB"; private static $PRICE_B = "PreisB";
private static $PRICE_C = "PreisC"; private static $PRICE_C = "PreisC";
private static $TAX = "Fixsteuersatz"; private static $TAX = "Fixsteuersatz";
private static $TAXAUSTRIA = "Steuersatz-Austria";
private static $AMOUNT = "Menge";
private static $SHORTNAME = "Kurzname"; private static $SHORTNAME = "Kurzname";
private static $AVAILABLE = "vorhanden"; private static $AVAILABLE = "vorhanden";
private static $ID = "ID"; private static $ID = "ID";
@ -30,6 +34,8 @@ class ProductEntry {
$priceB = str_replace('.', $decpoint, $aProd['priceB']); $priceB = str_replace('.', $decpoint, $aProd['priceB']);
$priceC = str_replace('.', $decpoint, $aProd['priceC']); $priceC = str_replace('.', $decpoint, $aProd['priceC']);
$tax = str_replace('.', $decpoint, $aProd['tax']); $tax = str_replace('.', $decpoint, $aProd['tax']);
$taxaustria = $aProd['taxaustria'];
$amount = $aProd['amount'];
$prodText = "$longname; $priceA"; $prodText = "$longname; $priceA";
$extArr = array(); $extArr = array();
@ -47,6 +53,14 @@ class ProductEntry {
$extArr[] = self::$PRICE_C . ":$priceC"; $extArr[] = self::$PRICE_C . ":$priceC";
} }
if (!is_null($taxaustria) && ($taxaustria != 'null')) {
$extArr[] = self::$TAXAUSTRIA . ":$taxaustria";
}
if (!is_null($amount) && ($amount != 'null')) {
$extArr[] = self::$AMOUNT . ":$amount";
}
if ($available == 0) { if ($available == 0) {
$extArr[] = self::$AVAILABLE . ":nein"; $extArr[] = self::$AVAILABLE . ":nein";
} }
@ -75,6 +89,9 @@ class ProductEntry {
$this->priceC = null; $this->priceC = null;
$this->shortName = null; $this->shortName = null;
$this->taxaustria = 0;
$this->amount = "";
if (count($propertyparts) > 1) { if (count($propertyparts) > 1) {
if (trim($propertyparts[1]) == "") { if (trim($propertyparts[1]) == "") {
return; return;
@ -100,6 +117,13 @@ class ProductEntry {
$this->shortName = $value; $this->shortName = $value;
} else if ($identifier == self::$ID) { } else if ($identifier == self::$ID) {
$this->prodid = $value; $this->prodid = $value;
} else if ($identifier == self::$TAXAUSTRIA) {
if (($value<0) || ($value > 4)) {
$value = null;
}
$this->taxaustria = $value;
} else if ($identifier == self::$AMOUNT) {
$this->amount = $value;
} }
} }
} }
@ -151,6 +175,13 @@ class ProductEntry {
return $this->available; return $this->available;
} }
function getTaxAustria() {
return $this->taxaustria;
}
function getAmount() {
return $this->amount;
}
function toString() { function toString() {
return "S:" . $this->shortName . " PA:" . $this->priceA . " PB:" . $this->priceB . " PC:" . $this->priceC . " Tax:" . $this->tax . " R:" . $this->longName; return "S:" . $this->shortName . " PA:" . $this->priceA . " PB:" . $this->priceB . " PC:" . $this->priceC . " Tax:" . $this->tax . " R:" . $this->longName;
} }

View File

@ -352,6 +352,14 @@ class TypeAndProductFileManager {
$priceB = $product->getPriceB(); $priceB = $product->getPriceB();
$priceC = $product->getPriceC(); $priceC = $product->getPriceC();
$tax = $product->getTax(); $tax = $product->getTax();
$taxaustria = trim($product->getTaxAustria());
if (($taxaustria == "") || ($taxaustria == 0)) {
$taxaustria = null;
}
$amount = trim($product->getAmount());
if (trim($amount) == "") {
$amount = null;
}
$shortName = $product->getShortName(); $shortName = $product->getShortName();
$longName = $product->getLongName(); $longName = $product->getLongName();
$prodid = $product->getProdId(); $prodid = $product->getProdId();
@ -379,15 +387,15 @@ class TypeAndProductFileManager {
} }
} }
if ($isNewProd) { if ($isNewProd) {
$sql = "INSERT INTO `%products%` (`id`, `shortname`, `longname`, `priceA`, `priceB`, `priceC`, `tax`, `category`,`available`,`favorite`,`sorting`) VALUES (NULL,"; $sql = "INSERT INTO `%products%` (`id`, `shortname`, `longname`, `priceA`, `priceB`, `priceC`, `tax`, `taxaustria`, `amount`, `category`,`available`,`favorite`,`sorting`) VALUES (NULL,";
$sql = $sql . "?,?,?,?,?,?,?,?,?,?)"; $sql = $sql . "?,?,?,?,?,?,?,?,?,?,?,?)";
$stmt = $pdo->prepare(DbUtils::substTableAlias($sql)); $stmt = $pdo->prepare(DbUtils::substTableAlias($sql));
$stmt->execute(array($shortName,$longName,$priceA,$priceB,$priceC,$tax, $category,$available,$favorite,$sorting)); $stmt->execute(array($shortName,$longName,$priceA,$priceB,$priceC,$tax, $taxaustria, $amount, $category,$available,$favorite,$sorting));
$prodid = $pdo->lastInsertId(); $prodid = $pdo->lastInsertId();
HistFiller::createProdInHist($pdo, $prodid); HistFiller::createProdInHist($pdo, $prodid);
} else { } else {
$sql = "SELECT shortname,longname,priceA,priceB,priceC,tax,available,category FROM %products% WHERE id=?"; $sql = "SELECT shortname,longname,priceA,priceB,priceC,tax,taxaustria,amount,available,category FROM %products% WHERE id=?";
$stmt = $pdo->prepare(DbUtils::substTableAlias($sql)); $stmt = $pdo->prepare(DbUtils::substTableAlias($sql));
$stmt->execute(array($prodid)); $stmt->execute(array($prodid));
$row = $stmt->fetchObject(); $row = $stmt->fetchObject();
@ -398,12 +406,14 @@ class TypeAndProductFileManager {
|| ($row->priceB != $priceB) || ($row->priceB != $priceB)
|| ($row->priceC != $priceC) || ($row->priceC != $priceC)
|| ($row->available != $available) || ($row->available != $available)
|| ($row->tax != $tax)); || ($row->tax != $tax)
|| ($row->taxaustria != $taxaustria)
|| ($row->amount != $amount));
if ($changed) { if ($changed) {
$sql = "UPDATE %products% SET shortname=?,longname=?,priceA=?,priceB=?,priceC=?,tax=?,available=?,sorting=? WHERE id=?"; $sql = "UPDATE %products% SET shortname=?,longname=?,priceA=?,priceB=?,priceC=?,tax=?,taxaustria=?,amount=?,available=?,sorting=? WHERE id=?";
$stmt = $pdo->prepare(DbUtils::substTableAlias($sql)); $stmt = $pdo->prepare(DbUtils::substTableAlias($sql));
$stmt->execute(array($shortName,$longName,$priceA,$priceB,$priceC,$tax,$available,$sorting,$prodid)); $stmt->execute(array($shortName,$longName,$priceA,$priceB,$priceC,$tax,$taxaustria,$amount,$available,$sorting,$prodid));
HistFiller::updateProdInHist($pdo, $prodid); HistFiller::updateProdInHist($pdo, $prodid);
} else { } else {
$sql = "UPDATE %products% SET sorting=? WHERE id=?"; $sql = "UPDATE %products% SET sorting=? WHERE id=?";

View File

@ -410,6 +410,8 @@ class Basedb {
`priceB` " . DECIMALSMALL . " NULL, `priceB` " . DECIMALSMALL . " NULL,
`priceC` " .DECIMALSMALL . " NULL, `priceC` " .DECIMALSMALL . " NULL,
`tax` " . DECIMALSMALL . " NULL, `tax` " . DECIMALSMALL . " NULL,
`taxaustria` INT(1) NULL,
`amount` INT(5) NULL,
`category` INT(3) NULL, `category` INT(3) NULL,
`favorite` INT(1) NULL, `favorite` INT(1) NULL,
`sorting` INT(2) NULL, `sorting` INT(2) NULL,
@ -510,6 +512,7 @@ class Basedb {
`pricelevel` INT( 3 ) NOT NULL , `pricelevel` INT( 3 ) NOT NULL ,
`price` " . DECIMALSMALL . " NOT NULL, `price` " . DECIMALSMALL . " NOT NULL,
`tax` " . DECIMALSMALL . " NOT NULL, `tax` " . DECIMALSMALL . " NOT NULL,
`taxaustria` INT(1) NULL,
`productname` VARCHAR( 150 ) NULL, `productname` VARCHAR( 150 ) NULL,
`ordertime` DATETIME NULL , `ordertime` DATETIME NULL ,
`orderuser` INT(10) NOT NULL , `orderuser` INT(10) NOT NULL ,
@ -568,6 +571,7 @@ class Basedb {
`priceB` " . DECIMALSMALL . " NULL, `priceB` " . DECIMALSMALL . " NULL,
`priceC` " . DECIMALSMALL . " NULL, `priceC` " . DECIMALSMALL . " NULL,
`tax` " . DECIMALSMALL . " NULL, `tax` " . DECIMALSMALL . " NULL,
`taxaustria` INT(1) NULL,
`sorting` INT(2) NULL, `sorting` INT(2) NULL,
`available` INT(2) NOT NULL, `available` INT(2) NOT NULL,
`favorite` INT(1) NULL, `favorite` INT(1) NULL,

View File

@ -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.2.10"> <link rel="stylesheet" type="text/css" href="css/bestformat.css?v=1.2.11">
<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" />

View File

@ -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.2.10"> <link rel="stylesheet" type="text/css" href="css/bestformat.css?v=1.2.11">
<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" />
@ -29,6 +29,8 @@ var PROD_NEW_PROD = ["Neues Produkt","New product","Nuevo producto"];
var PROD_NO_TONE = ["Kein Ton","No audio","Ningún sonido"]; var PROD_NO_TONE = ["Kein Ton","No audio","Ningún sonido"];
var PROD_PRICE = ["Preis","Price","Precio"]; var PROD_PRICE = ["Preis","Price","Precio"];
var PROD_TAX = ["Steuersatz immer","Tax always","Impuesto siempre"]; var PROD_TAX = ["Steuersatz immer","Tax always","Impuesto siempre"];
var PROD_TAXAUSTRIA = ["Steuersatz Österreich","Tax Austria","Impuesto Austria"];
var PROD_AMOUNT = ["Verfügbare Menge","Available amount","Cuanto hay"];
var PROD_SHORTNAME = ["Kurzname:","Short name:","Nombre corto"]; var PROD_SHORTNAME = ["Kurzname:","Short name:","Nombre corto"];
var PROD_LONG_NAME = ["Langname:","Long name:","Nombre largo"]; var PROD_LONG_NAME = ["Langname:","Long name:","Nombre largo"];
var PROD_AVAILABLE = ["Verfügbar","Available","Disponible"]; var PROD_AVAILABLE = ["Verfügbar","Available","Disponible"];
@ -70,6 +72,7 @@ var PROD_PLACEHOLDER_NEW_PRODTYPE = ["Name der neuen Kategorie", "Name of the ne
var MAX_PRICE = 999.99; var MAX_PRICE = 999.99;
var decpoint = "."; var decpoint = ".";
var austria = 0;
var lang = 0; var lang = 0;
var p_allprods = []; var p_allprods = [];
@ -160,13 +163,13 @@ function setLanguage(language) {
var i=0; var i=0;
for (i=0;i<pt.length;i++) { for (i=0;i<pt.length;i++) {
var prod = pt[i]; var prod = pt[i];
var aProduct = newProduct(prod.id,prod.longname,prod.shortname,prod.priceA,prod.priceB,prod.priceC,prod.tax,prod.available,prod.audio,prod.favorite); var aProduct = newProduct(prod.id,prod.longname,prod.shortname,prod.priceA,prod.priceB,prod.priceC,prod.tax,prod.taxaustria,prod.amount,prod.available,prod.audio,prod.favorite);
prodleafs[prodleafs.length] = aProduct; prodleafs[prodleafs.length] = aProduct;
txt += aProduct.createListStructureLine(audiofiles); txt += aProduct.createListStructureLine(audiofiles);
} }
if (ct != null) { if (ct != null) {
var dummyPrice = "0.00".replace(".",decpoint); var dummyPrice = "0.00".replace(".",decpoint);
var aProduct = newProduct("n" + ct.id,"","",dummyPrice,dummyPrice,dummyPrice,"null",1,"",0); var aProduct = newProduct("n" + ct.id,"","",dummyPrice,dummyPrice,dummyPrice,"null",0,"null",1,"",0);
prodleafs[prodleafs.length] = aProduct; prodleafs[prodleafs.length] = aProduct;
txt += aProduct.createListStructureLine(audiofiles); txt += aProduct.createListStructureLine(audiofiles);
} }
@ -380,9 +383,18 @@ function setLanguage(language) {
tax = tax.toString().replace(decpoint,"."); tax = tax.toString().replace(decpoint,".");
} }
var amount = $("#prodamount_input_" + prodid).val().trim();
if (amount === "") {
amount = "null";
} else {
amount = amount.toString().replace(decpoint,".");
}
var selectedTaxAustria = $("#taxaustriasel_" + prodid + " option:selected").val();
var selectedAudioFile = $("#audiosel_" + prodid + " option:selected").text(); var selectedAudioFile = $("#audiosel_" + prodid + " option:selected").text();
if (selectedAudioFile == 'Kein Ton') { if (selectedAudioFile === 'Kein Ton') {
selectedAudioFile = ''; selectedAudioFile = '';
} }
@ -391,12 +403,12 @@ function setLanguage(language) {
var favorite = $( "#prodfav_" + prodid + " option:selected").val(); var favorite = $( "#prodfav_" + prodid + " option:selected").val();
var priceA_Arr = convertToDecimalPoint(priceA); var priceA_Arr = convertToDecimalPoint(priceA);
if (priceB.length != 0) { if (priceB.length !== 0) {
var priceB_Arr = convertToDecimalPoint(priceB); var priceB_Arr = convertToDecimalPoint(priceB);
} else { } else {
var priceB_Arr = convertToDecimalPoint(priceA); var priceB_Arr = convertToDecimalPoint(priceA);
} }
if (priceC.length != 0) { if (priceC.length !== 0) {
var priceC_Arr = convertToDecimalPoint(priceC); var priceC_Arr = convertToDecimalPoint(priceC);
} else { } else {
var priceC_Arr = convertToDecimalPoint(priceA); var priceC_Arr = convertToDecimalPoint(priceA);
@ -418,6 +430,8 @@ function setLanguage(language) {
priceB:priceB_Arr[1], priceB:priceB_Arr[1],
priceC:priceC_Arr[1], priceC:priceC_Arr[1],
tax:taxTxt, tax:taxTxt,
taxaustria: selectedTaxAustria,
amount: amount,
selectedAudioFile:selectedAudioFile, selectedAudioFile:selectedAudioFile,
available:available, available:available,
favorite:favorite favorite:favorite
@ -469,6 +483,8 @@ function setLanguage(language) {
priceB: props.priceB, priceB: props.priceB,
priceC: props.priceC, priceC: props.priceC,
tax: props.tax, tax: props.tax,
taxaustria: props.taxaustria,
amount: props.amount,
available: props.available, available: props.available,
audioFile: props.selectedAudioFile, audioFile: props.selectedAudioFile,
changeExtras: doChangeExtras, changeExtras: doChangeExtras,
@ -497,7 +513,7 @@ function setLanguage(language) {
} }
function refreshProduct(prodData) { function refreshProduct(prodData) {
var aProduct = newProduct(prodData.id,prodData.longname,prodData.shortname,prodData.priceA,prodData.priceB,prodData.priceC,prodData.tax,prodData.available,prodData.audio,prodData.favorite); var aProduct = newProduct(prodData.id,prodData.longname,prodData.shortname,prodData.priceA,prodData.priceB,prodData.priceC,prodData.tax,prodData.taxaustria,prodData.amount,prodData.available,prodData.audio,prodData.favorite);
aProduct.insertValuesIntoMenuList(); aProduct.insertValuesIntoMenuList();
$("#assextralist_" + prodData.id).html(""); $("#assextralist_" + prodData.id).html("");
$("#assextralist_" + prodData.id).trigger("create"); $("#assextralist_" + prodData.id).trigger("create");
@ -514,6 +530,11 @@ function setLanguage(language) {
tax = "null"; tax = "null";
} }
var amount = props.amount;
if (amount.trim() == "") {
amount = "null";
}
var data = { var data = {
longname: props.longname, longname: props.longname,
shortname: props.shortname, shortname: props.shortname,
@ -521,6 +542,8 @@ function setLanguage(language) {
priceB: props.priceB, priceB: props.priceB,
priceC: props.priceC, priceC: props.priceC,
tax: props.tax, tax: props.tax,
taxaustria: props.taxaustria,
amount: amount,
available: props.available, available: props.available,
prodTypeId: tid, prodTypeId: tid,
audioFile: props.selectedAudioFile, audioFile: props.selectedAudioFile,
@ -875,6 +898,7 @@ function setLanguage(language) {
if (configResult.status == "OK") { if (configResult.status == "OK") {
var values = configResult.msg; var values = configResult.msg;
decpoint = values.decpoint; decpoint = values.decpoint;
austria = values.austria;
$("#info-page").data("decpoint",values.decpoint); $("#info-page").data("decpoint",values.decpoint);
setLanguage(values.userlanguage); setLanguage(values.userlanguage);
getAudioFiles(); getAudioFiles();

View File

@ -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.2.10"> <link rel="stylesheet" type="text/css" href="css/bestformat.css?v=1.2.11">
<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" />

View File

@ -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.2.10"> <link rel="stylesheet" type="text/css" href="css/bestformat.css?v=1.2.11">
<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" />

View File

@ -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.2.10"> <link rel="stylesheet" type="text/css" href="css/bestformat.css?v=1.2.11">
<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" />

View File

@ -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.2.10"> <link rel="stylesheet" type="text/css" href="css/bestformat.css?v=1.2.11">
<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" />

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long