master
bel 2021-08-02 23:14:58 -06:00
parent bf5428a680
commit 78c7185439
1 changed files with 16 additions and 0 deletions

View File

@ -82,6 +82,22 @@
}
http("put", "/api/transactions", () => {init()}, JSON.stringify(kvs))
}
function setRowKeyValue(row, wantkey, wantvalue) {
const inputs = row.getElementsByTagName("td")
var kvs = {}
for (var i = 0; i < inputs.length; i++) {
const key = inputs[i].getAttribute("key")
if (key == wantkey) {
inputs[i].innerHTML = wantvalue
break
}
}
saveTransaction(row)
}
zachsPayment = (x) => setRowKeyValue(x, "Payer", "AssetAccount:Zach")
belsPayment = (x) => setRowKeyValue(x, "Payer", "AssetAccount:Bel")
zachsCharge = (x) => setRowKeyValue(x, "Payee", "DebtAccount:Zach")
belsCharge = (x) => setRowKeyValue(x, "belsCharge", "DebtAccount:Bel")
function http(method, remote, callback, body) {
var xmlhttp = new XMLHttpRequest();
xmlhttp.onreadystatechange = function() {