diff --git a/lang/en_us.php b/lang/en_us.php index 32d1639..eb9f217 100644 --- a/lang/en_us.php +++ b/lang/en_us.php @@ -120,7 +120,7 @@ define("STRINGS", [ "pick cash" => "Choose", "cash already closed" => "Cash already closed, cannot edit this transaction. Process a return instead.", "update" => "Update", - "transaction search" => "Search transactions (by Tx ID or customer)", + "transaction search" => "Search transactions", "return" => "Return", "enter refund" => "Enter Refund", "refund" => "Refund", diff --git a/pages.php b/pages.php index 43d48a0..d9e01d3 100644 --- a/pages.php +++ b/pages.php @@ -21,6 +21,8 @@ define("PAGES", [ "scripts" => [ "static/js/input_type_money.js", "static/js/bsalert.js", + "static/js/bsnumpad.js", + "static/js/bsmoneypad.js", "static/js/pos_items.js", "static/js/pos_customer.js", "static/js/pos_gridview.js", diff --git a/pages/pos.php b/pages/pos.php index 1133329..c7c49df 100644 --- a/pages/pos.php +++ b/pages/pos.php @@ -102,6 +102,9 @@ if (isset($_GET['switch']) || !isset($_SESSION['register']) || !$registeropen) {
" />
+ + +
@@ -174,6 +177,11 @@ if (isset($_GET['switch']) || !isset($_SESSION['register']) || !$registeropen) { $ +
+ + + +
+
+ + + +
diff --git a/static/js/bsalert.js b/static/js/bsalert.js index 1df3af3..7daf219 100644 --- a/static/js/bsalert.js +++ b/static/js/bsalert.js @@ -47,6 +47,16 @@ function bsalert(title, message, okbtn, cancelbtn, callback) { $("#bsalert").modal("show"); } +/** + * Prompt the user for input with a modal dialog. + * @param {type} title Modal title + * @param {type} message Message content + * @param {type} okbtn Text for the OK button + * @param {type} cancelbtn Text for the cancel button + * @param {type} type Input box type (text, number, etc) + * @param {type} callback Function to pass the user input to + * @returns {undefined} + */ function bsprompt(title, message, okbtn, cancelbtn, type, callback) { var html = '' + ' ' + + '
' +// + ' ' +// + ' ' +// + ' ' + + ' ' + + ' ' + + ' ' + + '
' + extrafield + '
' + ' ' @@ -102,6 +115,34 @@ $("#payment-lines").on("click", ".remove-payment-btn", function () { recalculate(); }); +$("#payment-lines").on("click", ".open-money-pad-btn", function () { + var inputbox = $(this).parents('.input-group').children(".payment-entry"); + var value = inputbox.val(); + if (isNaN(value)) { + value = 0.0; + } + bsmoneypad("Currency Calculator", value * 1.0, "Save", "Cancel", null, function (answer) { + inputbox.val(answer); + recalculate(); + }); +}); + +$("#payment-lines").on("click", ".open-number-pad-btn", function () { + if ($(this).data('gc') == '1') { + var inputbox = $(this).parents('.input-group').children(".giftcard-number"); + } else { + var inputbox = $(this).parents('.input-group').children(".payment-entry"); + } + var value = inputbox.val(); + if (isNaN(value)) { + value = ''; + } + bsnumpad("Keyboard", value, "Save", "Cancel", function (answer) { + inputbox.val(answer); + recalculate(); + }); +}); + $("#paymentbtn").click(function () { $("#paymentui").removeClass("d-none"); });