mirror of
https://github.com/Expand-sys/ccashfrontend
synced 2025-12-18 23:52:14 +11:00
fix with ifs aswell
This commit is contained in:
parent
74cb7059c7
commit
46b738e61c
1 changed files with 12 additions and 7 deletions
19
index.js
19
index.js
|
|
@ -219,15 +219,20 @@ app.get("/BankF", ensureAuthenticated, async function (req, res) {
|
||||||
console.log(graphlog);
|
console.log(graphlog);
|
||||||
let graphdata = '["transaction", "balance"]';
|
let graphdata = '["transaction", "balance"]';
|
||||||
let currentbal = balance.value;
|
let currentbal = balance.value;
|
||||||
for (i = graphlog.length - 1; i > -1; i--) {
|
if (graphlog) {
|
||||||
if (graphlog[i].from == req.session.user) {
|
for (i = graphlog.length - 1; i > -1; i--) {
|
||||||
currentbal = parseInt(currentbal) + parseInt(graphlog[i].amount);
|
if (graphlog[i].from == req.session.user) {
|
||||||
graphdata = graphdata + ", [" + parseInt(i) + "," + currentbal + "]";
|
currentbal = parseInt(currentbal) + parseInt(graphlog[i].amount);
|
||||||
} else {
|
graphdata = graphdata + ", [" + parseInt(i) + "," + currentbal + "]";
|
||||||
currentbal = parseInt(currentbal) - parseInt(graphlog[i].amount);
|
} else {
|
||||||
graphdata = graphdata + ", [" + parseInt(i) + "," + currentbal + "]";
|
currentbal = parseInt(currentbal) - parseInt(graphlog[i].amount);
|
||||||
|
graphdata = graphdata + ", [" + parseInt(i) + "," + currentbal + "]";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
graphlog = undefined;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (logsent == 1 || logsent == -1 || logsent == null) {
|
if (logsent == 1 || logsent == -1 || logsent == null) {
|
||||||
logsent = undefined;
|
logsent = undefined;
|
||||||
} else {
|
} else {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue