Fix bug where edited transaction "forgets" customer on save

master
Skylar Ittner 6 years ago
parent 78187b5224
commit 92f0a95679

@ -34,6 +34,7 @@ if (isset($_GET['switch']) || !isset($_SESSION['register']) || !$registeropen) {
$editing = true; $editing = true;
$payments = $database->select('payments', ['[>]certificates' => 'certid', '[>]payment_types' => ['type' => 'typeid']], ['payments.amount', 'typename', 'icon', 'text', 'certcode'], ['txid' => $tx['txid']]); $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=\"txid\" value=\"$tx[txid]\">";
echo "<input type=\"hidden\" id=\"edit_customerid\" value=\"$tx[customerid]\">";
} else { } else {
$returning = true; $returning = true;
echo "<input type=\"hidden\" id=\"return\" value=\"1\">"; echo "<input type=\"hidden\" id=\"return\" value=\"1\">";

@ -9,6 +9,12 @@ var customername = "";
var customeremail = ""; var customeremail = "";
var customerphone = ""; var customerphone = "";
$(document).ready(function () {
if ($("#edit_customerid").length) {
customerid = $("#edit_customerid").val();
}
});
function showCustomerList(search) { function showCustomerList(search) {
if (search == "") { if (search == "") {
return; return;

Loading…
Cancel
Save