Fix bug where edited transaction "forgets" customer on save

This commit is contained in:
Skylar Ittner 2018-06-23 20:20:30 -06:00
parent 78187b5224
commit 92f0a95679
2 changed files with 7 additions and 0 deletions

View File

@ -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 "<input type=\"hidden\" id=\"txid\" value=\"$tx[txid]\">";
echo "<input type=\"hidden\" id=\"edit_customerid\" value=\"$tx[customerid]\">";
} else {
$returning = true;
echo "<input type=\"hidden\" id=\"return\" value=\"1\">";

View File

@ -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;