/* * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ $("#openmanagement").click(function () { document.getElementById("xframe").contentDocument.location.reload(true); $("#managermodal").modal(); }); $("#xprintbtn").click(function () { if (nickelbridge) { $.get('action.php', { action: 'xreport', format: 'json', width: receiptwidth, register: $("#register").data('id') }, function (receipt) { $.ajax("http://127.0.0.1:64269/print", { data: JSON.stringify(receipt), contentType: 'application/json', type: 'POST', success: function (resp) { } }).fail(function (resp) { alert("Error: " + JSON.stringify(resp)); }); }); } else { document.getElementById("xframe").contentWindow.print(); } }); function showTransactionList(search) { if (search == "") { return; } $.get('action.php', { action: 'transactionsearch', q: search }, function (data) { var html = ""; if (data['transactions'].length > 0) { for (var i = 0; i < data['transactions'].length; i++) { var txid = ' ' + data['transactions'][i]['txid']; var date = ' ' + data['transactions'][i]['txdate']; var customername = ""; var cashiername = ""; var buttons = ""; if (typeof data['transactions'][i]['customer']['name'] == 'string') { customername = ' ' + data['transactions'][i]['customer']['name']; } if (data['transactions'][i]['cashier']['name'] != "") { cashiername = ' ' + data['transactions'][i]['cashier']['name']; } buttons += ' Receipt '; if (data['transactions'][i]['editable'] === true) { buttons += ' Edit'; } else { buttons += ' Return'; } html += '