var P_SUM = ["Summe:","Sum:","Todo:"];
var P_TOTAL = ["Total","Total","Total"];
var P_MWST = ["MwSt","Tax","IVA"];
var P_NETTO = ["Netto","Net","Neto"];
var P_BRUTTO = ["Brutto","Gross","Bruto"];
var P_ID = ["Id:","Id:","Id:"];
var P_TABLE = ["Tisch:","Table:","Mesa:"];
var P_WAITER = ["Es bediente Sie:", "Waiter:", "Camarero:"];
var P_NO = ["Anz.", "No.", "Nú."];
var P_DESCR = ["Beschreibung","Description","Descripción"];
var P_PRICE = ["Preis","Price","Precio"];
function genCreateReceiptHeader(lang,billid,tablename,username,currency) {
var priceStyle = 'style="border: solid black 0px;padding: 3px;text-align:right;vertical-align:bottom;"';
var tableinfo = P_TABLE[lang] + " " + tablename;
var waiterinfo = P_WAITER[lang] + " " + username;
var header = '';
header += '
|
';
header += '' + tableinfo + ' | ID:' + billid + ' |
';
header += ' | |
';
header += '' + waiterinfo + " |
";
header += '  |
';
header += '' + P_NO[lang] + ' | ' + P_DESCR[lang] + ' | ' + P_PRICE[lang] + ' | ' + P_TOTAL[lang] + ' |
';
return header;
}
function genCreateReceiptFooterNoSum(taxGerFormat, lang, companyInfo, taxes) {
return genCreateReceiptFooter(taxGerFormat, lang, companyInfo,"","","", taxes);
}
// REM* taxes must be strings with decpoint already country-specific!
function genCreateReceiptFooter(taxGerFormat, lang, companyInfo,mwst,netto,sum, taxes) {
var priceStyle = 'style="border: solid black 0px;padding: 3px;text-align:right;vertical-align:bottom;"';
var infoStyle = 'style="text-align:center;vertical-align:bottom;"';
var emptyLine = '  |
';
var footer = emptyLine;
footer += '' + P_MWST[lang] + '% | ' + P_MWST[lang] + ' | ' + P_NETTO[lang] + ' | ' + P_BRUTTO[lang] + ' |
';
// REM* for each tax create a line
for (var i=0;i | ' + mwst + ' | ' + netto + ' | ' + sum + '';
}
footer += emptyLine;
footer += ' | | ' + P_SUM[lang] + ' | ' + sum + ' |
';
footer += emptyLine;
footer += ' ';
footer += toHtml(companyInfo).replace(/(?:\r\n|\r|\n)/g, ' ');
footer += ' |
';
return footer;
}
// REM* this method is called in bill.html - not paydesk
function createReceiptFooterFromDbTaxes(lang, companyInfo,sum,taxes,decPoint) {
var priceStyle = 'style="border: solid black 0px;padding: 3px;text-align:right;vertical-align:bottom;"';
var infoStyle = 'style="text-align:center;vertical-align:bottom;"';
var emptyLine = '  |
';
var footer = emptyLine;
footer += '' + P_MWST[lang] + '% | ' + P_MWST[lang] + ' | ' + P_NETTO[lang] + ' | ' + P_BRUTTO[lang] + ' |
';
for (var i=0;i" + tax.tax;
footer += " | " + tax.mwst.replace(".",decPoint);
footer += " | " + tax.netto.replace(".",decPoint);
footer += " | " + tax.brutto.replace(".",decPoint);
footer += "";
}
footer += emptyLine;
footer += ' | | ' + P_SUM[lang] + ' | ' + sum.toFixed(2).replace(".",decPoint) + ' |
';
footer += emptyLine;
footer += ' ';
footer += toHtml(companyInfo).replace(/(?:\r\n|\r|\n)/g, ' ');
footer += ' |
';
return footer;
}
function generateOneProdLine(count,productname,price,pricelevelname,decPoint,togo) {
var priceStyle = 'style="border: solid black 0px;padding: 3px;text-align:right;vertical-align:bottom;"';
var noStyle = 'style="border: solid black 0px;padding: 3px;text-align:center;vertical-align:bottom;"';
var formattedPrice = (parseFloat(price)).toFixed(2).replace(".",decPoint);
if (pricelevelname != "A") {
productname += " (" + pricelevelname + ")";
}
if (togo == 1) {
productname = "To-Go: " + productname;
}
var totalPrice = count * price;
var formattedTotal = totalPrice.toFixed(2).replace(".",decPoint);
var aProductLine = '';
var cutStyle = 'style="white-space: nowrap;overflow: hidden;text-overflow:ellipsis;width: 60%;"';
aProductLine += '' + count + ' | ' + productname;
aProductLine = aProductLine + ' | ' + formattedPrice;
aProductLine += ' | ' + totalPrice.toFixed(2).replace(".",decPoint) + ' |
';
return aProductLine;
}
/**
* Generate the product part of a receipt on base of html table array elements
*
* @param decPoint
* @param entryListForReceipt
* @returns {String}
*/
function generateProdPart(decPoint,entryListForReceipt) {
var index=0;
tablecontent = '';
// REM* entryListForReceipt has entries of [0] count, [1] entry as object
for (index=0;index";
return receipt;
}