From 92f0a95679e4450f62f3e94940aa36cd2d8f75e4 Mon Sep 17 00:00:00 2001 From: Skylar Ittner Date: Sat, 23 Jun 2018 20:20:30 -0600 Subject: [PATCH] Fix bug where edited transaction "forgets" customer on save --- pages/pos.php | 1 + static/js/pos_customer.js | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/pages/pos.php b/pages/pos.php index a7a2055..28fdd2b 100644 --- a/pages/pos.php +++ b/pages/pos.php @@ -34,6 +34,7 @@ if (isset($_GET['switch']) || !isset($_SESSION['register']) || !$registeropen) { $editing = true; $payments = $database->select('payments', ['[>]certificates' => 'certid', '[>]payment_types' => ['type' => 'typeid']], ['payments.amount', 'typename', 'icon', 'text', 'certcode'], ['txid' => $tx['txid']]); echo ""; + echo ""; } else { $returning = true; echo ""; diff --git a/static/js/pos_customer.js b/static/js/pos_customer.js index 3244ef9..ce76010 100644 --- a/static/js/pos_customer.js +++ b/static/js/pos_customer.js @@ -9,6 +9,12 @@ var customername = ""; var customeremail = ""; var customerphone = ""; +$(document).ready(function () { + if ($("#edit_customerid").length) { + customerid = $("#edit_customerid").val(); + } +}); + function showCustomerList(search) { if (search == "") { return;