OrderSprinter 1.5.20

This commit is contained in:
Geno 2020-11-19 23:12:24 +01:00
parent 66fd05062b
commit a3233b7709
36 changed files with 861 additions and 90 deletions

View File

@ -9,8 +9,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" href="css/gueststyle.css?v=1.5.19" /> <link rel="stylesheet" href="css/gueststyle.css?v=1.5.20" />
<link rel="stylesheet" href="php/3rdparty/orderstyle/orderstyle.min.css?v=1.5.19" /> <link rel="stylesheet" href="php/3rdparty/orderstyle/orderstyle.min.css?v=1.5.20" />
<link rel="stylesheet" href="php/3rdparty/orderstyle/jquery.mobile.icons.min.css" /> <link rel="stylesheet" href="php/3rdparty/orderstyle/jquery.mobile.icons.min.css" />
<link rel="stylesheet" href="php/3rdparty/jquery.mobile-1.4.0.min.css" type="text/css" /> <link rel="stylesheet" href="php/3rdparty/jquery.mobile-1.4.0.min.css" type="text/css" />
<script src="php/3rdparty/jquery-1.11.3.min.js"></script> <script src="php/3rdparty/jquery-1.11.3.min.js"></script>
@ -105,7 +105,7 @@
<div data-role="footer" data-theme="b" id="thefooter1"> <div data-role="footer" data-theme="b" id="thefooter1">
<div class="ui-grid-a"> <div class="ui-grid-a">
<div class="ui-block-a">&nbsp;&nbsp;OrderSprinter</div> <div class="ui-block-a">&nbsp;&nbsp;OrderSprinter</div>
<div class="ui-block-b grid_right" id="versioninfo">1.5.19&nbsp;&nbsp;</div> <div class="ui-block-b grid_right" id="versioninfo">1.5.20&nbsp;&nbsp;</div>
</div><!-- /grid-a --> </div><!-- /grid-a -->
</div> </div>
</div> </div>

View File

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

View File

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

Binary file not shown.

View File

@ -5,7 +5,7 @@
<meta http-equiv="content-type" content="text/html; charset=utf-8"> <meta 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.5.19"> <link rel="stylesheet" type="text/css" href="css/bestformat.css?v=1.5.20">
<link rel="stylesheet" href="php/contenthandler.php?module=admin&command=getmobilecss" /> <link rel="stylesheet" href="php/contenthandler.php?module=admin&command=getmobilecss" />
<link rel="stylesheet" href="php/3rdparty/orderstyle/jquery.mobile.icons.min.css" /> <link rel="stylesheet" href="php/3rdparty/orderstyle/jquery.mobile.icons.min.css" />
@ -13,8 +13,8 @@
<link rel="stylesheet" href="php/3rdparty/jquery.mobile-1.4.0.min.css" type="text/css" /> <link rel="stylesheet" href="php/3rdparty/jquery.mobile-1.4.0.min.css" type="text/css" />
<script src="php/3rdparty/jquery-2.0.3.min.js"></script> <script src="php/3rdparty/jquery-2.0.3.min.js"></script>
<script src="php/3rdparty/jquery.mobile-1.4.0.min.js"></script> <script src="php/3rdparty/jquery.mobile-1.4.0.min.js"></script>
<script src="utilities.js?v=1.5.19"></script> <script src="utilities.js?v=1.5.20"></script>
<script src="kitchenbar.js?v=1.5.19"></script> <script src="kitchenbar.js?v=1.5.20"></script>
<style> <style>
#tableWithEntriesToCook,#tableWithCookedEntries,#headertableToCook #tableWithEntriesToCook,#tableWithCookedEntries,#headertableToCook

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.5.19"> <link rel="stylesheet" type="text/css" href="css/bestformat.css?v=1.5.20">
<link rel="stylesheet" href="php/contenthandler.php?module=admin&command=getmobilecss" /> <link rel="stylesheet" href="php/contenthandler.php?module=admin&command=getmobilecss" />
<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

@ -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.5.19"> <link rel="stylesheet" type="text/css" href="css/bestformat.css?v=1.5.20">
<link rel="stylesheet" href="php/contenthandler.php?module=admin&command=getmobilecss" /> <link rel="stylesheet" href="php/contenthandler.php?module=admin&command=getmobilecss" />
<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

@ -9,8 +9,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.5.19"> <link rel="stylesheet" type="text/css" href="css/bestformat.css?v=1.5.20">
<link rel="stylesheet" type="text/css" href="css/numfield.css?v=1.5.19"> <link rel="stylesheet" type="text/css" href="css/numfield.css?v=1.5.20">
<link rel="stylesheet" href="php/3rdparty/orderstyle/orderstyle.min.css" /> <link rel="stylesheet" href="php/3rdparty/orderstyle/orderstyle.min.css" />
<link rel="stylesheet" href="php/3rdparty/orderstyle/jquery.mobile.icons.min.css" /> <link rel="stylesheet" href="php/3rdparty/orderstyle/jquery.mobile.icons.min.css" />
@ -229,7 +229,7 @@ function handleResultOfInstallCheck(is_installed) {
if (is_installed == "Yes") { if (is_installed == "Yes") {
useInstallation(); useInstallation();
} else { } else {
setTimeout(function(){document.location.href = "install.html?v=1.5.19"},500); setTimeout(function(){document.location.href = "install.html?v=1.5.20"},500);
} }
} }

View File

@ -909,7 +909,7 @@ El servicio web OrderSprinter no requiere una conexión a Internet. Sin embargo,
<tr id=updateline> <tr id=updateline>
<td>&nbsp;</td> <td>&nbsp;</td>
<td align=center> <td align=center>
<button id="updatebtn">Update -> 1.5.19</button> <button id="updatebtn">Update -> 1.5.20</button>
<span id="updateinprogresstxt" style="display:none;">Update... bitte warten.</span> <span id="updateinprogresstxt" style="display:none;">Update... bitte warten.</span>
</td> </td>
<td>&nbsp;</td> <td>&nbsp;</td>

View File

