btns
parent
bf5428a680
commit
78c7185439
|
|
@ -82,6 +82,22 @@
|
||||||
}
|
}
|
||||||
http("put", "/api/transactions", () => {init()}, JSON.stringify(kvs))
|
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) {
|
function http(method, remote, callback, body) {
|
||||||
var xmlhttp = new XMLHttpRequest();
|
var xmlhttp = new XMLHttpRequest();
|
||||||
xmlhttp.onreadystatechange = function() {
|
xmlhttp.onreadystatechange = function() {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue