1370 lines
48 KiB
HTML
1370 lines
48 KiB
HTML
|
<html>
|
|||
|
<head>
|
|||
|
<title>Ansicht Kassenbons</title>
|
|||
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|||
|
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
|
|||
|
|
|||
|
<link rel="stylesheet" type="text/css" href="css/bestformat.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/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.mobile-1.4.0.min.js"></script>
|
|||
|
<script src="utilities.js"></script>
|
|||
|
|
|||
|
<style>
|
|||
|
@media all
|
|||
|
{
|
|||
|
.printpart {display: none;}
|
|||
|
}
|
|||
|
@media print
|
|||
|
{
|
|||
|
.printpart {display: inline;};
|
|||
|
}
|
|||
|
@media print
|
|||
|
{
|
|||
|
.noprint {display: none;};
|
|||
|
}
|
|||
|
</style>
|
|||
|
|
|||
|
</head>
|
|||
|
|
|||
|
<body>
|
|||
|
|
|||
|
<script>
|
|||
|
|
|||
|
|
|||
|
function hideElementsForNonAdminUser(jsonAnswer) {
|
|||
|
if (jsonAnswer != "Yes") {
|
|||
|
$("#dbactionui").hide();
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
function hideElementsForNonAdminManagerUser(jsonAnswer) {
|
|||
|
if (jsonAnswer != "Yes") {
|
|||
|
$("#allpagecontent").hide();
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
function getTax() {
|
|||
|
doAjax("GET", "php/contenthandler.php?module=admin&command=getTax", null, insertTax, "Fehler");
|
|||
|
}
|
|||
|
function getTogoTax() {
|
|||
|
doAjax("GET", "php/contenthandler.php?module=admin&command=getTogoTax", null, insertTogoTax, "Fehler");
|
|||
|
}
|
|||
|
function getCompanyInfo() {
|
|||
|
doAjax("GET", "php/contenthandler.php?module=admin&command=getCompanyInfo", null, insertCompanyInfo, "Fehler");
|
|||
|
}
|
|||
|
function getServerUrl() {
|
|||
|
doAjax("GET", "php/contenthandler.php?module=admin&command=getServerUrl", null, insertServerUrl, "Fehler");
|
|||
|
}
|
|||
|
function getLogoUrl() {
|
|||
|
doAjax("GET", "php/contenthandler.php?module=admin&command=getLogoUrl", null, insertLogoUrl, "Fehler");
|
|||
|
}
|
|||
|
function getSpeisekarte() {
|
|||
|
doAjax("GET", "php/contenthandler.php?module=products&command=getSpeisekarte", null, insertSpeisekarte, "Fehler");
|
|||
|
}
|
|||
|
function getPayPrintType() {
|
|||
|
doAjax("GET", "php/contenthandler.php?module=admin&command=getPayPrintType", null, insertPayPrintType, "Fehler");
|
|||
|
}
|
|||
|
function getEmail() {
|
|||
|
doAjax("GET", "php/contenthandler.php?module=admin&command=getEmail", null, insertEmail, "Fehler");
|
|||
|
}
|
|||
|
function insertTax(taxval) {
|
|||
|
if (taxval == "FAILED") {
|
|||
|
alert("Keine Umsatzsteuerinformation");
|
|||
|
} else {
|
|||
|
var usstGerVal = taxval.replace(".", ",");
|
|||
|
$("#usstval").val(usstGerVal);
|
|||
|
}
|
|||
|
}
|
|||
|
function insertTogoTax(taxval) {
|
|||
|
if (taxval == "FAILED") {
|
|||
|
alert("Keine ToGo-Umsatzsteuerinformation");
|
|||
|
} else {
|
|||
|
var usstGerVal = taxval.replace(".", ",");
|
|||
|
$("#togotaxval").val(usstGerVal);
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
function insertEmail(email) {
|
|||
|
$("#email").val(email);
|
|||
|
}
|
|||
|
function insertCompanyInfo(companyInfo) {
|
|||
|
$("#companyinfo").val(companyInfo);
|
|||
|
}
|
|||
|
function insertServerUrl(serverUrl) {
|
|||
|
$("#serverUrl").val(serverUrl);
|
|||
|
}
|
|||
|
function insertLogoUrl(url) {
|
|||
|
$("#logoUrl").val(url);
|
|||
|
}
|
|||
|
function insertSpeisekarte(speisekarte) {
|
|||
|
$("#speiseninfo").val(speisekarte);
|
|||
|
}
|
|||
|
|
|||
|
function insertPayPrintType(payPrintType) {
|
|||
|
$("#partOfPayPrintType").html(createPayPrintTypePart(payPrintType));
|
|||
|
$("#configpart").trigger("create");
|
|||
|
$("#partOfPayPrintType").data("originalPayPrintType",payPrintType);
|
|||
|
}
|
|||
|
|
|||
|
function createPayPrintTypePart(localOrServer) {
|
|||
|
var html = '<div class="ui-field-contain">';
|
|||
|
html += '<label for="payprinttype">Druckkonzept:</label>';
|
|||
|
html += '<select name="payprinttype" id="payprinttype" data-theme="e">';
|
|||
|
if (localOrServer == 'l') {
|
|||
|
html += '<option value="1" selected>Lokal</option>';
|
|||
|
html += '<option value="2">Server</option>';
|
|||
|
} else {
|
|||
|
html += '<option value="1">Lokal</option>';
|
|||
|
html += '<option value="2" selected>Server</option>';
|
|||
|
}
|
|||
|
html += '</select></div>';
|
|||
|
return html;
|
|||
|
}
|
|||
|
function changeConfig(taxChanged,togoTaxChanged,stornocodeChanged,printpassChanged,companyInfoChanged,serverUrlChanged,logoUrlChanged,payPrintTypeChanged,emailChanged,tax,togoTax,stornocode,printpass,companyinfo,serverUrl,logoUrl,payPrintType,email) {
|
|||
|
taxEngl = tax.replace(",", ".");
|
|||
|
togoTaxEngl = togoTax.replace(",", ".");
|
|||
|
var data = {
|
|||
|
taxChanged : taxChanged,
|
|||
|
togoTaxChanged : togoTaxChanged,
|
|||
|
stornocodeChanged : stornocodeChanged,
|
|||
|
printpassChanged : printpassChanged,
|
|||
|
companyInfoChanged : companyInfoChanged,
|
|||
|
serverUrlChanged : serverUrlChanged,
|
|||
|
logoUrlChanged : logoUrlChanged,
|
|||
|
payPrintTypeChanged : payPrintTypeChanged,
|
|||
|
emailChanged : emailChanged,
|
|||
|
tax : taxEngl,
|
|||
|
togoTax : togoTaxEngl,
|
|||
|
stornocode: stornocode,
|
|||
|
printpass: printpass,
|
|||
|
companyinfo : companyinfo,
|
|||
|
serverUrl: serverUrl,
|
|||
|
logoUrl: logoUrl,
|
|||
|
payPrintType : payPrintType,
|
|||
|
email : email
|
|||
|
};
|
|||
|
doAjax("POST","php/contenthandler.php?module=admin&command=changeConfig",data,reactOnConfigChange,"Fehler");
|
|||
|
}
|
|||
|
|
|||
|
function reactOnConfigChange(result) {
|
|||
|
if (result == "OK") {
|
|||
|
$("#usstval").data("changed",false);
|
|||
|
$("#togotaxval").data("changed",false);
|
|||
|
$("#stornocode").data("changed",false);
|
|||
|
$("#printpass").data("changed",false);
|
|||
|
$("#companyinfo").data("changed",false);
|
|||
|
$("#serverUrl").data("changed",false);
|
|||
|
$("#logoUrl").data("changed",false);
|
|||
|
$("#email").data("changed",false);
|
|||
|
getPayPrintType(); // to update orig data
|
|||
|
alert("Konfiguration ge<67>ndert");
|
|||
|
} else {
|
|||
|
alert("Falsches Zahlenformat oder Serverproblem");
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
// refreshing the content
|
|||
|
$(document).ready(function() {
|
|||
|
var refreshId = setInterval(function() {
|
|||
|
getAndDisplayAllEntries();
|
|||
|
}, 10000);
|
|||
|
$.ajaxSetup({ cache: false });
|
|||
|
});
|
|||
|
|
|||
|
//areYouSure("Entfernen?", dialogText, "Ja", function() {
|
|||
|
//removeProductFromQueue(prodOfTable[this_elem.id]["queueid"]);
|
|||
|
//fillNotDeliveredProductsOfATable(urlProdOfTableNotDelivered,prodListToFill);
|
|||
|
//});
|
|||
|
|
|||
|
function areYouSure(text1, text2, button, callback) {
|
|||
|
$("#sure .sure-1").text(text1);
|
|||
|
$("#sure .sure-2").text(text2);
|
|||
|
$("#sure .sure-do").text(button).off("click.sure").on("click.sure", function() {
|
|||
|
callback();
|
|||
|
$(this).off("click.sure");
|
|||
|
});
|
|||
|
$.mobile.changePage("#sure");
|
|||
|
}
|
|||
|
|
|||
|
function binding() {
|
|||
|
// Action buttons
|
|||
|
|
|||
|
// createclosing
|
|||
|
$("#createclosing").off("click").on("click", function (e) {
|
|||
|
var remarkText =$('#remarkfield').val();
|
|||
|
$('#remarkfield').val("");
|
|||
|
|
|||
|
var filteredRemark = remarkText.replace(/\f/g,"").replace(/\n/g,"").replace(/\r/g,"").replace(/\t/g,"").replace(/\v/g,"");
|
|||
|
|
|||
|
doAjax("POST","php/contenthandler.php?module=closing&command=createClosing",{ remark: filteredRemark },createClosing,"Tagesabschluss");
|
|||
|
});
|
|||
|
|
|||
|
$(".csvExportButton").off("click").on("click", function (e) {
|
|||
|
var button_id = this.id;
|
|||
|
//this.id = "csvexport_id"
|
|||
|
var pos_underscore = button_id.indexOf("_");
|
|||
|
var closingid = button_id.substr(pos_underscore+1,button_id.length-1);
|
|||
|
window.location.href = "php/contenthandler.php?module=bill&command=exportCsvOfClosing&closingid=" + closingid;
|
|||
|
});
|
|||
|
|
|||
|
$(".csvExportAllButton").off("click").on("click", function (e) {
|
|||
|
var button_id = this.id;
|
|||
|
//this.id = "csvallexport_id"
|
|||
|
var pos_underscore = button_id.indexOf("_");
|
|||
|
var closingid = button_id.substr(pos_underscore+1,button_id.length-1);
|
|||
|
window.location.href = "php/contenthandler.php?module=closing&command=exportCsv&closingid=" + closingid;
|
|||
|
});
|
|||
|
|
|||
|
//getClosing
|
|||
|
$(".printButton").off("click").on("click", function (e) {
|
|||
|
e.stopImmediatePropagation();
|
|||
|
e.preventDefault();
|
|||
|
var button_id = this.id;
|
|||
|
//this.id = "printexport_id"
|
|||
|
var pos_underscore = button_id.indexOf("_");
|
|||
|
var closingid = button_id.substr(pos_underscore+1,button_id.length-1);
|
|||
|
|
|||
|
doAjax("GET","php/contenthandler.php?module=closing&command=getClosing",{closingid: closingid},doPrinting,"Druckproblem");
|
|||
|
});
|
|||
|
|
|||
|
$("#select-year").change(function() {
|
|||
|
getClosingsOfSelectedDate();
|
|||
|
});
|
|||
|
$("#select-month").change(function() {
|
|||
|
getClosingsOfSelectedDate();
|
|||
|
});
|
|||
|
|
|||
|
$("#changeConfig").off("click").on("click", function (e) {
|
|||
|
e.stopImmediatePropagation();
|
|||
|
e.preventDefault();
|
|||
|
var changeInfoText = "";
|
|||
|
var usstVal = $("#usstval").val();
|
|||
|
var usstChanged = hasChangedData("#usstval");
|
|||
|
if (usstChanged) {
|
|||
|
changeInfoText += " MwSt";
|
|||
|
}
|
|||
|
var togoTaxVal = $("#togotaxval").val();
|
|||
|
var togoTaxChanged = hasChangedData("#togotaxval");
|
|||
|
if (togoTaxChanged) {
|
|||
|
changeInfoText += " ToGo-MwSt";
|
|||
|
}
|
|||
|
var stornocode = $("#stornocode").val();
|
|||
|
var stornocodeChanged = hasChangedData("#stornocode");
|
|||
|
if (stornocodeChanged) {
|
|||
|
if (changeInfoText == "") {
|
|||
|
changeInfoText += " Stornocode";
|
|||
|
} else {
|
|||
|
changeInfoText += ", Stornocode";
|
|||
|
}
|
|||
|
}
|
|||
|
var printpass = $("#printpass").val();
|
|||
|
var printpassChanged = hasChangedData("#printpass");
|
|||
|
if (printpassChanged) {
|
|||
|
if (changeInfoText == "") {
|
|||
|
changeInfoText += " Printcode";
|
|||
|
} else {
|
|||
|
changeInfoText += ", Printcode";
|
|||
|
}
|
|||
|
}
|
|||
|
var companyinfo = $("#companyinfo").val();
|
|||
|
var companyInfoChanged = hasChangedData("#companyinfo");
|
|||
|
if (companyInfoChanged) {
|
|||
|
if (changeInfoText == "") {
|
|||
|
changeInfoText += " Betriebsinfo";
|
|||
|
} else {
|
|||
|
changeInfoText += ", Betriebsinfo";
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
var serverUrl = $("#serverUrl").val();
|
|||
|
var serverUrlChanged = hasChangedData("#serverUrl");
|
|||
|
if (serverUrlChanged) {
|
|||
|
if (changeInfoText == "") {
|
|||
|
changeInfoText += " Serveradresse";
|
|||
|
} else {
|
|||
|
changeInfoText += ", Serveradresse";
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
var logoUrl = $("#logoUrl").val();
|
|||
|
var logoUrlChanged = hasChangedData("#logoUrl");
|
|||
|
if (logoUrlChanged) {
|
|||
|
if (changeInfoText == "") {
|
|||
|
changeInfoText += " Logo-Adresse";
|
|||
|
} else {
|
|||
|
changeInfoText += ", Logo-Adresse";
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
var email = $("#email").val();
|
|||
|
var emailChanged = hasChangedData("#email");
|
|||
|
if (emailChanged) {
|
|||
|
if (changeInfoText == "") {
|
|||
|
changeInfoText += " Emailadresse";
|
|||
|
} else {
|
|||
|
changeInfoText += ", Emailadresse";
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
// $("#partOfPayPrintType").data("originalPayPrintType",true);
|
|||
|
// test for change of payPrintType
|
|||
|
var selectedPayPrintType = $("#payprinttype").find(":selected").val();
|
|||
|
var origType = $("#partOfPayPrintType").data("originalPayPrintType");
|
|||
|
var printTypeChanged = false;
|
|||
|
if ((selectedPayPrintType == 1) && (origType == 's')) {
|
|||
|
printTypeChanged = true;
|
|||
|
} else if ((selectedPayPrintType == 2) && (origType == 'l')) {
|
|||
|
printTypeChanged = true;
|
|||
|
}
|
|||
|
if (printTypeChanged) {
|
|||
|
if (changeInfoText == "") {
|
|||
|
changeInfoText += " Kassendrucker";
|
|||
|
} else {
|
|||
|
changeInfoText += ", Kassendrucker";
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
if (!usstChanged && !togoTaxChanged && !stornocodeChanged && !printpassChanged && !companyInfoChanged && !serverUrlChanged && !logoUrlChanged && !printTypeChanged && !emailChanged) {
|
|||
|
$( "#nochangeddata" ).popup( "open", {transition: 'flip'} );
|
|||
|
} else {
|
|||
|
areYouSure("Konfiguration <20>ndern?", "Sollen folgende Werte ge<67>ndert werden?" + changeInfoText, "Ja", function() {
|
|||
|
if (stornocodeChanged && ((stornocode == null) || (stornocode == ""))) {
|
|||
|
alert ("Stornocode nicht gesetzt - Abbruch");
|
|||
|
return;
|
|||
|
} else if (printpassChanged && ((printpass == null) || (printpass == ""))) {
|
|||
|
alert ("Printcode nicht gesetzt - Abbruch");
|
|||
|
return;
|
|||
|
} else {
|
|||
|
changeConfig(
|
|||
|
usstChanged ? 1 : 0,
|
|||
|
togoTaxChanged ? 1 : 0,
|
|||
|
stornocodeChanged ? 1 : 0,
|
|||
|
printpassChanged ? 1 : 0,
|
|||
|
companyInfoChanged ? 1 : 0,
|
|||
|
serverUrlChanged ? 1 : 0,
|
|||
|
logoUrlChanged ? 1 : 0,
|
|||
|
printTypeChanged ? 1 : 0,
|
|||
|
emailChanged ? 1 : 0,
|
|||
|
usstVal,togoTaxVal,stornocode,printpass,companyinfo,serverUrl,logoUrl,
|
|||
|
selectedPayPrintType == 1 ? 'l' : 's',
|
|||
|
email);
|
|||
|
window.location.reload(false);
|
|||
|
}
|
|||
|
});
|
|||
|
}
|
|||
|
});
|
|||
|
|
|||
|
$( "#usstval" ).keyup(function(e) {
|
|||
|
$("#usstval").data("changed",true);
|
|||
|
});
|
|||
|
|
|||
|
$( "#togotaxval" ).keyup(function(e) {
|
|||
|
$("#togotaxval").data("changed",true);
|
|||
|
});
|
|||
|
|
|||
|
$( "#stornocode" ).keyup(function(e) {
|
|||
|
$("#stornocode").data("changed",true);
|
|||
|
});
|
|||
|
|
|||
|
$( "#printpass" ).keyup(function(e) {
|
|||
|
$("#printpass").data("changed",true);
|
|||
|
});
|
|||
|
|
|||
|
$( "#companyinfo").keyup(function(e) {
|
|||
|
$("#companyinfo").data("changed",true);
|
|||
|
});
|
|||
|
|
|||
|
$( "#serverUrl").keyup(function(e) {
|
|||
|
$("#serverUrl").data("changed",true);
|
|||
|
});
|
|||
|
|
|||
|
$( "#logoUrl").keyup(function(e) {
|
|||
|
$("#logoUrl").data("changed",true);
|
|||
|
});
|
|||
|
|
|||
|
$( "#email").keyup(function(e) {
|
|||
|
$("#email").data("changed",true);
|
|||
|
});
|
|||
|
|
|||
|
$("#createprodexport").off("click").on("click", function (e) {
|
|||
|
e.stopImmediatePropagation();
|
|||
|
e.preventDefault();
|
|||
|
window.location.href = "php/contenthandler.php?module=products&command=exportCsv";
|
|||
|
});
|
|||
|
|
|||
|
$("#createuserexport").off("click").on("click", function (e) {
|
|||
|
e.stopImmediatePropagation();
|
|||
|
e.preventDefault();
|
|||
|
window.location.href = "php/contenthandler.php?module=admin&command=exportUserCsv";
|
|||
|
});
|
|||
|
|
|||
|
$("#createconfigexport").off("click").on("click", function (e) {
|
|||
|
e.stopImmediatePropagation();
|
|||
|
e.preventDefault();
|
|||
|
window.location.href = "php/contenthandler.php?module=admin&command=exportConfigCsv";
|
|||
|
});
|
|||
|
|
|||
|
$("#createdbexport").off("click").on("click", function (e) {
|
|||
|
e.stopImmediatePropagation();
|
|||
|
e.preventDefault();
|
|||
|
|
|||
|
var selectedMonthStart = $("#select-month-export-start").find(":selected").val();
|
|||
|
var selectedYearStart = $("#select-year-export-start").find(":selected").val();
|
|||
|
|
|||
|
var selectedMonthEnd = $("#select-month-export-end").find(":selected").val();
|
|||
|
var selectedYearEnd = $("#select-year-export-end").find(":selected").val();
|
|||
|
|
|||
|
var dateparams = "startMonth=" + selectedMonthStart + "&";
|
|||
|
dateparams += "startYear=" + selectedYearStart + "&";
|
|||
|
dateparams += "endMonth=" + selectedMonthEnd + "&";
|
|||
|
dateparams += "endYear=" + selectedYearEnd;
|
|||
|
|
|||
|
window.location.href = "php/contenthandler.php?module=bill&command=exportCsv&" + dateparams;
|
|||
|
});
|
|||
|
|
|||
|
$("#changeroomsize").off("click").on("click", function (e) {
|
|||
|
e.stopImmediatePropagation();
|
|||
|
e.preventDefault();
|
|||
|
resizeRoomField();
|
|||
|
});
|
|||
|
$("#cancel_roomchange").off("click").on("click", function (e) {
|
|||
|
e.stopImmediatePropagation();
|
|||
|
e.preventDefault();
|
|||
|
askForCurrentRoomField();
|
|||
|
});
|
|||
|
$("#roomfield_prefill").off("click").on("click", function (e) {
|
|||
|
e.stopImmediatePropagation();
|
|||
|
e.preventDefault();
|
|||
|
roomfield_prefill();
|
|||
|
});
|
|||
|
$("#roomfield_apply").off("click").on("click", function (e) {
|
|||
|
e.stopImmediatePropagation();
|
|||
|
e.preventDefault();
|
|||
|
areYouSure("Raumdefinition", "Alten Raumplan l<>schen und neuen festlegen", "Ja", function() {
|
|||
|
roomfield_apply();
|
|||
|
});
|
|||
|
});
|
|||
|
|
|||
|
$("#readspeisekarte").off("click").on("click", function (e) {
|
|||
|
e.stopImmediatePropagation();
|
|||
|
e.preventDefault();
|
|||
|
var text = $("#speiseninfo").val();
|
|||
|
doAjaxSuppressError("POST", "php/contenthandler.php?module=admin&command=fillSpeisekarte", {speisekarte:text}, confirmMsg, "Fehler");
|
|||
|
});
|
|||
|
}
|
|||
|
|
|||
|
function confirmMsg (result) {
|
|||
|
if (result == 'ERROR') {
|
|||
|
alert ("Speisekarte konnte nicht erfolgreich eingelesen werden. Stimmt die Syntax, z.B. die korrekte Einr<6E>ckung?");
|
|||
|
} else {
|
|||
|
alert("Aktion durchgef<65>hrt");
|
|||
|
window.location.reload();
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
function hasChangedData(idOfElem) {
|
|||
|
var fieldChangedAttr = $(idOfElem).data("changed");
|
|||
|
if (fieldChangedAttr == null) {
|
|||
|
fieldChangedAttr = false;
|
|||
|
}
|
|||
|
return fieldChangedAttr;
|
|||
|
}
|
|||
|
|
|||
|
function createClosing(closingresult) {
|
|||
|
setMonthYearSelection();
|
|||
|
getLastClosings();
|
|||
|
if (closingresult.status == "OK") {
|
|||
|
alert("Ergebnis: " + closingresult.msg);
|
|||
|
} else {
|
|||
|
alert("Fehler " + closingresult.code + ": " + closingresult.msg);
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
function doPrinting(closingdata) {
|
|||
|
if (closingdata.status == "OK") {
|
|||
|
var styleTxt5td = "<td style='width:5%; overflow: hidden;text-overflow: ellipsis; font-size:8px;'>";
|
|||
|
var styleTxt9td = "<td style='width:9%; overflow: hidden;text-overflow: ellipsis; font-size:8px;'>";
|
|||
|
var styleTxt7td = "<td style='width:7%; overflow: hidden;text-overflow: ellipsis; font-size:8px;'>";
|
|||
|
var styleTxt13td = "<td style='width:13%; overflow: hidden;text-overflow: ellipsis; font-size:8px;'>";
|
|||
|
var styleTxt18td = "<td style='width:18%; overflow: hidden;text-overflow: ellipsis; font-size:8px; white-space:nowrap'>";
|
|||
|
var styleTxt27td = "<td style='width:27%; overflow: hidden;text-overflow: ellipsis; font-size:8px;'>";
|
|||
|
|
|||
|
var styleTxt5th = "<th style='width:5%; overflow: hidden;text-overflow: ellipsis;word-wrap:break-word;font-size:8px;'>";
|
|||
|
var styleTxt9th = "<th style='width:9%; overflow: hidden;text-overflow: ellipsis;word-wrap:break-word;font-size:8px;'>";
|
|||
|
var styleTxt7th = "<th style='width:7%; overflow: hidden;text-overflow: ellipsis;word-wrap:break-word;font-size:8px;'>";
|
|||
|
var styleTxt13th = "<th style='width:13%; overflow: hidden;text-overflow: ellipsis;word-wrap:break-word;font-size:8px;'>";
|
|||
|
var styleTxt18th = "<th style='width:18%; overflow: hidden;text-overflow: ellipsis;word-wrap:break-word;font-size:8px;'>";
|
|||
|
var styleTxt27th = "<th style='width:27%; overflow: hidden;text-overflow: ellipsis;word-wrap:break-word;font-size:8px;'>";
|
|||
|
|
|||
|
var closingid = closingdata.closingid;
|
|||
|
var closingdate = closingdata.closingdate;
|
|||
|
var previousClosingDate = closingdata.previousClosingDate;
|
|||
|
|
|||
|
var tableText = "";
|
|||
|
tableText = "<h2>Tageslosung " + closingid + " vom " + closingdate + "</h2>";
|
|||
|
|
|||
|
if (previousClosingDate != null) {
|
|||
|
tableText += 'Zeitraum: ' + previousClosingDate + " - " + closingdate + '<br>';
|
|||
|
} else {
|
|||
|
tableText += 'Erste Erstellung einer Tageslosung<br>';
|
|||
|
}
|
|||
|
|
|||
|
tableText += '<table class="closingtable" style="table-layout:fixed; width:100%;" border=1 >';
|
|||
|
tableText += "<tr>" + styleTxt5th + "Bon-ID";
|
|||
|
tableText += styleTxt27th + "Zahlungsdatum";
|
|||
|
tableText += styleTxt18th + "Produkt";
|
|||
|
tableText += styleTxt7th + "Bruttopreis";
|
|||
|
tableText += styleTxt7th + "Nettopreis";
|
|||
|
tableText += styleTxt7th + "MwSt";
|
|||
|
tableText += styleTxt18th + "Zahlungsart";
|
|||
|
tableText += styleTxt5th + "Benutzer-ID";
|
|||
|
tableText += styleTxt9th + "Benutzername";
|
|||
|
tableText += styleTxt13th + "Status";
|
|||
|
tableText += styleTxt5th + "Referenz-Bon-ID";
|
|||
|
tableText += "</tr>";
|
|||
|
|
|||
|
$.each(closingdata.msg, function (i, aClosing) {
|
|||
|
var billid = aClosing.billid;
|
|||
|
var price = aClosing.price;
|
|||
|
var netto = aClosing.netto;
|
|||
|
var tax = aClosing.tax;
|
|||
|
var productname = aClosing.productname;
|
|||
|
var paidtime = aClosing.paidtime;
|
|||
|
var payment = aClosing.payment;
|
|||
|
var userid = aClosing.userid;
|
|||
|
var username = aClosing.username;
|
|||
|
var ref = aClosing.ref;
|
|||
|
ref = ((ref != '') && (ref != null) ? ref : ' ');
|
|||
|
var status = aClosing.status;
|
|||
|
status = ((status != '') && (status != null) ? status : ' ');
|
|||
|
|
|||
|
tableText += "<tr>";
|
|||
|
tableText += styleTxt5td + billid;
|
|||
|
tableText += styleTxt27td + paidtime;
|
|||
|
tableText += styleTxt18td + productname;
|
|||
|
tableText += styleTxt9td + price;
|
|||
|
tableText += styleTxt9td + netto;
|
|||
|
tableText += styleTxt9td + tax;
|
|||
|
tableText += styleTxt18td + payment;
|
|||
|
tableText += styleTxt5td + userid;
|
|||
|
tableText += styleTxt9td + username;
|
|||
|
tableText += styleTxt13td + status;
|
|||
|
tableText += styleTxt5td + ref;
|
|||
|
tableText += "</tr>";
|
|||
|
});
|
|||
|
tableText += "</table>";
|
|||
|
$("#tableforprint").html(tableText);
|
|||
|
window.print();
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
|
|||
|
function getClosingsOfSelectedDate() {
|
|||
|
var selectedYear = $("#select-year").find(":selected").val();
|
|||
|
var selectedMonth = $("#select-month").find(":selected").val();
|
|||
|
getClosings(selectedMonth,selectedYear);
|
|||
|
}
|
|||
|
|
|||
|
function getLastClosings() {
|
|||
|
var today = new Date();
|
|||
|
var yyyy = today.getFullYear();
|
|||
|
var month = today.getMonth()+1;
|
|||
|
getClosings(month,yyyy);
|
|||
|
}
|
|||
|
|
|||
|
function displayReceivedClosings(closingresult) {
|
|||
|
if (closingresult.status == "OK") {
|
|||
|
var closingParts = "";
|
|||
|
$.each(closingresult.msg, function (i, aClosing) {
|
|||
|
var id = aClosing.id;
|
|||
|
var closingDate = aClosing.closingDate;
|
|||
|
var remark = aClosing.remark;
|
|||
|
var totalsum = aClosing.totalsum;
|
|||
|
var cashsum = aClosing.cashsum;
|
|||
|
|
|||
|
if (remark != "") {
|
|||
|
closingParts += createClosingPart(id + ": " + closingDate + ": " + remark,id,totalsum,cashsum);
|
|||
|
} else {
|
|||
|
closingParts += createClosingPart(id + ": " + closingDate,id,totalsum,cashsum);
|
|||
|
}
|
|||
|
});
|
|||
|
$("#partofclosings").html(closingParts);
|
|||
|
$('#partofclosings').trigger('create');
|
|||
|
binding();
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
function getClosings(month,year) {
|
|||
|
var data = {
|
|||
|
month: month,
|
|||
|
year: year
|
|||
|
};
|
|||
|
doAjax("GET","php/contenthandler.php?module=closing&command=getClosings",data,displayReceivedClosings,"Keine Abschluesse erhalten");
|
|||
|
}
|
|||
|
|
|||
|
function createLabelWithTextField(aLabel,displayedName,defaultText) {
|
|||
|
var labelid = 'userlabel_' + aLabel;
|
|||
|
var text = '<div class="ui-field-contain">';
|
|||
|
text += '<label for="' + labelid + '">' + displayedName + '</label>';
|
|||
|
text += '<input type="text" id="' + labelid + '" value="" data-mini="true" placeholder="' + defaultText + '" />';
|
|||
|
text += '</div>';
|
|||
|
return text;
|
|||
|
}
|
|||
|
|
|||
|
function createButtonWithTextField(aLabel,displayedName,defaultText) {
|
|||
|
var labelid = 'userlabel_' + aLabel;
|
|||
|
var text = '<div class="ui-field-contain">';
|
|||
|
text += '<input type="text" class="' + labelid + '" value="" data-mini="true" placeholder="' + defaultText + '" />';
|
|||
|
text += '<button data-theme="f" data-icon="check" class="changepassword">' + displayedName + '</button>';
|
|||
|
text += '</div>';
|
|||
|
return text;
|
|||
|
}
|
|||
|
|
|||
|
function createLabelWithOption(aLabel,displayedName,hasTheRight) {
|
|||
|
var labelid = 'userlabel_' + aLabel;
|
|||
|
var text = '<div class="ui-field-contain">';
|
|||
|
text += '<label for="' + labelid + '">' + displayedName + '</label>';
|
|||
|
|
|||
|
if (hasTheRight) {
|
|||
|
text += '<select name="' + labelid + '" id="' + labelid + '" data-theme="f">';
|
|||
|
text += '<option value="1" selected>Ja</option>';
|
|||
|
text += '<option value="0">Nein</option>';
|
|||
|
} else {
|
|||
|
text += '<select name="' + labelid + '" id="' + labelid + '" data-theme="d">';
|
|||
|
text += '<option value="1">Ja</option>';
|
|||
|
text += '<option value="0" selected>Nein</option>';
|
|||
|
}
|
|||
|
text += '</select></div>';
|
|||
|
|
|||
|
return text;
|
|||
|
}
|
|||
|
|
|||
|
/*
|
|||
|
* Creates a table for a user with the info about the user, i.e.
|
|||
|
* the username and the rights that the user has to work in the
|
|||
|
* various modules.
|
|||
|
*/
|
|||
|
function createCollapsibeOfUser(id,username,isAdmin,rWaiter,rKitchen,rBar,rSupply,rPay,rStat,rBill,rProd,rManager,forNewUser) {
|
|||
|
var collapsiblePart = '<div data-role="collapsible" id="' + id + '"';
|
|||
|
if (forNewUser) {
|
|||
|
collapsiblePart += 'data-theme="d" data-content-theme="d">';
|
|||
|
} else {
|
|||
|
collapsiblePart += 'data-theme="c" data-content-theme="c">';
|
|||
|
}
|
|||
|
collapsiblePart += '<h3>'+ username + '</h3>';
|
|||
|
collapsiblePart += '<form>';
|
|||
|
if (forNewUser) {
|
|||
|
collapsiblePart += createLabelWithTextField("username","Benutzername","Benutzername");
|
|||
|
collapsiblePart += createLabelWithTextField("password","Passwort","Passwort");
|
|||
|
}
|
|||
|
collapsiblePart += createLabelWithOption("admin","Administrator",isAdmin);
|
|||
|
collapsiblePart += createLabelWithOption("waiter","Kellner",rWaiter);
|
|||
|
collapsiblePart += createLabelWithOption("kitchen","K<>che",rKitchen);
|
|||
|
collapsiblePart += createLabelWithOption("bar","Bar",rBar);
|
|||
|
collapsiblePart += createLabelWithOption("supplydesk","Bereitstellung",rSupply);
|
|||
|
collapsiblePart += createLabelWithOption("paydesk","Kasse",rPay);
|
|||
|
collapsiblePart += createLabelWithOption("stat","Statistik",rStat);
|
|||
|
collapsiblePart += createLabelWithOption("bill","Kassenbons",rBill);
|
|||
|
collapsiblePart += createLabelWithOption("products","Angebot",rProd);
|
|||
|
collapsiblePart += createLabelWithOption("manager","Verwaltung",rManager);
|
|||
|
|
|||
|
if (forNewUser) {
|
|||
|
collapsiblePart += '<button data-theme="f" data-icon="plus" id="CreateNewUser">Anlegen</button>';
|
|||
|
} else {
|
|||
|
collapsiblePart += '<button data-theme="f" data-icon="check" class="userUpdateButton">Rechte <20>ndern</button>';
|
|||
|
collapsiblePart += createButtonWithTextField("newpassword", "Passwort <20>ndern", "Anderes Passwort");
|
|||
|
collapsiblePart += '<button data-theme="d" data-icon="minus" class="userDeleteButton">L<EFBFBD>schen</button>';
|
|||
|
}
|
|||
|
collapsiblePart += '<form>';
|
|||
|
collapsiblePart += '</div>';
|
|||
|
return collapsiblePart;
|
|||
|
}
|
|||
|
|
|||
|
|
|||
|
function fillUserListIntoGui(userinfo) {
|
|||
|
var userPart = "";
|
|||
|
$.each(userinfo, function (i, aUser) {
|
|||
|
var username = aUser.username;
|
|||
|
userPart += createCollapsibeOfUser(
|
|||
|
"userid_" + username,
|
|||
|
username,
|
|||
|
aUser.is_admin == 1,
|
|||
|
aUser.right_waiter == 1,
|
|||
|
aUser.right_kitchen == 1,
|
|||
|
aUser.right_bar == 1,
|
|||
|
aUser.right_supply == 1,
|
|||
|
aUser.right_paydesk == 1,
|
|||
|
aUser.right_statistics == 1,
|
|||
|
aUser.right_bill == 1,
|
|||
|
aUser.right_products == 1,
|
|||
|
aUser.right_manager == 1,
|
|||
|
false
|
|||
|
);
|
|||
|
});
|
|||
|
userPart += createCollapsibeOfUser(
|
|||
|
"userid_newuser",
|
|||
|
"Neuer Benutzer",
|
|||
|
false,false,false,false,false,false,false,false,false,false,true);
|
|||
|
$("#userlist").html(userPart);
|
|||
|
$('#userpart').trigger('create');
|
|||
|
|
|||
|
// now set the data for each user to the buttons - that makes life easier... :)
|
|||
|
$.each(userinfo, function (i, aUser) {
|
|||
|
var username = aUser.username;
|
|||
|
var deleteButtonElem = $("#userlist").find("#userid_" + username).find(".userDeleteButton");
|
|||
|
deleteButtonElem.data("username",username);
|
|||
|
var updateButtonElem = $("#userlist").find("#userid_" + username).find(".userUpdateButton");
|
|||
|
updateButtonElem.data("username",username);
|
|||
|
var passwdButtonElem = $("#userlist").find("#userid_" + username).find(".changepassword");
|
|||
|
passwdButtonElem.data("username",username);
|
|||
|
});
|
|||
|
|
|||
|
// now put the bindings to the user actions that are all (incl the NewUser part) dynamic
|
|||
|
dynamicUserBinding();
|
|||
|
}
|
|||
|
|
|||
|
function askAndFillUserList() {
|
|||
|
doAjax("GET","php/contenthandler.php?module=admin&command=getUserList",null, fillUserListIntoGui,"no user data received");
|
|||
|
}
|
|||
|
|
|||
|
function dynamicUserBinding() {
|
|||
|
$("#CreateNewUser").off("click").on("click", function (e) {
|
|||
|
e.stopImmediatePropagation();
|
|||
|
e.preventDefault();
|
|||
|
var newUserInfoContainer = $(this).closest(".ui-collapsible");
|
|||
|
var username = newUserInfoContainer.find("#userlabel_username").val();
|
|||
|
var password = newUserInfoContainer.find("#userlabel_password").val();
|
|||
|
var isAdmin = newUserInfoContainer.find("#userlabel_admin").val();
|
|||
|
var rWaiter = newUserInfoContainer.find("#userlabel_waiter").val();
|
|||
|
var rKitchen = newUserInfoContainer.find("#userlabel_kitchen").val();
|
|||
|
var rBar = newUserInfoContainer.find("#userlabel_bar").val();
|
|||
|
var rSupply = newUserInfoContainer.find("#userlabel_supplydesk").val();
|
|||
|
var rPayDesk = newUserInfoContainer.find("#userlabel_paydesk").val();
|
|||
|
var rStat = newUserInfoContainer.find("#userlabel_stat").val();
|
|||
|
var rBill = newUserInfoContainer.find("#userlabel_bill").val();
|
|||
|
var rProducts = newUserInfoContainer.find("#userlabel_products").val();
|
|||
|
var rManager = newUserInfoContainer.find("#userlabel_manager").val();
|
|||
|
|
|||
|
if ((username.length == 0) || (password.length == 0)) {
|
|||
|
alert ("Benutzername oder Passwort sind nicht gesetzt");
|
|||
|
} else {
|
|||
|
var data = {
|
|||
|
username: username,
|
|||
|
password: password,
|
|||
|
isAdmin: isAdmin,
|
|||
|
rWaiter: rWaiter,
|
|||
|
rKitchen: rKitchen,
|
|||
|
rBar: rBar,
|
|||
|
rSupply: rSupply,
|
|||
|
rPayDesk: rPayDesk,
|
|||
|
rStat: rStat,
|
|||
|
rBill: rBill,
|
|||
|
rProducts: rProducts,
|
|||
|
rManager: rManager
|
|||
|
};
|
|||
|
doAjax("POST","php/contenthandler.php?module=admin&command=createNewUser",data,doCreateNewUser,"Anlegen neuer Benutzer");
|
|||
|
}
|
|||
|
});
|
|||
|
|
|||
|
$(".userUpdateButton").off("click").on("click", function (e) {
|
|||
|
e.stopImmediatePropagation();
|
|||
|
e.preventDefault();
|
|||
|
var username = $(this).data("username");
|
|||
|
|
|||
|
var userInfoContainer = $(this).closest(".ui-collapsible");
|
|||
|
var isAdmin = userInfoContainer.find("#userlabel_admin").val();
|
|||
|
var rWaiter = userInfoContainer.find("#userlabel_waiter").val();
|
|||
|
var rKitchen = userInfoContainer.find("#userlabel_kitchen").val();
|
|||
|
var rBar = userInfoContainer.find("#userlabel_bar").val();
|
|||
|
var rSupply = userInfoContainer.find("#userlabel_supplydesk").val();
|
|||
|
var rPayDesk = userInfoContainer.find("#userlabel_paydesk").val();
|
|||
|
var rStat = userInfoContainer.find("#userlabel_stat").val();
|
|||
|
var rBill = userInfoContainer.find("#userlabel_bill").val();
|
|||
|
var rProducts = userInfoContainer.find("#userlabel_products").val();
|
|||
|
var rManager = userInfoContainer.find("#userlabel_manager").val();
|
|||
|
|
|||
|
var data = {
|
|||
|
username: username,
|
|||
|
isAdmin: isAdmin,
|
|||
|
rWaiter: rWaiter,
|
|||
|
rKitchen: rKitchen,
|
|||
|
rBar: rBar,
|
|||
|
rSupply: rSupply,
|
|||
|
rPayDesk: rPayDesk,
|
|||
|
rStat: rStat,
|
|||
|
rBill: rBill,
|
|||
|
rProducts: rProducts,
|
|||
|
rManager: rManager
|
|||
|
};
|
|||
|
doAjax("POST","php/contenthandler.php?module=admin&command=updateUser",data,askAndFillUserListNoData,"Benutzerdaten");
|
|||
|
});
|
|||
|
|
|||
|
$(".userDeleteButton").off("click").on("click", function (e) {
|
|||
|
var data = {
|
|||
|
username: $(this).data("username")
|
|||
|
};
|
|||
|
doAjax("POST","php/contenthandler.php?module=admin&command=deleteUser",data,reloadPage,"Benutzer entfernen");
|
|||
|
});
|
|||
|
|
|||
|
$(".changepassword").off("click").on("click", function (e) {
|
|||
|
var username = $(this).data("username");
|
|||
|
var userInfoContainer = $(this).closest(".ui-collapsible");
|
|||
|
var newPassword = userInfoContainer.find(".userlabel_newpassword").val();
|
|||
|
|
|||
|
if (newPassword.length == 0) {
|
|||
|
alert ("Passwort ist leer!");
|
|||
|
} else {
|
|||
|
var data = {
|
|||
|
username: username,
|
|||
|
password: newPassword
|
|||
|
};
|
|||
|
doAjax("POST","php/contenthandler.php?module=admin&command=changepassword",data,askAndFillUserList,"Neues Passwort");
|
|||
|
}
|
|||
|
});
|
|||
|
}
|
|||
|
|
|||
|
|
|||
|
|
|||
|
// only a wrapper to remove argument
|
|||
|
function askAndFillUserListNoData(dummyData) {
|
|||
|
askAndFillUserListNoData();
|
|||
|
}
|
|||
|
|
|||
|
function reloadPage(dummyData) {
|
|||
|
location.reload();
|
|||
|
}
|
|||
|
|
|||
|
function doCreateNewUser(result) {
|
|||
|
if (result == "exists") {
|
|||
|
alert ("Benutzer existiert bereits");
|
|||
|
} else {
|
|||
|
askAndFillUserList();
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
function handleResultOfDbAction(jsonText) {
|
|||
|
if (jsonText.status == "OK") {
|
|||
|
alert("Kommando ausgef<65>hrt");
|
|||
|
} else {
|
|||
|
alert("Fehler " + jsonText.code + ": " + jsonText.msg);
|
|||
|
}
|
|||
|
}
|
|||
|
function invokeCmd(theCommand) {
|
|||
|
doAjax("GET","php/contenthandler.php?module=admin&command=" + theCommand,null,handleResultOfDbAction,"Problemkommando " . theCommand);
|
|||
|
}
|
|||
|
|
|||
|
|
|||
|
function createClosingPart (aText,id,totalsum,cashsum) {
|
|||
|
var closingPart = '<div data-role="collapsible" data-theme="e" data-content-theme="d">';
|
|||
|
closingPart += '<h3>' + aText + '</h3>';
|
|||
|
closingPart += '<i>Tageseinnahme:</i> <b>' + (parseFloat(Math.round(totalsum * 100) / 100).toFixed(2)).replace(".", ",") + "</b> Euro<br>";
|
|||
|
closingPart += '<i>Bareinnahme:</i> <b>' + (parseFloat(Math.round(cashsum * 100) / 100).toFixed(2)).replace(".", ",") + "</b> Euro<br>";
|
|||
|
closingPart += '<p>Ein Export im CSV-Format l<>sst sich mit Tabellenverarbeitungs-Programmen wie beispielsweise Excel verarbeiten.</p>';
|
|||
|
|
|||
|
closingPart += '<p>';
|
|||
|
closingPart += '<button type="submit" data-theme="f" class="csvExportButton" data-icon="check" id="csvexport_' + id + '">CSV-Export Bons</button>';
|
|||
|
closingPart += '<button type="submit" data-theme="f" class="csvExportAllButton" data-icon="check" id="csvallexport_' + id + '">CSV-Export komplett</button>';
|
|||
|
closingPart += '<button type="submit" data-theme="f" class="printButton" data-icon="check" id="printexport_' + id + '">Drucken Komplettbericht</button>';
|
|||
|
|
|||
|
closingPart += '</p>';
|
|||
|
|
|||
|
closingPart += '</div>';
|
|||
|
return closingPart;
|
|||
|
}
|
|||
|
|
|||
|
function createYearPartFor(label,selectionid,container) {
|
|||
|
var today = new Date();
|
|||
|
var yyyy = today.getFullYear();
|
|||
|
|
|||
|
var htmlText = '<form><div class="ui-field-contain"><label for="' + label + '">Jahr:</label>';
|
|||
|
htmlText += '<select name="' + label + '" id="' + label + '" data-theme="e">';
|
|||
|
|
|||
|
for (var i=2013;i<=yyyy;i++)
|
|||
|
{
|
|||
|
htmlText += '<option value="' + i + '">' + i + '</option>';
|
|||
|
}
|
|||
|
htmlText += '</select></div>';
|
|||
|
|
|||
|
$(selectionid).html(htmlText);
|
|||
|
$(container).trigger('create');
|
|||
|
|
|||
|
$("#" + label).val(yyyy).attr('selected', true).siblings('option').removeAttr('selected');
|
|||
|
$("#" + label).selectmenu("refresh", true);
|
|||
|
}
|
|||
|
|
|||
|
|
|||
|
function setMonthYearSelection() {
|
|||
|
var today = new Date();
|
|||
|
var month = today.getMonth()+1; //January is 0!
|
|||
|
var yyyy = today.getFullYear();
|
|||
|
$("#select-month").val(month).attr('selected', true).siblings('option').removeAttr('selected');
|
|||
|
$("#select-year").val(yyyy).attr('selected', true).siblings('option').removeAttr('selected');
|
|||
|
|
|||
|
$("#select-month-export-end").val(month).attr('selected', true).siblings('option').removeAttr('selected');
|
|||
|
$("#select-year-export-end").val(yyyy).attr('selected', true).siblings('option').removeAttr('selected');
|
|||
|
|
|||
|
$("#select-month").selectmenu("refresh", true);
|
|||
|
$("#select-year").selectmenu("refresh", true);
|
|||
|
|
|||
|
$("#select-month-export-end").selectmenu("refresh", true);
|
|||
|
$("#select-year-export-end").selectmenu("refresh", true);
|
|||
|
}
|
|||
|
|
|||
|
//
|
|||
|
// Functions for room plans
|
|||
|
//
|
|||
|
|
|||
|
function tablelist(no,rowId) {
|
|||
|
var i=0;
|
|||
|
var text = "";
|
|||
|
for (i=0;i<no;i++) {
|
|||
|
text += '<td><input type="text" size="3" id="t_' + rowId.toString() + '_' + i.toString() + '"/>';
|
|||
|
}
|
|||
|
return text;
|
|||
|
}
|
|||
|
|
|||
|
function askForCurrentRoomField() {
|
|||
|
doAjax("GET","php/contenthandler.php?module=roomtables&command=getRoomfield",null,initroomfield,"Raumplan");
|
|||
|
}
|
|||
|
|
|||
|
function resizeRoomField() {
|
|||
|
var n = $("#maxrooms_val").val();
|
|||
|
var m = $("#maxtables_val").val();
|
|||
|
try {
|
|||
|
n = parseInt(n);
|
|||
|
m = parseInt(m);
|
|||
|
if ((n>0) && (n<30) && (m>0) && (m<30)) {
|
|||
|
createEmptyRoomField(n,m);
|
|||
|
} else {
|
|||
|
alert("Gr<47><72>e au<61>erhalb des zul<75>ssigen Bereichs");
|
|||
|
}
|
|||
|
} catch(e) {
|
|||
|
alert ("Falsches Zahlenformat");
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
function createEmptyRoomField(n,m) {
|
|||
|
var i=0;
|
|||
|
var text = "<table>";
|
|||
|
text += '<tr><th>R<EFBFBD>ume<th colspan=' + m + '>Tische</tr>';
|
|||
|
for (i=0;i<n;i++) {
|
|||
|
text += '<tr><td><input type="text" id="r_' + i.toString() + '"' + ' size="10" />';
|
|||
|
text += tablelist(m,i);
|
|||
|
}
|
|||
|
text += "</table>";
|
|||
|
$("#roomfield").html(text);
|
|||
|
}
|
|||
|
function initroomfield(roomfield_json) {
|
|||
|
var n = roomfield_json.noOfRooms;
|
|||
|
var m = roomfield_json.maxTables;
|
|||
|
$("#maxrooms_val").val(n);
|
|||
|
$("#maxtables_val").val(m);
|
|||
|
createEmptyRoomField(n,m);
|
|||
|
|
|||
|
var room_index, table_index, r_id, t_id;
|
|||
|
var roomfield = roomfield_json.roomfield;
|
|||
|
for (room_index = 0; room_index < n; room_index++) {
|
|||
|
var aRoom = roomfield[room_index];
|
|||
|
r_id = "#r_" + room_index.toString();
|
|||
|
$(r_id).val(aRoom.roomname);
|
|||
|
|
|||
|
var noOfTables = aRoom.noOfTables;
|
|||
|
var tablesOfRoom = aRoom.tables;
|
|||
|
for (table_index = 0; table_index < noOfTables; table_index++) {
|
|||
|
t_id = "#t_" + room_index.toString() + "_" + table_index.toString();
|
|||
|
var aTable = tablesOfRoom[table_index];
|
|||
|
$(t_id).val(aTable.tablename);
|
|||
|
}
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
function roomfield_prefill() {
|
|||
|
var n = $("#maxrooms_val").val();
|
|||
|
var m = $("#maxtables_val").val();
|
|||
|
|
|||
|
try {
|
|||
|
var i=0;
|
|||
|
var j=0;
|
|||
|
if (m>10) {
|
|||
|
m=10;
|
|||
|
}
|
|||
|
var id = "";
|
|||
|
for (i=0;i<n;i++) {
|
|||
|
id = "#r_" + i.toString();
|
|||
|
var startNumber = parseInt(i.toString() + '1');
|
|||
|
var endNumber = startNumber + parseInt(m) - 1;
|
|||
|
|
|||
|
$(id).val("Tische " + startNumber + "-" + endNumber);
|
|||
|
for (j=0;j<m;j++) {
|
|||
|
var t = (i + parseInt((j+1)/10)).toString() + ((j+1)%10).toString();
|
|||
|
id = "#t_" + i.toString() + "_" + j.toString();
|
|||
|
$(id).val(t);
|
|||
|
}
|
|||
|
}
|
|||
|
} catch (e) {}
|
|||
|
}
|
|||
|
|
|||
|
function roomfield_apply() {
|
|||
|
var n = $("#maxrooms_val").val();
|
|||
|
var m = $("#maxtables_val").val();
|
|||
|
try {
|
|||
|
n = parseInt(n);
|
|||
|
m = parseInt(m);
|
|||
|
if ((n>0) && (n<30) && (m>0) && (m<30)) {
|
|||
|
// collect data now!
|
|||
|
var room_index, table_index, r_id, t_id;
|
|||
|
var rooms = [];
|
|||
|
for (room_index = 0; room_index < n; room_index++) {
|
|||
|
r_id = "#r_" + room_index.toString();
|
|||
|
var roominfo = [];
|
|||
|
var roomname = $(r_id).val();
|
|||
|
if ((roomname.replace(/ /,"")) != "") {
|
|||
|
roominfo[0] = roomname;
|
|||
|
var tablesOfRoom = [];
|
|||
|
for (table_index = 0; table_index < m; table_index++) {
|
|||
|
t_id = "#t_" + room_index.toString() + "_" + table_index.toString();
|
|||
|
var aTableName = $(t_id).val();
|
|||
|
if ((aTableName.replace(/ /,"")) != "") {
|
|||
|
tablesOfRoom.push(aTableName);
|
|||
|
}
|
|||
|
}
|
|||
|
if (tablesOfRoom.length > 0) {
|
|||
|
roominfo[1] = tablesOfRoom;
|
|||
|
} else {
|
|||
|
continue;
|
|||
|
}
|
|||
|
rooms.push(roominfo);
|
|||
|
}
|
|||
|
}
|
|||
|
// setRoomInfo
|
|||
|
doAjax("POST","php/contenthandler.php?module=roomtables&command=setRoomInfo",{rooms:rooms},askForCurrentRoomField,"Raumplan nicht <20>nderbar");
|
|||
|
}
|
|||
|
} catch(e) {}
|
|||
|
|
|||
|
}
|
|||
|
|
|||
|
|
|||
|
// End functions part for room plans
|
|||
|
|
|||
|
//pageinit event for first page
|
|||
|
//triggers only once
|
|||
|
//write all your on-load functions and event handlers pertaining to page1
|
|||
|
$(document).on("pageinit", "#admin-page", function () {
|
|||
|
initializeMainMenu("#modulemenu");
|
|||
|
doAjax("GET","php/contenthandler.php?module=admin&command=isLoggedinUserAdminOrManager",null,hideElementsForNonAdminManagerUser,"Fehler");
|
|||
|
|
|||
|
askAndFillUserList();
|
|||
|
hideMenu();
|
|||
|
|
|||
|
doAjax("GET","php/contenthandler.php?module=admin&command=isLoggedinUserAdmin",null,hideElementsForNonAdminUser,"Fehler");
|
|||
|
|
|||
|
createYearPartFor("select-year","#yearselection",'#closinglist');
|
|||
|
createYearPartFor("select-year-export-start","#yearselectionexportstart",'#dataexport');
|
|||
|
createYearPartFor("select-year-export-end","#yearselectionexportend",'#dataexport');
|
|||
|
|
|||
|
setMonthYearSelection();
|
|||
|
|
|||
|
getLastClosings();
|
|||
|
getTax();
|
|||
|
getTogoTax();
|
|||
|
getCompanyInfo();
|
|||
|
getServerUrl();
|
|||
|
getLogoUrl();
|
|||
|
getSpeisekarte();
|
|||
|
getPayPrintType();
|
|||
|
getEmail();
|
|||
|
binding();
|
|||
|
|
|||
|
askForCurrentRoomField();
|
|||
|
});
|
|||
|
|
|||
|
|
|||
|
</script>
|
|||
|
|
|||
|
<!--
|
|||
|
|
|||
|
Seitenstruktur:
|
|||
|
General settings
|
|||
|
MwSt-Satz:
|
|||
|
|
|||
|
Abrechnung:
|
|||
|
Tagesabrechung:
|
|||
|
Erstellung neue Abrechnung
|
|||
|
<Liste der alten Abrechungen>
|
|||
|
Druck - csv-Export
|
|||
|
-->
|
|||
|
|
|||
|
|
|||
|
<div data-role="page" id="admin-page">
|
|||
|
<div data-role="panel" id="modulepanel" data-position="right" data-display="overlay" class="noprint">
|
|||
|
<ul data-role="listview" id="modulemenu" data-divider-theme="a" data-inset="true">
|
|||
|
<li data-role="list-divider" data-theme="b" data-role="heading">Module</li>
|
|||
|
</ul>
|
|||
|
</div><!-- /panel -->
|
|||
|
|
|||
|
<div data-role="header" data-theme="b" data-position="fixed" id="theheader" class="noprint">
|
|||
|
<h1>Administration</h1>
|
|||
|
<div data-type="horizontal" style="top:0px;position:absolute;float:right;z-index:10;display:inline;" align="right" class="ui-btn-right">
|
|||
|
<a href="#" data-role="button" data-icon="arrow-d" data-ajax="false" id="menuswitch">Module</a>
|
|||
|
</div>
|
|||
|
</div>
|
|||
|
<div data-role="content" id="allpagecontent">
|
|||
|
|
|||
|
<div data-role="collapsible" data-collapsed="false" data-theme="e" data-content-theme="c" class="noprint">
|
|||
|
<h3>Abrechnung und Datenexport</h3>
|
|||
|
<p>Hier finden sich die Men<65>punkte zum Tagesabschluss oder Datenexport.</p>
|
|||
|
|
|||
|
<div id="closinglist" data-role="collapsible" data-theme="c" data-content-theme="c">
|
|||
|
<h3>Tagesabschluss</h3>
|
|||
|
<p>Hier k<>nnen Sie die seit dem letzten <i>Abschluss</i> get<65>tigten neuen Transaktionen
|
|||
|
zu einem neuen Abschluss f<>hren. Anschlie<69>end sind alle bis zu diesem Zeitpunkt
|
|||
|
erstellten Transaktionen/Kassenbons nicht mehr stornierbar!</p>
|
|||
|
|
|||
|
<form>
|
|||
|
<div class="ui-field-contain">
|
|||
|
<label for="select-native-1">Monat:</label>
|
|||
|
<select name="select-month" id="select-month" data-theme="e">
|
|||
|
<option value="1">Januar</option>
|
|||
|
<option value="2">Februar</option>
|
|||
|
<option value="3">M<EFBFBD>rz</option>
|
|||
|
<option value="4">April</option>
|
|||
|
<option value="5">Mai</option>
|
|||
|
<option value="6">Juni</option>
|
|||
|
<option value="7">Juli</option>
|
|||
|
<option value="8">August</option>
|
|||
|
<option value="9">September</option>
|
|||
|
<option value="10">Oktober</option>
|
|||
|
<option value="11">November</option>
|
|||
|
<option value="12">Dezember</option>
|
|||
|
</select>
|
|||
|
</div>
|
|||
|
</form>
|
|||
|
|
|||
|
<div id=yearselection>
|
|||
|
<form>
|
|||
|
<div class="ui-field-contain">
|
|||
|
<label for="select-native-1">Jahr:</label>
|
|||
|
<select name="select-year" id="select-year">
|
|||
|
<option value="2014">2014</option>
|
|||
|
</select>
|
|||
|
</div>
|
|||
|
</div> <!-- yearselection -->
|
|||
|
|
|||
|
<input type="text" id="remarkfield" value="" data-mini="true" placeholder="Bemerkung" />
|
|||
|
<button type="submit" data-theme="f" class="cancelButton" data-icon="plus" id="createclosing">Erstellen</button>
|
|||
|
|
|||
|
<div id=partofclosings>
|
|||
|
<div data-role="collapsible" data-theme="d" data-content-theme="d">
|
|||
|
<h3>Tagesabschlussbeispiel</h3>
|
|||
|
<p>Dieser Eintrag sollte hier nicht mehr stehen...</p>
|
|||
|
</div><!-- /section 1A -->
|
|||
|
</div>
|
|||
|
</div><!-- closinglist -->
|
|||
|
|
|||
|
|
|||
|
<div id="dataexport" data-role="collapsible" data-content-theme="c">
|
|||
|
<h3>Datenexport</h3>
|
|||
|
<p>Hier k<>nnen Sie eine csv-Datei erzeugen lassen, die
|
|||
|
<ul><li>alle abgerechneten und in Tagesabschl<68>ssen enthaltenen
|
|||
|
Bonabrechungen im unten ausw<73>hlbaren Zeitraum beinhaltet.</li>
|
|||
|
<li>alle Stammdaten (Produkte) und deren <20>nderungen seit der Installation auff<66>hrt.</li>
|
|||
|
</ul>
|
|||
|
</p>
|
|||
|
|
|||
|
<form>
|
|||
|
<b>Startdatum Ums<6D>tze:</b>
|
|||
|
<div class="ui-field-contain">
|
|||
|
<label for="select-month-export-start">Monat:</label>
|
|||
|
<select name="select-month-export-start" id="select-month-export-start" data-theme="e">
|
|||
|
<option value="1">Januar</option>
|
|||
|
<option value="2">Februar</option>
|
|||
|
<option value="3">M<EFBFBD>rz</option>
|
|||
|
<option value="4">April</option>
|
|||
|
<option value="5">Mai</option>
|
|||
|
<option value="6">Juni</option>
|
|||
|
<option value="7">Juli</option>
|
|||
|
<option value="8">August</option>
|
|||
|
<option value="9">September</option>
|
|||
|
<option value="10">Oktober</option>
|
|||
|
<option value="11">November</option>
|
|||
|
<option value="12">Dezember</option>
|
|||
|
</select>
|
|||
|
</div>
|
|||
|
|
|||
|
<div id=yearselectionexportstart>
|
|||
|
<form>
|
|||
|
<div class="ui-field-contain">
|
|||
|
<label for="select-year-export-start">Jahr:</label>
|
|||
|
<select name="select-year-export-start" id="select-year-export-start">
|
|||
|
<option value="2014">2014</option>
|
|||
|
</select>
|
|||
|
</div>
|
|||
|
</div>
|
|||
|
|
|||
|
<b>Enddatum Ums<6D>tze</b>:
|
|||
|
<div class="ui-field-contain">
|
|||
|
<label for="select-month-export-end">Monat:</label>
|
|||
|
<select name="select-month-export-end" id="select-month-export-end" data-theme="e">
|
|||
|
<option value="1">Januar</option>
|
|||
|
<option value="2">Februar</option>
|
|||
|
<option value="3">M<EFBFBD>rz</option>
|
|||
|
<option value="4">April</option>
|
|||
|
<option value="5">Mai</option>
|
|||
|
<option value="6">Juni</option>
|
|||
|
<option value="7">Juli</option>
|
|||
|
<option value="8">August</option>
|
|||
|
<option value="9">September</option>
|
|||
|
<option value="10">Oktober</option>
|
|||
|
<option value="11">November</option>
|
|||
|
<option value="12">Dezember</option>
|
|||
|
</select>
|
|||
|
</div>
|
|||
|
|
|||
|
<div id=yearselectionexportend>
|
|||
|
<div class="ui-field-contain">
|
|||
|
<label for="select-year-export-end">Jahr:</label>
|
|||
|
<select name="select-year-export-end" id="select-year-export-end">
|
|||
|
<option value="2014">2014</option>
|
|||
|
</select>
|
|||
|
</div>
|
|||
|
</div>
|
|||
|
|
|||
|
<button type="submit" data-theme="f" class="cancelButton" data-icon="check" id="createdbexport">Export Ums<6D>tze</button>
|
|||
|
|
|||
|
<button type="submit" data-theme="f" class="cancelButton" data-icon="check" id="createprodexport">Export Produktdaten</button>
|
|||
|
<button type="submit" data-theme="f" class="cancelButton" data-icon="check" id="createuserexport">Export Benutzerdaten</button>
|
|||
|
<button type="submit" data-theme="f" class="cancelButton" data-icon="check" id="createconfigexport">Export Konfiguration</button>
|
|||
|
</form>
|
|||
|
</div><!-- Datenexport -->
|
|||
|
|
|||
|
</div> <!-- collapsible Abrechnung und Datenexport -->
|
|||
|
|
|||
|
<div id="userpart" data-role="collapsible" data-collapsed="true" data-theme="e" data-content-theme="c" class="noprint">
|
|||
|
<h3>Benutzer</h3>
|
|||
|
<div id="userlist" data-role="collapsible" data-theme="c" data-content-theme="c">
|
|||
|
</div> <!-- userlist -->
|
|||
|
</div> <!-- Benutzer -->
|
|||
|
|
|||
|
<div data-role="collapsible" data-collapsed="true" data-theme="e" data-content-theme="c" class="noprint" id="configpart">
|
|||
|
<h3>Konfiguration</h3>
|
|||
|
<form action="#" method="get">
|
|||
|
<div data-role="fieldcontain" id="configarea">
|
|||
|
<label for="usstval">MwSt:</label>
|
|||
|
<input type="text" value="" data-mini="true" placeholder="19,0" id="usstval" data-theme="c"/>
|
|||
|
|
|||
|
<label for="togotaxval">MwSt (ToGo-Bons):</label>
|
|||
|
<input type="text" value="" data-mini="true" placeholder="7,0" id="togotaxval" data-theme="c"/>
|
|||
|
|
|||
|
<label for="stornocode">Stornocode:</label>
|
|||
|
<input type="password" value="" data-mini="true" id="stornocode"/>
|
|||
|
|
|||
|
<label for="printpass">Printcode:</label>
|
|||
|
<input type="password" value="" data-mini="true" id="printpass"/>
|
|||
|
|
|||
|
<label for="companyinfo">Betriebsinfo:</label>
|
|||
|
<textarea cols="40" rows="8" name="companyinfo" id="companyinfo"></textarea>
|
|||
|
|
|||
|
<label for="serverUrl">Webserver:</label>
|
|||
|
<textarea cols="40" rows="1" name="serverUrl" id="serverUrl">localhost</textarea>
|
|||
|
|
|||
|
<label for="logoUrl">Logo-Adresse:</label>
|
|||
|
<textarea cols="40" rows="1" name="logoUrl" id="logoUrl">http://localhost/customer/logo.png</textarea>
|
|||
|
|
|||
|
<label for="email">Email:</label>
|
|||
|
<input type="text" value="" data-mini="true" placeholder="gastwirt@anbieter.de" id="email" data-theme="c"/>
|
|||
|
|
|||
|
<div id="partOfPayPrintType"></div>
|
|||
|
|
|||
|
|
|||
|
</div>
|
|||
|
|
|||
|
<button type="submit" data-theme="f" data-icon="check" id="changeConfig"><EFBFBD>ndern</button>
|
|||
|
</form><!-- Konfiguration -->
|
|||
|
</div> <!-- Konfiguration -->
|
|||
|
|
|||
|
<div data-role="collapsible" data-collapsed="true" data-theme="e" data-content-theme="c" class="noprint" id="dbactionui">
|
|||
|
<h3>Datenbank</h3>
|
|||
|
|
|||
|
<div data-role="collapsible" data-collapsed="true" data-theme="f" data-content-theme="c" class="noprint" id="dbactionspeisenconfig">
|
|||
|
<p><h3>Speisekarte</h3></p>
|
|||
|
<textarea cols="40" rows="8" name="speiseninfo" id="speiseninfo" data-theme="a" style='font-family:"monospace"'></textarea>
|
|||
|
<button type="submit" data-theme="f" class="applySpeisekarte" data-icon="check" id="readspeisekarte">Anwenden</button>
|
|||
|
</div> <!-- Speisekarte -->
|
|||
|
|
|||
|
<p>
|
|||
|
<div data-role="collapsible" data-collapsed="true" data-theme="f" data-content-theme="c" class="noprint" id="dbactionroomconfig">
|
|||
|
<p><h3>Raumplan</h3></p>
|
|||
|
<form>
|
|||
|
<div>
|
|||
|
<table>
|
|||
|
<tr>
|
|||
|
<td><b>Anzahl R<>ume:</b>
|
|||
|
<td><input type="text" id="maxrooms_val" size="3" placeholder="20" data-theme="a">
|
|||
|
</tr><tr>
|
|||
|
<td><b>Max. Anzahl Tische pro Raum: </b>
|
|||
|
<td><input type="text" id="maxtables_val" size="3" placeholder="10" data-theme="a">
|
|||
|
</tr><tr><td colspan=2><button type="submit" data-theme="f" id="changeroomsize">Raumgr<EFBFBD><EFBFBD>e <20>ndern</button>
|
|||
|
</tr>
|
|||
|
</table>
|
|||
|
</div>
|
|||
|
<div id=roomfield>
|
|||
|
</div>
|
|||
|
|
|||
|
<div>
|
|||
|
<table>
|
|||
|
<tr>
|
|||
|
<td><button type="submit" data-theme="d" id="cancel_roomchange" data-icon="back">Abbrechen</button>
|
|||
|
<td><button type="submit" data-theme="e" id="roomfield_prefill">Nummerierung</button>
|
|||
|
<td><button type="submit" data-theme="f" id="roomfield_apply">Anwenden</button>
|
|||
|
</tr>
|
|||
|
</table>
|
|||
|
</div>
|
|||
|
</form>
|
|||
|
</div>
|
|||
|
</p>
|
|||
|
|
|||
|
</div> <!-- collapsible Datenbank -->
|
|||
|
|
|||
|
<div id="tableforprint" class="printpart">Wenn dieser Text dargestellt wird, liegt ein Fehler vor!</div>
|
|||
|
|
|||
|
<div data-role="footer" data-theme="b" id="thefooterr" class="noprint">
|
|||
|
<div class="ui-grid-a">
|
|||
|
<div class="ui-block-a userinfo" id="loggedinuser"></div>
|
|||
|
<div class="ui-block-b grid_right" id="versioninfo"></div>
|
|||
|
</div><!-- /grid-a -->
|
|||
|
</div> <!-- footer -->
|
|||
|
|
|||
|
</div>
|
|||
|
|
|||
|
<div data-role="popup" id="nochangeddata" name="nochangeddata" data-overlay-theme="a" style="max-width:70%;" class="ui-corner-all">
|
|||
|
<div data-role="header" class="ui-corner-top">
|
|||
|
<h1>Keine Daten<65>nderung</h1>
|
|||
|
</div>
|
|||
|
<a href="#" data-rel="back" data-role="button" data-theme="a" data-icon="delete" data-iconpos="notext" class="ui-btn-right"></a>
|
|||
|
<div data-role="content" class="ui-corner-bottom ui-content">
|
|||
|
<p>Es wurden keine Daten ge<67>ndert.</p>
|
|||
|
</div>
|
|||
|
</div> <!-- popup for reading sample queue data -->
|
|||
|
|
|||
|
</div>
|
|||
|
|
|||
|
<!-- Dialog page -->
|
|||
|
<div data-role="dialog" id="sure" data-title="Entfernen?">
|
|||
|
<div data-role="content">
|
|||
|
<h3 class="sure-1">?</h3>
|
|||
|
<p class="sure-2">?</p>
|
|||
|
<a href="#" class="sure-do" data-role="button" data-theme="b" data-rel="back">Ja</a>
|
|||
|
<a href="#" data-role="button" data-theme="c" data-rel="back">Nein</a>
|
|||
|
</div>
|
|||
|
</div>
|
|||
|
|
|||
|
|
|||
|
|
|||
|
|
|||
|
</body>
|
|||
|
</html>
|