@ -389,7 +389,7 @@ $zones[] = $timezone_identifiers[$i];
echo json_encode($zones); echo json_encode($zones);
} else if ($command == 'update') { } else if ($command == 'update') {
set_time_limit(60*30); set_time_limit(60*30);
$installerVersion = "1.5.19"; $installerVersion = "1.5.20";
$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']);

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.5.19"> <link rel="stylesheet" type="text/css" href="css/bestformat.css?v=1.5.20">
<link rel="stylesheet" href="php/contenthandler.php?module=admin&command=getmobilecss" /> <link rel="stylesheet" href="php/contenthandler.php?module=admin&command=getmobilecss" />
<link rel="stylesheet" href="php/3rdparty/orderstyle/jquery.mobile.icons.min.css" /> <link rel="stylesheet" href="php/3rdparty/orderstyle/jquery.mobile.icons.min.css" />
@ -13,8 +13,8 @@
<link rel="stylesheet" href="php/3rdparty/jquery.mobile-1.4.0.min.css" type="text/css" /> <link rel="stylesheet" href="php/3rdparty/jquery.mobile-1.4.0.min.css" type="text/css" />
<script src="php/3rdparty/jquery-2.0.3.min.js"></script> <script src="php/3rdparty/jquery-2.0.3.min.js"></script>
<script src="php/3rdparty/jquery.mobile-1.4.0.min.js"></script> <script src="php/3rdparty/jquery.mobile-1.4.0.min.js"></script>
<script src="utilities.js?v=1.5.19"></script> <script src="utilities.js?v=1.5.20"></script>
<script src="kitchenbar.js?v=1.5.19"></script> <script src="kitchenbar.js?v=1.5.20"></script>
<style> <style>
#tableWithEntriesToCook,#tableWithCookedEntries,#headertableToCook #tableWithEntriesToCook,#tableWithCookedEntries,#headertableToCook

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.5.19"> <link rel="stylesheet" type="text/css" href="css/bestformat.css?v=1.5.20">
<link rel="stylesheet" href="php/contenthandler.php?module=admin&command=getmobilecss" /> <link rel="stylesheet" href="php/contenthandler.php?module=admin&command=getmobilecss" />
<link rel="stylesheet" href="php/3rdparty/orderstyle/jquery.mobile.icons.min.css" /> <link rel="stylesheet" href="php/3rdparty/orderstyle/jquery.mobile.icons.min.css" />
@ -13,10 +13,10 @@
<link rel="stylesheet" href="php/3rdparty/jquery.mobile-1.4.0.min.css" type="text/css" /> <link rel="stylesheet" href="php/3rdparty/jquery.mobile-1.4.0.min.css" type="text/css" />
<script src="php/3rdparty/jquery-1.11.3.min.js"></script> <script src="php/3rdparty/jquery-1.11.3.min.js"></script>
<script src="php/3rdparty/jquery.mobile-1.4.5.min.js"></script> <script src="php/3rdparty/jquery.mobile-1.4.5.min.js"></script>
<script src="utilities.js?v=1.5.19"></script> <script src="utilities.js?v=1.5.20"></script>
<script src="elements/tablemap.js?v=1.5.19"></script> <script src="elements/tablemap.js?v=1.5.20"></script>
<script src="elements/roommap.js?v=1.5.19"></script> <script src="elements/roommap.js?v=1.5.20"></script>
<script src="elements/groundplan.js?v=1.5.19"></script> <script src="elements/groundplan.js?v=1.5.20"></script>
<link href="php/3rdparty/hayageek_uploadfile.css" rel="stylesheet"> <link href="php/3rdparty/hayageek_uploadfile.css" rel="stylesheet">
<script src="php/3rdparty/hayageek_jquery_uploadfile.js"></script> <script src="php/3rdparty/hayageek_jquery_uploadfile.js"></script>
@ -303,6 +303,7 @@ var MAN_WORKRECEIPS_SECTION_TXT = ["Arbeitsbons:","Work receipts:","Tiquets de t
var MAN_DISCOUNT_SECTION_TXT = ["Rabatteinstellungen in Bestellansicht:","Discount settings in order view:","Descuentas en vista de camareros:"]; var MAN_DISCOUNT_SECTION_TXT = ["Rabatteinstellungen in Bestellansicht:","Discount settings in order view:","Descuentas en vista de camareros:"];
var MAN_TIMETRACKING = ["Zeiterfassung:","Time tracking:","Tiempos de los empleados:"]; var MAN_TIMETRACKING = ["Zeiterfassung:","Time tracking:","Tiempos de los empleados:"];
var MAN_SUMUPFORCARD = ["SumUp für Kartenzahlung","SumUp for card payment","SumUp para pago con tarjeta"]; var MAN_SUMUPFORCARD = ["SumUp für Kartenzahlung","SumUp for card payment","SumUp para pago con tarjeta"];
var MAN_PRINTCASH = ["Drucke Barein-/auslage","Print cash operation","Imprimir entradas"];
var MAN_SUMUP = ["SumUp-Anbindung","Connection to SumUp","SumUp"]; var MAN_SUMUP = ["SumUp-Anbindung","Connection to SumUp","SumUp"];
var MAN_SUMUPFAILURETEXT = ["Stornotext bei fehlgeschlagener Kartenzahlung","Text in report for failured card payment","Texto en el informe para el pago con tarjeta de crédito fallido"]; var MAN_SUMUPFAILURETEXT = ["Stornotext bei fehlgeschlagener Kartenzahlung","Text in report for failured card payment","Texto en el informe para el pago con tarjeta de crédito fallido"];
var MAN_MEMORYLIMIT = ["PHP Memory Limit (MB)","PHP Memory Limit (MB)","PHP Memory Limit (MB)"]; var MAN_MEMORYLIMIT = ["PHP Memory Limit (MB)","PHP Memory Limit (MB)","PHP Memory Limit (MB)"];
@ -474,9 +475,10 @@ var MAN_SHOWPICKDELBTN = ["Zeige Entfernen-Button in Abholansicht","Show remove
var MAN_SHOWPICKHELP = ["Zeige Hilfebereich","Show help area","Mostrar area de ayuda"]; var MAN_SHOWPICKHELP = ["Zeige Hilfebereich","Show help area","Mostrar area de ayuda"];
var MAN_NO_NEW_UPD_VERSION = ["Update nicht möglich (Version auf dem Server ist unbekannt oder nicht neuer). Installierte Version: ","Update not possible (version on server unknown or not newer). Installed version: ","Actualización no posible (versión en servidor desconocida o no más nueva). Versión instalada: "]; var MAN_NO_NEW_UPD_VERSION = ["Update nicht möglich (Version auf dem Server ist unbekannt oder nicht neuer). Installierte Version: ","Update not possible (version on server unknown or not newer). Installed version: ","Actualización no posible (versión en servidor desconocida o no más nueva). Versión instalada: "];
var MAN_UPDATE_BTN_CLICK = ["Das Update startet und kann einige Minuten dauern. Bitte bestätigen diese Meldung und warten Sie, bis dass ein Hinweistext über den Abschluss des Updates informiert.","The update will start and may take a few minutes. Please confirm this message and wait until a message informs you that the update is complete.","La actualización se iniciará y puede tardar unos minutos. Confirme este mensaje y espere a que un mensaje le informe de que la actualización ha finalizado."]; var MAN_UPDATE_BTN_CLICK = ["Das Update startet und kann einige Minuten dauern. Bitte bestätigen diese Meldung und warten Sie, bis dass ein Hinweistext über den Abschluss des Updates informiert.","The update will start and may take a few minutes. Please confirm this message and wait until a message informs you that the update is complete.","La actualización se iniciará y puede tardar unos minutos. Confirme este mensaje y espere a que un mensaje le informe de que la actualización ha finalizado."];
var MAN_PLEASE_WAIT = ["Die Erstellung von Umsatzreports kann mehrere Minuten dauern. Bitte haben Sie nach dem Anklicken eines Umsatzexportbuttons etwas Geduld.","The creation of sales reports may take several minutes. Please be patient after clicking on a report button.","La creación de informes de ventas puede tardar varios minutos. Por favor, tenga paciencia después de hacer clic en un botón de ventas."];
var lang = 0; var lang = 0;
var generalVals = [12,2,0,3,0,1,1,0,0,1, 0,50,20,10,1,0,0,0,1,0,1,0,0,1,1, 1,1,1,1,1,1,1,1,1,1, 1,2,3, 1,0, 1,0,1, 1,1,0,0, 0,0,0, 0,0,0,1,1, 0,1,0,1,1, 1,2,0, 0]; var generalVals = [12,2,0,3,0,1,1,0,0,1, 0,50,20,10,1,0,0,0,1,0,1,0,0,1,1, 1,1,1,1,1,1,1,1,1,1, 1,2,3, 1,0, 1,0,1, 1,1,0,0, 0,0,0, 0,0,0,1,1, 0,1,0,1,1, 1,2,0, 0,0];
var numberOfClosings = 0; var numberOfClosings = 0;
@ -625,7 +627,8 @@ var generalValuesSettings = [
["sumupforcard",MAN_SUMUPFORCARD[lang],"s",63], ["sumupforcard",MAN_SUMUPFORCARD[lang],"s",63],
["affiliatekey","Affiliate Key","i",0], ["affiliatekey","Affiliate Key","i",0],
["appid","App-Id","i",0], ["appid","App-Id","i",0],
["sumupfailuretext",MAN_SUMUPFAILURETEXT[lang],"i",0,""] ["sumupfailuretext",MAN_SUMUPFAILURETEXT[lang],"i",0,""],
["printcash",MAN_PRINTCASH[lang],"s",64],
]; ];
var predef = ""; var predef = "";
@ -819,6 +822,7 @@ function setLanguage(l) {
$("#showpickupsnotxt").html(MAN_SHOWPICKUPSNO[l]); $("#showpickupsnotxt").html(MAN_SHOWPICKUPSNO[l]);
$("#guestjobprinthint").html(MAN_GUEST_JOB_PRINT_HINT[l]); $("#guestjobprinthint").html(MAN_GUEST_JOB_PRINT_HINT[l]);
$("#csvexportallhint").html(MAN_PLEASE_WAIT[l]);
} }
function createMonthSelection(label) { function createMonthSelection(label) {
@ -999,6 +1003,7 @@ function insertGeneralConfigItems(configResult) {
$("#partOfShowpickhelp").html(createYesNo("showpickhelp",MAN_SHOWPICKHELP, values.showpickhelp)); $("#partOfShowpickhelp").html(createYesNo("showpickhelp",MAN_SHOWPICKHELP, values.showpickhelp));
$("#partOfSumupforcard").html(createYesNo("sumupforcard",MAN_SUMUPFORCARD, values.sumupforcard)); $("#partOfSumupforcard").html(createYesNo("sumupforcard",MAN_SUMUPFORCARD, values.sumupforcard));
$("#partOfPrintcash").html(createYesNo("printcash",MAN_PRINTCASH, values.printcash));
var language = values.billlanguage; var language = values.billlanguage;
generalVals[2] = language; generalVals[2] = language;
@ -1095,6 +1100,7 @@ function insertGeneralConfigItems(configResult) {
generalVals[61] = values.billprintjobs; generalVals[61] = values.billprintjobs;
generalVals[62] = values.usebarcode; generalVals[62] = values.usebarcode;
generalVals[63] = values.sumupforcard; generalVals[63] = values.sumupforcard;
generalVals[64] = values.printcash;
defaulttmp = values.defaulttmp; defaulttmp = values.defaulttmp;
@ -1556,7 +1562,7 @@ function initRestoreFileUpload() {
} else { } else {
alert("Import war erfolgreich."); alert("Import war erfolgreich.");
setTimeout(function(){ setTimeout(function(){
document.location.href = "index.html?v=1.5.19"; document.location.href = "index.html?v=1.5.20";
},250); },250);
} }
}, },
@ -1773,9 +1779,9 @@ function bindingExports() {
} else if (theId == "createconfigexport") { } else if (theId == "createconfigexport") {
window.location.href = "php/contenthandler.php?module=admin&command=exportConfigCsv"; window.location.href = "php/contenthandler.php?module=admin&command=exportConfigCsv";
} else if (theId == "createdbexport") { } else if (theId == "createdbexport") {
window.location.href = "php/contenthandler.php?module=bill&command=exportCsv&" + dateparams; window.location.href = "php/contenthandler.php?module=bill&command=exportAllCsv&" + dateparams;
} else if (theId == "createdbexportxlsx") { } else if (theId == "createdbexportxlsx") {
window.location.href = "php/contenthandler.php?module=bill&command=exportXlsx&" + dateparams; window.location.href = "php/contenthandler.php?module=bill&command=exportAllExcel&" + dateparams;
} else if (theId == "createpdfexport") { } else if (theId == "createpdfexport") {
window.open("php/contenthandler.php?module=bill&command=exportPdfReport&" + dateparams,'_blank'); window.open("php/contenthandler.php?module=bill&command=exportPdfReport&" + dateparams,'_blank');
} else if (theId == "createpdfsummary") { } else if (theId == "createpdfsummary") {
@ -2124,7 +2130,7 @@ function updateOneSingleFile() {
setTimeout(function(){ setTimeout(function(){
$("#sliderarea").hide(); $("#sliderarea").hide();
var millis=getMillis(); var millis=getMillis();
document.location.href = "install.html?v=1.5.19&mode=onlyupdate&n=" + millis; document.location.href = "install.html?v=1.5.20&mode=onlyupdate&n=" + millis;
},250); },250);
} }
} }
@ -3541,6 +3547,8 @@ $(document).on("pageinit", "#admin-page", function () {
<div class="ui-block-a"><button type="submit" data-theme="f" class="cancelButton exportbtn" data-icon="check" id="createdbexport">Export Umsätze CSV</button></div> <div class="ui-block-a"><button type="submit" data-theme="f" class="cancelButton exportbtn" data-icon="check" id="createdbexport">Export Umsätze CSV</button></div>
<div class="ui-block-b"><button type="submit" data-theme="f" class="cancelButton exportbtn" data-icon="check" id="createdbexportxlsx">... Excel</button></div> <div class="ui-block-b"><button type="submit" data-theme="f" class="cancelButton exportbtn" data-icon="check" id="createdbexportxlsx">... Excel</button></div>
</div><!-- /grid-a --> </div><!-- /grid-a -->
<i id="csvexportallhint" style="padding-left: 50px;padding-right: 50px;">Bitte warten nach Klick</i>
<button type="submit" data-theme="f" class="cancelButton exportbtn" data-icon="check" id="createpdfexport">PDF-Umsatzbericht</button> <button type="submit" data-theme="f" class="cancelButton exportbtn" data-icon="check" id="createpdfexport">PDF-Umsatzbericht</button>
<button type="submit" data-theme="f" class="cancelButton exportbtn" data-icon="check" id="createpdfsummary">PDF-Zusammenfassung</button> <button type="submit" data-theme="f" class="cancelButton exportbtn" data-icon="check" id="createpdfsummary">PDF-Zusammenfassung</button>
@ -3739,6 +3747,7 @@ $(document).on("pageinit", "#admin-page", function () {
<div id="partOfAddRecPrinter"></div> <div id="partOfAddRecPrinter"></div>
<span id=addrecprinterhint></span> <span id=addrecprinterhint></span>
</div> </div>
<div id="partOfPrintcash"></div>
<br><b><u><span id="workreceiptssectiontxt">Arbeitsbons</span></u></b><br><br> <br><b><u><span id="workreceiptssectiontxt">Arbeitsbons</span></u></b><br><br>

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.5.19"> <link rel="stylesheet" type="text/css" href="css/bestformat.css?v=1.5.20">
<link rel="stylesheet" href="php/contenthandler.php?module=admin&command=getmobilecss" /> <link rel="stylesheet" href="php/contenthandler.php?module=admin&command=getmobilecss" />
<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

@ -1210,7 +1210,9 @@ class Admin {
array("sumupforcard",0,false), array("sumupforcard",0,false),
array("affiliatekey",'',true), array("affiliatekey",'',true),
array("appid",'',true), array("appid",'',true),
array("sumupfailuretext","",false) array("sumupfailuretext","",false),
array("printcash",0,false)
); );
if (is_null($pdo)) { if (is_null($pdo)) {
@ -1405,7 +1407,7 @@ class Admin {
$view = "preferences.html"; $view = "preferences.html";
} }
echo json_encode($view . "?v=1.5.19"); echo json_encode($view . "?v=1.5.20");
} }
} }
@ -1621,31 +1623,31 @@ 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.5.19"); } if ($_SESSION['right_waiter']) { $mainMenu[] = array("name" => $waitertxt[$lang], "link" => "waiter.html?v=1.5.20"); }
} else { } else {
if ($_SESSION['right_waiter']) { $mainMenu[] = array("name" => $waiterdesktxt[$lang], "link" => "waiterdesktop.php?v=1.5.19"); } if ($_SESSION['right_waiter']) { $mainMenu[] = array("name" => $waiterdesktxt[$lang], "link" => "waiterdesktop.php?v=1.5.20"); }
} }
if ($_SESSION['right_kitchen']) { $mainMenu[] = array("name" => $kitchentxt[$lang], "link" => "kitchen.html?v=1.5.19"); } if ($_SESSION['right_kitchen']) { $mainMenu[] = array("name" => $kitchentxt[$lang], "link" => "kitchen.html?v=1.5.20"); }
if ($_SESSION['right_bar']) { $mainMenu[] = array("name" => "Bar", "link" => "bar.html?v=1.5.19"); } if ($_SESSION['right_bar']) { $mainMenu[] = array("name" => "Bar", "link" => "bar.html?v=1.5.20"); }
if ($_SESSION['right_supply']) { $mainMenu[] = array("name" => $supplytxt[$lang], "link" => "supplydesk.html?v=1.5.19"); } if ($_SESSION['right_supply']) { $mainMenu[] = array("name" => $supplytxt[$lang], "link" => "supplydesk.html?v=1.5.20"); }
if ($_SESSION['modus'] == 0) { if ($_SESSION['modus'] == 0) {
if ($_SESSION['right_paydesk']) { $mainMenu[] = array("name" => $paydesktxt[$lang], "link" => "paydesk.html?v=1.5.19"); } if ($_SESSION['right_paydesk']) { $mainMenu[] = array("name" => $paydesktxt[$lang], "link" => "paydesk.html?v=1.5.20"); }
} }
if ($_SESSION['right_statistics']) { $mainMenu[] = array("name" => $stattxt[$lang], "link" => "reports.html?v=1.5.19"); } if ($_SESSION['right_statistics']) { $mainMenu[] = array("name" => $stattxt[$lang], "link" => "reports.html?v=1.5.20"); }
if ($_SESSION['right_bill']) { $mainMenu[] = array("name" => $bontxt[$lang], "link" => "bill.html?v=1.5.19"); } if ($_SESSION['right_bill']) { $mainMenu[] = array("name" => $bontxt[$lang], "link" => "bill.html?v=1.5.20"); }
if ($_SESSION['right_products']) { $mainMenu[] = array("name" => $prodtxt[$lang], "link" => "products.html?v=1.5.19"); } if ($_SESSION['right_products']) { $mainMenu[] = array("name" => $prodtxt[$lang], "link" => "products.html?v=1.5.20"); }
if ($_SESSION['right_reservation']) { $mainMenu[] = array("name" => $restxt[$lang], "link" => "reservation.html?v=1.5.19"); } if ($_SESSION['right_reservation']) { $mainMenu[] = array("name" => $restxt[$lang], "link" => "reservation.html?v=1.5.20"); }
if ($_SESSION['right_tasks'] || $_SESSION['right_tasksmanagement']) { $mainMenu[] = array("name" => $taskstxt[$lang], "link" => "tasks.html?v=1.5.19"); } if ($_SESSION['right_tasks'] || $_SESSION['right_tasksmanagement']) { $mainMenu[] = array("name" => $taskstxt[$lang], "link" => "tasks.html?v=1.5.20"); }
if ($_SESSION['right_rating']) { $mainMenu[] = array("name" => $ratingtxt[$lang], "link" => "rating.html?v=1.5.19"); } if ($_SESSION['right_rating']) { $mainMenu[] = array("name" => $ratingtxt[$lang], "link" => "rating.html?v=1.5.20"); }
if ($_SESSION['right_customers']) { $mainMenu[] = array("name" => $customerstxt[$lang], "link" => "customers.html?v=1.5.19"); } if ($_SESSION['right_customers']) { $mainMenu[] = array("name" => $customerstxt[$lang], "link" => "customers.html?v=1.5.20"); }
if ($_SESSION['right_pickups']) { $mainMenu[] = array("name" => $pickupstxt[$lang], "link" => "pickups.html?v=1.5.19"); } if ($_SESSION['right_pickups']) { $mainMenu[] = array("name" => $pickupstxt[$lang], "link" => "pickups.html?v=1.5.20"); }
if ($_SESSION['right_dash']) { $mainMenu[] = array("name" => $dashtxt[$lang], "link" => "dash.php?v=1.5.19"); } if ($_SESSION['right_dash']) { $mainMenu[] = array("name" => $dashtxt[$lang], "link" => "dash.php?v=1.5.20"); }
if ($_SESSION['right_manager'] || $_SESSION['is_admin'] || $_SESSION['right_closing']) { $mainMenu[] = array("name" => $admintxt[$lang], "link" => "manager.html?v=1.5.19"); } if ($_SESSION['right_manager'] || $_SESSION['is_admin'] || $_SESSION['right_closing']) { $mainMenu[] = array("name" => $admintxt[$lang], "link" => "manager.html?v=1.5.20"); }
$mainMenu[] = array("name" => $settingtxt[$lang], "link" => "preferences.html?v=1.5.19"); $mainMenu[] = array("name" => $settingtxt[$lang], "link" => "preferences.html?v=1.5.20");
if ($_SESSION['right_timetracking'] || $_SESSION['right_timemanager']) { $mainMenu[] = array("name" => $timetrackingtxt[$lang], "link" => "timetracking.html?v=1.5.19"); } if ($_SESSION['right_timetracking'] || $_SESSION['right_timemanager']) { $mainMenu[] = array("name" => $timetrackingtxt[$lang], "link" => "timetracking.html?v=1.5.20"); }
$mainMenu[] = array("name" => "Hilfe", "link" => "help.php?v=1.5.19"); $mainMenu[] = array("name" => "Hilfe", "link" => "help.php?v=1.5.20");
$mainMenu[] = array("name" => "Feedback", "link" => "feedback.html?v=1.5.19"); $mainMenu[] = array("name" => "Feedback", "link" => "feedback.html?v=1.5.20");
} }
$mainMenu[] = array("name" => $logout[$lang], "link" => "logout.php"); $mainMenu[] = array("name" => $logout[$lang], "link" => "logout.php");
@ -2246,7 +2248,9 @@ class Admin {
"sumupforcard" => array("dbcol" => "sumupforcard","checknum" => 0), "sumupforcard" => array("dbcol" => "sumupforcard","checknum" => 0),
"affiliatekey" => array("dbcol" => "affiliatekey","checknum" => 0), "affiliatekey" => array("dbcol" => "affiliatekey","checknum" => 0),
"appid" => array("dbcol" => "appid","checknum" => 0), "appid" => array("dbcol" => "appid","checknum" => 0),
"sumupfailuretext" => array("dbcol" => "sumupfailuretext","checknum" => 0) "sumupfailuretext" => array("dbcol" => "sumupfailuretext","checknum" => 0),
"printcash" => array("dbcol" => "printcash","checknum" => 0),
); );
$problem = false; $problem = false;
foreach ($changedValues as $aChangeSet) { foreach ($changedValues as $aChangeSet) {

View File

@ -42,6 +42,22 @@ class Bill {
} }
return; return;
} }
if ($command == 'exportAllCsv') {
if ($this->hasCurrentUserAdminOrManagerRights()) {
$this->exportAllCsvOrExcel($_GET['startMonth'],$_GET['startYear'],$_GET['endMonth'],$_GET['endYear'],DO_CSV);
} else {
echo json_encode(array("status" => "ERROR", "code" => ERROR_BILL_NOT_AUTHOTRIZED, "msg" => ERROR_BILL_NOT_AUTHOTRIZED_MSG));
}
return;
}
if ($command == 'exportAllExcel') {
if ($this->hasCurrentUserAdminOrManagerRights()) {
$this->exportAllCsvOrExcel($_GET['startMonth'],$_GET['startYear'],$_GET['endMonth'],$_GET['endYear'],DO_EXCEL);
} else {
echo json_encode(array("status" => "ERROR", "code" => ERROR_BILL_NOT_AUTHOTRIZED, "msg" => ERROR_BILL_NOT_AUTHOTRIZED_MSG));
}
return;
}
if ($command == 'exportXlsx') { if ($command == 'exportXlsx') {
if ($this->hasCurrentUserAdminOrManagerRights()) { if ($this->hasCurrentUserAdminOrManagerRights()) {
$this->exportCsv($_GET['startMonth'],$_GET['startYear'],$_GET['endMonth'],$_GET['endYear'],DO_EXCEL); $this->exportCsv($_GET['startMonth'],$_GET['startYear'],$_GET['endMonth'],$_GET['endYear'],DO_EXCEL);
@ -552,6 +568,14 @@ class Bill {
$stmt = $pdo->prepare(DbUtils::substTableAlias($sql)); $stmt = $pdo->prepare(DbUtils::substTableAlias($sql));
$stmt->execute(array($row->brutto + $row->prevbrutto,$row->netto + $row->prevnetto,$lastId)); $stmt->execute(array($row->brutto + $row->prevbrutto,$row->netto + $row->prevnetto,$lastId));
$printcash = CommonUtils::getConfigValue($pdo, 'printcash', 0);
if ($printcash == 1) {
if(session_id() == '') {
session_start();
}
$printer = $_SESSION['receiptprinter'];
PrintQueue::internalQueueReceiptPrintjob($pdo, $nextbillid, $printer);
}
$pdo->commit(); $pdo->commit();
echo json_encode(array("status" => "OK")); echo json_encode(array("status" => "OK"));
} else { } else {
@ -1076,6 +1100,200 @@ class Bill {
$pdfExport->exportPdfSummary($lang,$startMonth,$startYear,$endMonth,$endYear); $pdfExport->exportPdfSummary($lang,$startMonth,$startYear,$endMonth,$endYear);
} }
private function exportAllCsvOrExcel($startMonth,$startYear,$endMonth,$endYear,$exportFormat) {
set_time_limit(60*5);
if(session_id() == '') {
session_start();
}
$l = $_SESSION['language'];
$commonUtils = new CommonUtils();
$currency = $commonUtils->getCurrency();
$pdo = DbUtils::openDbAndReturnPdoStatic();
$decpoint = CommonUtils::getConfigValue($pdo, 'decpoint', '.');
if ($startMonth < 10) {
$startMonth = "0" . $startMonth;
}
if ($endMonth < 10) {
$endMonth = "0" . $endMonth;
}
$startDate = $startYear . "-" . $startMonth . "-01 00:00:00";
$endDate = $endYear . "-" . $endMonth . "-01";
$lastdayOfMonth = date("t", strtotime($endDate));
$endDate = $endYear . "-" . $endMonth . "-" . $lastdayOfMonth . " 23:59:59";
$objPHPExcel = new PHPExcel();
PHPExcel_Settings::setZipClass(PHPExcel_Settings::PCLZIP);
$locale = 'De';
if ($l == 1) {
$locale = 'En';
} else if ($l == 2) {
$locale = 'Es';
}
$validLocale = PHPExcel_Settings::setLocale($locale);
$objPHPExcel->getProperties()
->setCreator("OrderSprinter")
->setLastModifiedBy($_SESSION['currentuser'])
->setTitle("OrderSprinter Umsatzdatenexport")
->setSubject("OrderSprinter Umsatzdatenexport")
->setDescription("Umsätze")
->setKeywords("OrderSprinter Umsätze")
->setCategory("OrderSprinter Datenexport");
$objWorksheet = $objPHPExcel->getActiveSheet();
$allcells = array();
$firstRow = array(
$this->t['Date'][$l],
$this->t['ID'][$l],
$this->t['Tablename'][$l],
$this->t['Brutto'][$l] ."($currency)",
$this->t['Netto'][$l] . "($currency)",
'Umsatzsteuer (%)',
$this->t['host'][$l],
$this->t['Ref'][$l],
$this->t['State'][$l],
'Produkt',
'Produkt-ID',
$this->t['PayWay'][$l],
$this->t['reason'][$l],
$this->t['User'][$l],
$this->t['Userid'][$l],
$this->t['ClosId'][$l],
$this->t['ClosDate'][$l],
$this->t['ClosRemark'][$l]
);
$lineLength = count($firstRow);
$allcells[] = $firstRow;
$payment_lang = array("name","name_en","name_esp");
$payment_col = $payment_lang[$l];
$sql = "
SELECT B.billdate as billdate,B.id as billid,
IF(tableid > '0',(SELECT tableno FROM %resttables% WHERE id=tableid),'') as tablename,
(IF(B.status='s',-1,1) * price) as brutto,
(IF(B.status='s',-1,1) * Q.price / (1 + Q.tax * 0.01)) as netto,
Q.tax as tax,
(IF(B.host = '1','x','-')) as host,
IFNULL(B.ref,'') as reference,B.status as status,productname,productid,P.$payment_col as payment,
IFNULL(B.reason,'') as reason,
U.username,U.id as userid,closingid,C.closingdate as closingdate, IFNULL(C.remark,'') as remark
from %billproducts% BP,%queue% Q,%bill% B,%payment% P,%user% U,%closing% C
WHERE BP.queueid=Q.id AND BP.billid=B.id AND B.closingid is not null AND B.paymentid=P.id
AND U.id=B.userid AND B.closingid=C.id
AND B.billdate >= ? AND B.billdate <= ?
UNION ALL
SELECT B.billdate as billdate,B.id as billid,'' as tablename, B.brutto as brutto,B.netto as netto,'' as tax,'' as host,'' as reference,status,'Einlage' as productname,
'' as productid,'Barzahlung' as payment, IFNULL(B.reason,'') as reason, U.username, U.id as userid,closingid,C.closingdate as closingdate,IFNULL(C.remark,'') as remark
FROM %bill% B,%user% U,%closing% C WHERE B.status='c' AND B.closingid is not null AND B.userid=U.id AND B.closingid=C.id
AND B.billdate >= ? AND B.billdate <= ?
ORDER BY
billid
";
$result = CommonUtils::fetchSqlAll($pdo, $sql, array($startDate,$endDate,$startDate,$endDate));
foreach($result as $z) {
set_time_limit(60*5);
$brutto = $z['brutto'];
$netto = $z['netto'];
$tax = $z['tax'];
if ($exportFormat == DO_CSV) {
$brutto = number_format($brutto, 2, $decpoint, '');
$netto = str_replace(".",$decpoint,$netto);
if ($tax != '') {
$tax = number_format($tax, 2, $decpoint, '');
}
}
$status = $z['status'];
$cat = 'Produktverkauf';
if ($status == 'x') {
$cat = $this->t["laterCancelled"][$l];
} else if ($status == 's') {
$cat = $this->t["storno"][$l];
} else if ($status == 'c') {
$status = $this->t["cashact"][$l];
}
$line = array(
$z['billdate'],
$z['billid'],$z['tablename'],
$brutto,$netto,
$tax,
$z['host'],
$z['reference'],
$cat,
$z['productname'],
$z['productid'],
$z['payment'],
$z['reason'],
$z['username'],$z['userid'],
$z['closingid'],$z['closingdate'],$z['remark']);
$allcells[] = $line;
}
$objWorksheet->fromArray(
$allcells, // The data to set
NULL, // Array values with this value will not be set
'A1' // Top left coordinate of the worksheet range where
);
$lastChar = chr(ord('A') + $lineLength - 1);
$range = "A1:$lastChar" . "1";
$objWorksheet->getStyle($range)->getFill()
->setFillType(PHPExcel_Style_Fill::FILL_SOLID)
->getStartColor()->setARGB('FFadf6aa');
$range = "A2:" . $lastChar . count($allcells);
$objWorksheet->getStyle($range)->getFill()
->setFillType(PHPExcel_Style_Fill::FILL_SOLID)
->getStartColor()->setARGB('FFd6edf8');
if ($exportFormat == DO_EXCEL) {
$formatCodeBrutto = "0.00";
$formatCodeNetto = "0.0000";
for ($i=1;$i<count($allcells);$i++) {
$aVal = $objWorksheet->getCell('D' . ($i+1)) ->getValue();
$objWorksheet->getCell('D' . ($i+1)) ->setValueExplicit($aVal,PHPExcel_Cell_DataType::TYPE_NUMERIC);
$objWorksheet->getStyle('D' . ($i+1))->getNumberFormat()->setFormatCode($formatCodeBrutto);
$aVal = $objWorksheet->getCell('E' . ($i+1)) ->getValue();
$objWorksheet->getCell('E' . ($i+1)) ->setValueExplicit($aVal,PHPExcel_Cell_DataType::TYPE_NUMERIC);
$objWorksheet->getStyle('E' . ($i+1))->getNumberFormat()->setFormatCode($formatCodeNetto);
}
}
if ($exportFormat == DO_CSV) {
header("Content-type: text/x-csv");
header("Content-Disposition: attachment; filename=\"ordersprinter-datenexport.csv\"");
header("Cache-Control: max-age=0");
$objWriter = new PHPExcel_Writer_CSV($objPHPExcel);
$objWriter->setDelimiter(';');
} else {
header("Content-Type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");
header("Content-Disposition: attachment; filename=\"ordersprinter-datenexport.xls\"");
header("Cache-Control: max-age=0");
$objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, 'Excel5');
}
$objWriter->save("php://output");
$objPHPExcel->disconnectWorksheets();
unset($objPHPExcel);
}
private function exportCsv($startMonth,$startYear,$endMonth,$endYear,$exportType) { private function exportCsv($startMonth,$startYear,$endMonth,$endYear,$exportType) {
$this->exportCsv_bin($startMonth,$startYear,$endMonth,$endYear,null,$exportType); $this->exportCsv_bin($startMonth,$startYear,$endMonth,$endYear,null,$exportType);
} }
@ -1087,15 +1305,6 @@ class Bill {
$this->exportCsv_bin(null,null,null,null,$closingid,$exportFormat); $this->exportCsv_bin(null,null,null,null,$closingid,$exportFormat);
} }
private function getDecPoint() {
$sql = "SELECT name,setting FROM %config% WHERE name=?";
$pdo = $this->dbutils->openDbAndReturnPdo();
$stmt = $pdo->prepare($this->dbutils->resolveTablenamesInSqlString($sql));
$stmt->execute(array("decpoint"));
$row = $stmt->fetchObject();
return($row->setting);
}
private function exportCsv_bin($startMonth,$startYear,$endMonth,$endYear,$onlyClosingId,$exportFormat) { private function exportCsv_bin($startMonth,$startYear,$endMonth,$endYear,$onlyClosingId,$exportFormat) {
if(session_id() == '') { if(session_id() == '') {
session_start(); session_start();

View File

@ -853,7 +853,7 @@ class Customers {
$txt = "<head>"; $txt = "<head>";
$txt .= "<title>" . self::$CUS_OVERVIEW[$lang] . "</title>"; $txt .= "<title>" . self::$CUS_OVERVIEW[$lang] . "</title>";
$txt .= '<meta http-equiv="content-type" content="text/html; charset=utf-8">'; $txt .= '<meta http-equiv="content-type" content="text/html; charset=utf-8">';
$txt .= '<link rel="stylesheet" type="text/css" href="../css/guestreport.css?v=1.5.19">'; $txt .= '<link rel="stylesheet" type="text/css" href="../css/guestreport.css?v=1.5.20">';
$txt .= "</head>"; $txt .= "</head>";
return $txt; return $txt;
} }

View File

@ -27,7 +27,7 @@ if (isset($_POST["cmd"])) {
if (strlen($status) > 150) { if (strlen($status) > 150) {
$status = substr($status, 0,149); $status = substr($status, 0,149);
} }
$version = "1.5.19"; $version = "1.5.20";
$arr = array("cmd" => $cmd,"fct" => $fct, "xhr" => $xhr,"errormsg" => $errormsg,"status" => $status,"version" => $version,"phpversion" => $phpversion); $arr = array("cmd" => $cmd,"fct" => $fct, "xhr" => $xhr,"errormsg" => $errormsg,"status" => $status,"version" => $version,"phpversion" => $phpversion);
} else { } else {

View File

@ -223,10 +223,15 @@ class PrintQueue {
$jobs = array(); $jobs = array();
for ($printer=1;$printer<7;$printer++) { for ($printer=1;$printer<7;$printer++) {
$sql = "SELECT J.id as id,B.id as billid,billdate,brutto,R.tableno as tablename,type FROM %printjobs% J,%bill% B,%resttables% R WHERE printer=? AND type = '" . self::$RECEIPT . "' AND content=B.id AND B.tableid=R.id"; $sql = "SELECT J.id as id,B.id as billid,billdate,brutto,";
$sql .= " UNION "; $sql .= "CASE ";
$sql .= "SELECT J.id as id,B.id as billid,billdate,brutto,'To-Go' as tablename,type FROM %printjobs% J,%bill% B WHERE printer=? AND type = '" . self::$RECEIPT . "' AND content=B.id AND B.tableid='0'"; $sql .= " WHEN tableid='-1' THEN '---' ";
$resultBills = CommonUtils::fetchSqlAll($pdo, $sql, array($printer,$printer)); $sql .= " WHEN tableid='0' THEN 'To-Go' ";
$sql .= " ELSE (SELECT tableno FROM %resttables% WHERE id=B.tableid) ";
$sql .= "END as tablename,";
$sql .= "type FROM %printjobs% J,%bill% B WHERE printer=? AND type=? AND content=B.id ";
$resultBills = CommonUtils::fetchSqlAll($pdo, $sql, array($printer,self::$RECEIPT));
$sql = "SELECT %printjobs%.id as id,%closing%.id as closingid,type,closingdate FROM %printjobs%,%closing% WHERE printer=? AND type = '" . self::$CLOSING . "' AND content=%closing%.id"; $sql = "SELECT %printjobs%.id as id,%closing%.id as closingid,type,closingdate FROM %printjobs%,%closing% WHERE printer=? AND type = '" . self::$CLOSING . "' AND content=%closing%.id";
$resultClosings = CommonUtils::fetchSqlAll($pdo, $sql, array($printer)); $resultClosings = CommonUtils::fetchSqlAll($pdo, $sql, array($printer));

View File

@ -42,7 +42,7 @@ class Products {
$cmdArray = array('showDbProducts', 'getMenuLevelUp', 'applySingleProdData', 'createExtra', 'applyExtra', 'upExtra', 'delExtra','sortup','sortdown', 'delproduct', $cmdArray = array('showDbProducts', 'getMenuLevelUp', 'applySingleProdData', 'createExtra', 'applyExtra', 'upExtra', 'delExtra','sortup','sortdown', 'delproduct',
'reassign', 'applyType', 'delType', 'getSingleProdData', 'getSingleTypeData', 'getPriceLevelInfo','setPriceLevelInfo', 'createProduct','createProdType', 'reassign', 'applyType', 'delType', 'getSingleProdData', 'getSingleTypeData', 'getPriceLevelInfo','setPriceLevelInfo', 'createProduct','createProdType',
'addGeneralComment','changeGeneralComment','delGeneralComment','upGeneralComment','downGeneralComment','sortProdAlpha','getOnlyAllProds','loadprodimage','loadfullprodimageset', 'addGeneralComment','changeGeneralComment','delGeneralComment','upGeneralComment','downGeneralComment','sortProdAlpha','getOnlyAllProds','loadprodimage','loadfullprodimageset',
'deleteImageProdAssignment','cleanprodimagestable','getkeynames','assignProdImageToKey','prodimghmlexport'); 'deleteImageProdAssignment','cleanprodimagestable','getkeynames','assignProdImageToKey','prodimghmlexport','getAllActiveProducts','changesetofproducts');
if (in_array($command, $cmdArray)) { if (in_array($command, $cmdArray)) {
if (!($this->userrights->hasCurrentUserRight('right_products'))) { if (!($this->userrights->hasCurrentUserRight('right_products'))) {
if ($command == 'createProdType') { if ($command == 'createProdType') {
@ -175,6 +175,14 @@ class Products {
self::assignProdImageToKey($_POST['prodid'],$_POST['prodimageid']); self::assignProdImageToKey($_POST['prodid'],$_POST['prodimageid']);
} else if ($command == 'getkeynames') { } else if ($command == 'getkeynames') {
self::getkeynames(); self::getkeynames();
} else if ($command == 'getAllActiveProducts') {
$pdo = DbUtils::openDbAndReturnPdoStatic();
$allprods = self::getAllActiveProducts($pdo);
echo json_encode($allprods);
} else if ($command == 'changesetofproducts') {
$pdo = DbUtils::openDbAndReturnPdoStatic();
$ret = self::changesetofproducts($pdo,$_POST['changeset'],$_POST['newprods']);
echo json_encode($ret);
} else { } else {
echo "Command not supported."; echo "Command not supported.";
} }
@ -1801,4 +1809,129 @@ class Products {
echo json_encode($audioFiles); echo json_encode($audioFiles);
} }
private static function getAllProdTypesOfActiveProds($pdo) {
$sql = "SELECT DISTINCT category from %products% WHERE removed is null";
$result = CommonUtils::fetchSqlAll($pdo, $sql);
$types = array();
foreach($result as $pt) {
$types[] = self::getProdIdChain($pdo, $pt['category']);
}
return $types;
}
public static function getAllActiveProducts($pdo) {
try {
$alltypes = self::getAllProdTypesOfActiveProds($pdo);
$prods = array();
foreach($alltypes as $t) {
$sql = "SELECT * from %products% WHERE removed is null AND category=? ORDER BY sorting";
$result = CommonUtils::fetchSqlAll($pdo, $sql,array($t["id"]));
$prods[] = array("id" => $t["id"],"chain" => $t["chain"],"products" => $result);
$t["products"] = $result;
//$prods[] = array("type" => $t,"products" => $result);
}
return array("status" => "OK","msg" => $prods);
} catch (Exception $ex) {
return array("status" => "ERROR","msg" => $ex->getMessage());
}
}
private static function getProdIdChain($pdo,$prodid) {
$nameArr = self::getProdIdChainRecursiveCore($pdo, $prodid,array());
$chainNameArr = array();
for ($i=(count($nameArr)-1);$i>=0;$i--) {
$chainNameArr[] = $nameArr[$i];
}
return array("id" => $prodid,"chain" => implode(" - ", $chainNameArr));
}
private static function getProdIdChainRecursiveCore($pdo,$prodid,$name) {
$sql = "SELECT name,reference FROM %prodtype% WHERE id=?";
$r = CommonUtils::fetchSqlAll($pdo, $sql, array($prodid));
$curName = $r[0]['name'];
$name[] = $curName;
$parent = $r[0]['reference'];
if (is_null($parent)) {
return $name;
} else {
return self::getProdIdChainRecursiveCore($pdo, $parent, $name);
}
}
public static function changesetofproducts($pdo,$changeset,$newprods) {
try {
$pdo->beginTransaction();
foreach($changeset as $aChangedProd) {
$prodid = $aChangedProd["prodid"];
$longname = $aChangedProd["longname"];
$shortname = $aChangedProd["shortname"];
if (($longname == "") && ($shortname == "")) {
$pdo->rollBack();
return array("status" => "ERROR","msg" => "Name eines Produkts fehlt");
}
if (($longname == "") && ($shortname != "")) {
$longname = $shortname;
} else if (($longname != "") && ($shortname == "")) {
$shortname = $longname;
}
$priceA = $aChangedProd["priceA"];
$priceB = $aChangedProd["priceB"];
$priceC = $aChangedProd["priceC"];
if (!is_numeric($priceA) || !is_numeric($priceB) || !is_numeric($priceC)) {
$pdo->rollBack();
return array("status" => "ERROR","msg" => "Nicht alle Preise sind numerisch");
}
$sql = "UPDATE %products% SET shortname=?, longname=?, priceA=?, priceB=?, priceC=? WHERE id=?";
CommonUtils::execSql($pdo, $sql, array($shortname,$longname,$priceA,$priceB,$priceC,$prodid));
HistFiller::updateProdInHist($pdo,$prodid);
}
$sorter = new Sorter();
foreach($newprods as $prod) {
$prodtypeid = $prod["prodtypeid"];
$longname = $prod["longname"];
$shortname = $prod["shortname"];
$priceA = $prod["priceA"];
$priceB = $prod["priceB"];
$priceC = $prod["priceC"];
if (!is_numeric($prodtypeid)) {
$pdo->rollBack();
return array("status" => "ERROR","msg" => "Prod.kategorie ungültig");
}
if (($priceA == "") || ($priceB == "") || ($priceC == "")) {
$pdo->rollBack();
return array("status" => "ERROR","msg" => "Preisangabe eines neuen Produkts fehlt");
}
if (!is_numeric($priceA) || !is_numeric($priceB) || !is_numeric($priceC)) {
$pdo->rollBack();
return array("status" => "ERROR","msg" => "Preisangabe eines neuen Produkts ungültig");
}
if (($longname == "") || ($shortname == "")) {
$pdo->rollBack();
return array("status" => "ERROR","msg" => "Name eines neuen Produkts fehlt");
}
if (($longname == "") && ($shortname != "")) {
$longname = $shortname;
} else if (($longname != "") && ($shortname == "")) {
$shortname = $longname;
}
$prodEntry = new ProductEntry();
$prodEntry->createWithSubsetOfData($prodtypeid,$longname,$shortname,$priceA,$priceB,$priceC);
$newProdId = $prodEntry->createProductInDb($pdo);
$sorter->setMaxSortingForProdId($pdo, $newProdId);
HistFiller::createProdInHist($pdo, $newProdId);
}
$pdo->commit();
return array("status" => "OK");
} catch(Exception $ex) {
$pdo->rollBack();
return array("status" => "ERROR","msg" => $ex->getMessage());
}
}
} }

View File

@ -81,6 +81,7 @@ class HistFiller {
public static function updateProdInHist($pdo,$prodid) { public static function updateProdInHist($pdo,$prodid) {
self::updateOrCreateProdInHist($pdo,$prodid,'4'); self::updateOrCreateProdInHist($pdo,$prodid,'4');
} }
private static function getExtrasList($pdo,$prodid) { private static function getExtrasList($pdo,$prodid) {
$sql = "SELECT GROUP_CONCAT(%extras%.name) as extraslist FROM %extras%,%extrasprods% WHERE %extrasprods%.prodid=? AND %extrasprods%.extraid=%extras%.id"; $sql = "SELECT GROUP_CONCAT(%extras%.name) as extraslist FROM %extras%,%extrasprods% WHERE %extrasprods%.prodid=? AND %extrasprods%.extraid=%extras%.id";
$stmt = $pdo->prepare(DbUtils::substTableAlias($sql)); $stmt = $pdo->prepare(DbUtils::substTableAlias($sql));

View File

@ -36,6 +36,24 @@ class ProductEntry {
private static $DISPLAY = "Anzeige"; private static $DISPLAY = "Anzeige";
public function createWithSubsetOfData($prodtypeid,$longname,$shortname,$priceA,$priceB,$priceC) {
$this->longName = $longname;
$this->shortName = $shortname;
$this->priceA = $priceA;
$this->priceB = $priceB;
$this->priceC = $priceC;
$this->category = $prodtypeid;
$this->available = 1;
$this->favorite = 0;
$this->unit = null;
$this->taxaustria = null;
$this->display = null;
$this->days = '0123456';
$this->audio = null;
$this->barcode = "";
$this->amount = 0;
}
public function createFromPostData($postData) { public function createFromPostData($postData) {
$prodCols = DbUtils::$prodCols; $prodCols = DbUtils::$prodCols;
foreach($prodCols as $aCol) { foreach($prodCols as $aCol) {

View File

@ -1141,6 +1141,15 @@ class Version {
} }
} }
public static function upd_1519_1520($pdo, $prefix, $dbname) {
try {
self::insertOrUpdateConfigItem($pdo, 'printcash', '0');
return array(true);
} catch (PDOException $e) {
return array(false,$e);
}
}
public static $updateOrder = array( public static $updateOrder = array(
"1.3.0" => array("upd_1300_1301","1.3.1"), "1.3.0" => array("upd_1300_1301","1.3.1"),
"1.3.1" => array("upd_1301_1302","1.3.2"), "1.3.1" => array("upd_1301_1302","1.3.2"),
@ -1207,7 +1216,8 @@ class Version {
"1.5.15" => array("upd_1515_1516","1.5.16"), "1.5.15" => array("upd_1515_1516","1.5.16"),
"1.5.16" => array("upd_1516_1517","1.5.17"), "1.5.16" => array("upd_1516_1517","1.5.17"),
"1.5.17" => array("upd_1517_1518","1.5.18"), "1.5.17" => array("upd_1517_1518","1.5.18"),
"1.5.18" => array("upd_1518_1519","1.5.19") "1.5.18" => array("upd_1518_1519","1.5.19"),
"1.5.19" => array("upd_1519_1520","1.5.20")
); );
public static function runUpdateProcess($pdo,$prefix, $dbname, $untilVersion,$checkValidVersion) { public static function runUpdateProcess($pdo,$prefix, $dbname, $untilVersion,$checkValidVersion) {

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.5.19"> <link rel="stylesheet" type="text/css" href="css/bestformat.css?v=1.5.20">
<link rel="stylesheet" href="php/contenthandler.php?module=admin&command=getmobilecss" /> <link rel="stylesheet" href="php/contenthandler.php?module=admin&command=getmobilecss" />
<link rel="stylesheet" href="php/3rdparty/orderstyle/jquery.mobile.icons.min.css" /> <link rel="stylesheet" href="php/3rdparty/orderstyle/jquery.mobile.icons.min.css" />
@ -13,7 +13,7 @@
<script src="php/3rdparty/jquery-1.11.3.min.js"></script> <script src="php/3rdparty/jquery-1.11.3.min.js"></script>
<script src="php/3rdparty/jquery.mobile-1.4.5.min.js"></script> <script src="php/3rdparty/jquery.mobile-1.4.5.min.js"></script>
<script src="utilities.js?v=1.5.19"></script> <script src="utilities.js?v=1.5.20"></script>
<link rel="stylesheet" href="php/3rdparty/jqueryui1-11-4/jquery-ui.min.css" /> <link rel="stylesheet" href="php/3rdparty/jqueryui1-11-4/jquery-ui.min.css" />
<script src="php/3rdparty/jqueryui1-11-4/jquery-ui.min.js"></script> <script src="php/3rdparty/jqueryui1-11-4/jquery-ui.min.js"></script>

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.5.19"> <link rel="stylesheet" type="text/css" href="css/bestformat.css?v=1.5.20">
<link rel="stylesheet" href="php/contenthandler.php?module=admin&command=getmobilecss" /> <link rel="stylesheet" href="php/contenthandler.php?module=admin&command=getmobilecss" />
<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.5.19"> <link rel="stylesheet" type="text/css" href="css/bestformat.css?v=1.5.20">
<link rel="stylesheet" href="php/contenthandler.php?module=admin&command=getmobilecss" /> <link rel="stylesheet" href="php/contenthandler.php?module=admin&command=getmobilecss" />
<link rel="stylesheet" href="php/3rdparty/orderstyle/jquery.mobile.icons.min.css" /> <link rel="stylesheet" href="php/3rdparty/orderstyle/jquery.mobile.icons.min.css" />
@ -15,8 +15,8 @@
<script src="php/3rdparty/jquery-2.0.3.min.js"></script> <script src="php/3rdparty/jquery-2.0.3.min.js"></script>
<script src="php/3rdparty/jquery.mobile-1.4.0.min.js"></script> <script src="php/3rdparty/jquery.mobile-1.4.0.min.js"></script>
<script src="utilities.js"></script> <script src="utilities.js"></script>
<script src="elements/product.js?v=1.5.19"></script> <script src="elements/product.js?v=1.5.20"></script>
<script src="elements/extra.js?v=1.5.19"></script> <script src="elements/extra.js?v=1.5.20"></script>
<link href="php/3rdparty/hayageek_uploadfile.css" rel="stylesheet"> <link href="php/3rdparty/hayageek_uploadfile.css" rel="stylesheet">
<script src="php/3rdparty/hayageek_jquery_uploadfile.js"></script> <script src="php/3rdparty/hayageek_jquery_uploadfile.js"></script>
</head> </head>
@ -87,6 +87,7 @@ var PROD_PRODUCTS_LIST = ["Produkte","Products","Productos"];
var PROD_SET_TITLE = ["Gesamtes Bildmaterial","Full image set","Todos los imagenes"]; var PROD_SET_TITLE = ["Gesamtes Bildmaterial","Full image set","Todos los imagenes"];
var PROD_CLEAN_PRODIMAGES = ["Entferne nicht zugewiesene Bilder in der DB","Remove unassigned images from database","Removar imagenes non usados"]; var PROD_CLEAN_PRODIMAGES = ["Entferne nicht zugewiesene Bilder in der DB","Remove unassigned images from database","Removar imagenes non usados"];
var PROD_DOWNLOAD_PRODIMAGES = ["Download gesamtes Bildmaterial","Download complete Image Set","Download todos los imagenes"]; var PROD_DOWNLOAD_PRODIMAGES = ["Download gesamtes Bildmaterial","Download complete Image Set","Download todos los imagenes"];
var PROD_GO_DESKTOP = ["Preisliste in Desktop-Ansicht öffnen","Open price list in desktop view","Abrir lista de precios en vista de desktop"];
// this is the maximal price that a product may cost // this is the maximal price that a product may cost
var MAX_PRICE = 999.99; var MAX_PRICE = 999.99;
@ -120,6 +121,7 @@ function setLanguage(language) {
$("#headeroffullprodset").html(PROD_SET_TITLE[lang]); $("#headeroffullprodset").html(PROD_SET_TITLE[lang]);
$("#cleantxt").html(PROD_CLEAN_PRODIMAGES[lang]); $("#cleantxt").html(PROD_CLEAN_PRODIMAGES[lang]);
$("#downloadprodimagestxt").html(PROD_DOWNLOAD_PRODIMAGES[lang]); $("#downloadprodimagestxt").html(PROD_DOWNLOAD_PRODIMAGES[lang]);
$("#gotoproductsdesktop").html(PROD_GO_DESKTOP[lang]);
} }
function getAudioFiles() { function getAudioFiles() {
@ -148,6 +150,7 @@ function setLanguage(language) {
cmdBinding(); cmdBinding();
getProdsForProdsImageArea(); getProdsForProdsImageArea();
bindExpandProdEntry(); bindExpandProdEntry();
bindGotoDesktopView();
} }
function getProdsForProdsImageArea() { function getProdsForProdsImageArea() {
@ -418,6 +421,14 @@ function setLanguage(language) {
return txt; return txt;
} }
function bindGotoDesktopView() {
$("#gotoproductsdesktop").off("click").on("click", function (e) {
e.stopImmediatePropagation();
e.preventDefault();
setTimeout(function(){document.location.href = "productsdesktop.php";},250);
});
}
function bindExpandProdEntry() { function bindExpandProdEntry() {
$(".prodcollapsible").off("collapsibleexpand").on("collapsibleexpand", function (e) { $(".prodcollapsible").off("collapsibleexpand").on("collapsibleexpand", function (e) {
e.stopImmediatePropagation(); e.stopImmediatePropagation();
@ -1232,6 +1243,9 @@ function setLanguage(language) {
<div id="commentsarea"></div> <div id="commentsarea"></div>
<br> <br>
<button id="gotoproductsdesktop" type="submit" data-theme="d">Desktopview</button>
<div id="menuarea" > <div id="menuarea" >
<div data-role="collapsible" data-content-theme="f" data-theme="c" data-collapsed="false"> <div data-role="collapsible" data-content-theme="f" data-theme="c" data-collapsed="false">

368
webapp/productsdesktop.php Normal file
View File

@ -0,0 +1,368 @@
<html>
<head>
<title>Ansicht Produkte</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<meta name="author" content="Stefan Pichel">
<link rel="stylesheet" type="text/css" href="css/bestformat.css?v=1.5.20">
<link rel="stylesheet" href="css/ospage.css" />
<link rel="stylesheet" href="css/tablepanel.css" />
<link rel="stylesheet" href="css/productpanel.css" />
<link rel="stylesheet" href="php/3rdparty/jqueryui1-12-0/jquery-ui.min.css" />
<script src="php/3rdparty/jquery-2.2.4.min.js"></script>
<script src="php/3rdparty/jqueryui1-12-0/jquery-ui.min.js"></script>
<script src="utilities.js"></script>
<script>
var PRODDESK_LONG_NAME = ["Langname","Long name","Nombre largo"];
var PRODDESK_SHORTNAME = ["Kurzname","Short name","Nombre corto"];
var PRODDESK_PRICE = ["Preis","Price","Precio"];
var lang = 0;
var decpoint = '.';
var currency = 'Euro';
var loggedinUser = '';
var mainmenu = [];
var version = '';
var prods = null;
var newProdsOfType = {};
$(document).ready(function () {
doAjax("GET", "php/contenthandler.php?module=admin&command=getWaiterSettings", null, insertWaiterConfig, "Fehler Konfigurationsdaten", true);
doAjax("GET", "php/contenthandler.php?module=admin&command=getJsonMenuItemsAndVersion", null, saveMenuInfo, null, true);
intervalCheckConnection(2);
intervalGetPrinterStatus(5);
bindBackBtn();
bindApplyBtn();
});
function saveMenuInfo(menuAndVersion) {
if (menuAndVersion.loggedin == 1) {
loggedinUser = menuAndVersion.user;
$("#loggedinuser").html("&nbsp;" + loggedinUser);
$("#versioninfo").html(menuAndVersion.version);
version = menuAndVersion.version;
}
}
function bindBackBtn() {
$(".backtoproductsbtn").off("click").on("click", function (e) {
e.stopImmediatePropagation();
e.preventDefault();
setTimeout(function(){document.location.href = "products.html";},250);
});
}
function bindApplyBtn() {
$(".applyproductsbtn").off("click").on("click", function (e) {
e.stopImmediatePropagation();
e.preventDefault();
doApply();
});
}
function insertWaiterConfig(settings) {
var isUserLoggedIn = settings.isUserLoggedIn;
if (isUserLoggedIn != 1) {
setTimeout(function(){document.location.href = "index.html"},250);
} else {
var config = settings.config;
decpoint = config.decpoint;
currency = config.currency;
lang = settings.userlanguage;
}
doAjax("GET", "php/contenthandler.php?module=products&command=getAllActiveProducts", null, saveProducts, null, true);
}
function saveProducts(answer) {
if (answer.status != "OK") {
alert("Fehler: " + answer.msg);
return;
}
prods = answer.msg;
var text = '';
for (var i=0;i<prods.length;i++) {
var typeentry = prods[i];
text += renderProdsOfType(typeentry);
}
$("#main").html(text);
bindChange();
}
function renderProdsOfType(prodtype) {
var prodtypeid = prodtype.id;
var txt = "<table class='billtable'>";
txt += "<tr><th id='prodtype_" + prodtypeid + "' colspan='5'>" + toHtml(prodtype.chain) + "</tr>";
txt += "<tr><td>" + PRODDESK_LONG_NAME[lang];
txt += "<td>" + PRODDESK_SHORTNAME[lang];
txt += "<td>" + PRODDESK_PRICE[lang] + " (A)";
txt += "<td>" + PRODDESK_PRICE[lang] + " (B)";
txt += "<td>" + PRODDESK_PRICE[lang] + " (C)";
txt += "</tr>";
var prodsOfType = prodtype.products;
for (var i=0;i<prodsOfType.length;i++) {
txt += renderAProd(prodtypeid,prodsOfType[i]);
}
var newCounter = 1;
txt += renderNewProdLine(prodtypeid,1);
txt += "</table>";
newProdsOfType[prodtypeid] = newCounter;
return txt;
}
function renderNewProdLine(prodtypeid,counter) {
var idSuffixOfNewProd = prodtypeid + "_new_" + counter;
var txt = "<tr id='newprodline_" + prodtypeid + "_" + counter + "'>";
txt += '<td><input id="longname_' + idSuffixOfNewProd + '" class="newfield" value="" />';
txt += '<td><input id="shortname_' + idSuffixOfNewProd + '" class="newfield" value="" />';
txt += '<td><input id="pricea_' + idSuffixOfNewProd + '" class="newfield" value="" />';
txt += '<td><input id="priceb_' + idSuffixOfNewProd + '" class="newfield" value="" />';
txt += '<td><input id="pricec_' + idSuffixOfNewProd + '" class="newfield" value="" /></tr>';
return txt;
}
function renderAProd(prodtypeid,product) {
var txt = "";
txt += "<tr>";
txt += "<td>" + asInput('longname_' + prodtypeid + "_" + product.id,toHtml(product.longname));
txt += "<td>" + asInput('shortname_' + prodtypeid + "_" + product.id,toHtml(product.shortname));
txt += "<td>" + asInput('pricea_' + prodtypeid + "_" + product.id,priceFormat(product.priceA));
txt += "<td>" + asInput('priceb_' + prodtypeid + "_" + product.id,priceFormat(product.priceB));
txt += "<td>" + asInput('pricec_' + prodtypeid + "_" + product.id,priceFormat(product.priceC));
txt += "</tr>";
return txt;
}
function priceFormat(price) {
return price.toString().replace(".",decpoint);
}
function asInput(id,value) {
var txt = '<input id="' + id + '" value="' + value + '" />';
return txt;
}
function bindChange() {
$(".billtable input").off("keyup").on("keyup", function (e) {
e.stopImmediatePropagation();
e.preventDefault();
var id = this.id;
var prodtypeid = id.split("_")[1];
var prodidOrNewCat = id.split("_")[2];
if (prodidOrNewCat == "new") {
var curCounter = parseInt(id.split("_")[3]);
var curCat = id.split("_")[0];
var shortname = $("#shortname_" + prodtypeid + "_new_" + curCounter).val().trim();
var longname = $("#longname_" + prodtypeid + "_new_" + curCounter).val().trim();
var pricea = $("#pricea_" + prodtypeid + "_new_" + curCounter).val().trim();
var priceb = $("#priceb_" + prodtypeid + "_new_" + curCounter).val().trim();
var pricec = $("#pricec_" + prodtypeid + "_new_" + curCounter).val().trim();
$("#" + id).data("entered",1);
var isEnteredLongName = $("#longname_" + prodtypeid + "_new_" + curCounter).data("entered");
var isEnteredShortName = $("#shortname_" + prodtypeid + "_new_" + curCounter).data("entered");
var isEnteredPriceA = $("#pricea_" + prodtypeid + "_new_" + curCounter).data("entered");
var isEnteredPriceB = $("#priceb_" + prodtypeid + "_new_" + curCounter).data("entered");
var isEnteredPriceC = $("#pricec_" + prodtypeid + "_new_" + curCounter).data("entered");
if (curCat == "longname") {
if ((shortname == "") || (isEnteredShortName == undefined)) {
$("#shortname_" + prodtypeid + "_new_" + curCounter).val(longname);
}
} else if (curCat == "shortname") {
if ((longname == "") || (isEnteredLongName == undefined)) {
$("#longname_" + prodtypeid + "_new_" + curCounter).val(shortname);
}
} else if (curCat == "pricea") {
if ((priceb == "") || (isEnteredPriceB == undefined)) {
$("#priceb_" + prodtypeid + "_new_" + curCounter).val(pricea);
}
if ((pricec == "") || (isEnteredPriceC == undefined)) {
$("#pricec_" + prodtypeid + "_new_" + curCounter).val(pricea);
}
} else if (curCat == "priceb") {
if ((pricea == "") || (isEnteredPriceA == undefined)) {
$("#pricea_" + prodtypeid + "_new_" + curCounter).val(priceb);
}
if ((pricec == "") || (isEnteredPriceC == undefined)) {
$("#pricec_" + prodtypeid + "_new_" + curCounter).val(priceb);
}
} else if (curCat == "pricec") {
if ((pricea == "") || (isEnteredPriceA == undefined)) {
$("#pricea_" + prodtypeid + "_new_" + curCounter).val(pricec);
}
if ((priceb == "") || (isEnteredPriceB == undefined)) {
$("#priceb_" + prodtypeid + "_new_" + curCounter).val(pricec);
}
}
if (curCounter >= newProdsOfType[prodtypeid]) {
var txt = renderNewProdLine(prodtypeid,curCounter + 1);
$(txt).insertAfter("#newprodline_" + prodtypeid + "_" + curCounter);
newProdsOfType[prodtypeid] = curCounter + 1;
bindChange();
}
} else {
var prodid = prodidOrNewCat;
colorFieldsIfNeeded(prodtypeid,prodid);
}
});
}
function colorFieldsIfNeeded(prodtypeid,prodid) {
var theChangedProduct = findProduct(prodtypeid,prodid);
if (theChangedProduct == null) {
return;
}
colorTextInputField("#longname_" + prodtypeid + "_" + prodid,theChangedProduct.longname,false);
colorTextInputField("#shortname_" + prodtypeid + "_" + prodid,theChangedProduct.shortname,false);
colorTextInputField("#pricea_" + prodtypeid + "_" + prodid,theChangedProduct.priceA,true);
colorTextInputField("#priceb_" + prodtypeid + "_" + prodid,theChangedProduct.priceB,true);
colorTextInputField("#pricec_" + prodtypeid + "_" + prodid,theChangedProduct.priceC,true);
}
function colorTextInputField(idOfProperty,origContent,isNum) {
var propOnUi = $(idOfProperty).val().trim();
origContent = origContent.trim();
if (isNum) {
propOnUi = propOnUi.toString().replace(",",".");
}
if (propOnUi == origContent) {
$(idOfProperty).removeClass("changedfield");
} else {
$(idOfProperty).addClass("changedfield");
}
}
function findProduct(prodtypeid,prodid) {
for (var i=0;i<prods.length;i++) {
var typeentry = prods[i];
if (typeentry.id == prodtypeid) {
var prodsOfType = typeentry.products;
for (var j=0;j<prodsOfType.length;j++) {
var aProd = prodsOfType[j];
if (aProd.id == prodid) {
return aProd;
}
}
}
}
return null;
}
function doApply() {
var changedProds = [];
var newProds = [];
for (var i=0;i<prods.length;i++) {
var typeentry = prods[i];
var prodtypeid = typeentry.id;
var prodsOfType = typeentry.products;
for (var j=0;j<prodsOfType.length;j++) {
var aProd = prodsOfType[j];
if (isProdChanged(prodtypeid,aProd.id,aProd)) {
changedProds[changedProds.length] = {
prodid: aProd.id,
longname: $("#longname_" + prodtypeid + "_" + aProd.id).val().trim(),
shortname: $("#shortname_" + prodtypeid + "_" + aProd.id).val().trim(),
priceA: $("#pricea_" + prodtypeid + "_" + aProd.id).val().trim().replace(",","."),
priceB: $("#priceb_" + prodtypeid + "_" + aProd.id).val().trim().replace(",","."),
priceC: $("#pricec_" + prodtypeid + "_" + aProd.id).val().trim().replace(",",".")
};
}
}
var counterOfProdType = newProdsOfType[prodtypeid];
for (counter = 1;counter <= (counterOfProdType - 1); counter++) {
var aNewProd = {
prodtypeid: prodtypeid,
longname: $("#longname_" + prodtypeid + "_new_" + counter).val().trim(),
shortname: $("#shortname_" + prodtypeid + "_new_" + counter).val().trim(),
priceA: $("#pricea_" + prodtypeid + "_new_" + counter).val().trim().replace(",","."),
priceB: $("#priceb_" + prodtypeid + "_new_" + counter).val().trim().replace(",","."),
priceC: $("#pricec_" + prodtypeid + "_new_" + counter).val().trim().replace(",",".")
}
if ((aNewProd.longname != "") && (aNewProd.shortname != "")) {
newProds[newProds.length] = aNewProd;
}
}
}
var data = {
changeset: changedProds,
newprods: newProds
};
doAjax("POST", "php/contenthandler.php?module=products&command=changesetofproducts", data, handleChangeProds, null, true);
}
function isProdChanged(prodtypeid,prodid,origProd) {
var changed = false;
changed |= isPropertyChanged("#longname_" + prodtypeid + "_" + prodid,origProd.longname,false);
changed |= isPropertyChanged("#shortname_" + prodtypeid + "_" + prodid,origProd.shortname,false);
changed |= isPropertyChanged("#pricea_" + prodtypeid + "_" + prodid,origProd.priceA,true);
changed |= isPropertyChanged("#priceb_" + prodtypeid + "_" + prodid,origProd.priceB,true);
changed |= isPropertyChanged("#pricec_" + prodtypeid + "_" + prodid,origProd.priceC,true);
return changed;
}
function isPropertyChanged(idOfProperty,origContent,isNum) {
var propOnUi = $(idOfProperty).val().trim();
origContent = origContent.trim();
if (isNum) {
propOnUi = propOnUi.toString().replace(",",".");
}
if (propOnUi == origContent) {
return false;
} else {
return true;
}
}
function handleChangeProds(answer) {
if (answer.status != "OK") {
alert("Fehler: " + answer.msg);
return;
}
alert("Änderungen erfolgt!");
setTimeout(function(){document.location.href = "productsdesktop.php"},250);
}
</script>
</head>
<style>
</style>
<body>
<div class="tableospage">
<span class="header">Angebotsansicht <img src="img/connection.png" class="connectionstatus" style="display:none;" /> <img src="img/printerstatus.png" class="printerstatus" style="display:none;" /> <img src="img/tasksstatus.png" class="tasksstatus" style="display:none;" /></span>
</div>
<input class="backtoproductsbtn input100 inputwhite" type="submit" value="Zur&uuml;ck zur mobilen Produktansicht" style="background-color: #f2d7d5;width:49%;" />
<input class="applyproductsbtn input100 inputwhite"type="submit" value="Anwenden" style="background-color: #58d68d;width:49%;" />
<div id="allwithoutheaderfooter">
<div id="main">
<img src="php/3rdparty/images/ajax-loader.gif" />
</div>
</div>
<input class="backtoproductsbtn input100 inputwhite" type="submit" value="Zur&uuml;ck zur mobilen Produktansicht" style="background-color: #f2d7d5;width:49%;" />
<input class="applyproductsbtn input100 inputwhite"type="submit" value="Anwenden" style="background-color: #58d68d;width:49%;" />
<div class="tablefooter">
<span id="loggedinuser"></span>
<span id="versioninfo"></span>
</div>
</body>
</html>

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.5.19"> <link rel="stylesheet" type="text/css" href="css/bestformat.css?v=1.5.20">
<link rel="stylesheet" href="php/contenthandler.php?module=admin&command=getmobilecss" /> <link rel="stylesheet" href="php/contenthandler.php?module=admin&command=getmobilecss" />
<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.5.19"> <link rel="stylesheet" type="text/css" href="css/bestformat.css?v=1.5.20">
<link rel="stylesheet" href="php/contenthandler.php?module=admin&command=getmobilecss" /> <link rel="stylesheet" href="php/contenthandler.php?module=admin&command=getmobilecss" />
<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.5.19"> <link rel="stylesheet" type="text/css" href="css/bestformat.css?v=1.5.20">
<link rel="stylesheet" href="php/contenthandler.php?module=admin&command=getmobilecss" /> <link rel="stylesheet" href="php/contenthandler.php?module=admin&command=getmobilecss" />
<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

@ -30,7 +30,7 @@ var SUM_REASON = ["Grund","Reason","Razón"];
var SUM_CANCEL_ITEM = ["Stornierung","Cancellation","Revocación"]; var SUM_CANCEL_ITEM = ["Stornierung","Cancellation","Revocación"];
var SUM_CANCELLATION_OK = ["Die Zahlung wurde in OrderSprinter storniert.","The payment was cancelled in OrderSprinter.","El pago se canceló en OrderSprinter."]; var SUM_CANCELLATION_OK = ["Die Zahlung wurde in OrderSprinter storniert.","The payment was cancelled in OrderSprinter.","El pago se canceló en OrderSprinter."];
var nextpage = "paydesk.html?version=1.5.19"; var nextpage = "paydesk.html?version=1.5.20";
var lang; var lang;
@ -84,10 +84,10 @@ function setLanguage(language) {
if (nextPage == "p") { if (nextPage == "p") {
$("#nextpagebtntxt").html(SUM_TO_PAYMENT[lang]); $("#nextpagebtntxt").html(SUM_TO_PAYMENT[lang]);
nextpage = "paydesk.html?t=" + tableid + "&version=1.5.19"; nextpage = "paydesk.html?t=" + tableid + "&version=1.5.20";
} else { } else {
$("#nextpagebtntxt").html(SUM_TO_ORDER[lang]); $("#nextpagebtntxt").html(SUM_TO_ORDER[lang]);
nextpage = "waiter.html?version=1.5.19"; nextpage = "waiter.html?version=1.5.20";
} }
var txt = "<table class='viewtable'>"; var txt = "<table class='viewtable'>";

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.5.19"> <link rel="stylesheet" type="text/css" href="css/bestformat.css?v=1.5.20">
<link rel="stylesheet" href="php/contenthandler.php?module=admin&command=getmobilecss" /> <link rel="stylesheet" href="php/contenthandler.php?module=admin&command=getmobilecss" />
<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.5.19"> <link rel="stylesheet" type="text/css" href="css/bestformat.css?v=1.5.20">
<link rel="stylesheet" href="php/contenthandler.php?module=admin&command=getmobilecss" /> <link rel="stylesheet" href="php/contenthandler.php?module=admin&command=getmobilecss" />
<link rel="stylesheet" href="php/3rdparty/orderstyle/jquery.mobile.icons.min.css" /> <link rel="stylesheet" href="php/3rdparty/orderstyle/jquery.mobile.icons.min.css" />
@ -13,7 +13,7 @@
<script src="php/3rdparty/jquery-1.11.3.min.js"></script> <script src="php/3rdparty/jquery-1.11.3.min.js"></script>
<script src="php/3rdparty/jquery.mobile-1.4.5.min.js"></script> <script src="php/3rdparty/jquery.mobile-1.4.5.min.js"></script>
<script src="utilities.js?v=1.5.19"></script> <script src="utilities.js?v=1.5.20"></script>
<link rel="stylesheet" href="php/3rdparty/jqueryui1-11-4/jquery-ui.min.css" /> <link rel="stylesheet" href="php/3rdparty/jqueryui1-11-4/jquery-ui.min.css" />
<script src="php/3rdparty/jqueryui1-11-4/jquery-ui.min.js"></script> <script src="php/3rdparty/jqueryui1-11-4/jquery-ui.min.js"></script>

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.5.19"> <link rel="stylesheet" type="text/css" href="css/bestformat.css?v=1.5.20">
<link rel="stylesheet" href="php/contenthandler.php?module=admin&command=getmobilecss" /> <link rel="stylesheet" href="php/contenthandler.php?module=admin&command=getmobilecss" />
<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

@ -4,8 +4,8 @@
<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.5.19"> <link rel="stylesheet" type="text/css" href="css/bestformat.css?v=1.5.20">
<link rel="stylesheet" type="text/css" href="css/numfield.css?v=1.5.19"> <link rel="stylesheet" type="text/css" href="css/numfield.css?v=1.5.20">
<link rel="stylesheet" href="php/contenthandler.php?module=admin&command=getmobilecss" /> <link rel="stylesheet" href="php/contenthandler.php?module=admin&command=getmobilecss" />
<link rel="stylesheet" href="php/3rdparty/orderstyle/jquery.mobile.icons.min.css" /> <link rel="stylesheet" href="php/3rdparty/orderstyle/jquery.mobile.icons.min.css" />