mirror of
https://github.com/Expand-sys/ccashfrontend
synced 2025-12-16 23:02:13 +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);
|
||||
let graphdata = '["transaction", "balance"]';
|
||||
let currentbal = balance.value;
|
||||
for (i = graphlog.length - 1; i > -1; i--) {
|
||||
if (graphlog[i].from == req.session.user) {
|
||||
currentbal = parseInt(currentbal) + parseInt(graphlog[i].amount);
|
||||
graphdata = graphdata + ", [" + parseInt(i) + "," + currentbal + "]";
|
||||
} else {
|
||||
currentbal = parseInt(currentbal) - parseInt(graphlog[i].amount);
|
||||
graphdata = graphdata + ", [" + parseInt(i) + "," + currentbal + "]";
|
||||
if (graphlog) {
|
||||
for (i = graphlog.length - 1; i > -1; i--) {
|
||||
if (graphlog[i].from == req.session.user) {
|
||||
currentbal = parseInt(currentbal) + parseInt(graphlog[i].amount);
|
||||
graphdata = graphdata + ", [" + parseInt(i) + "," + currentbal + "]";
|
||||
} else {
|
||||
currentbal = parseInt(currentbal) - parseInt(graphlog[i].amount);
|
||||
graphdata = graphdata + ", [" + parseInt(i) + "," + currentbal + "]";
|
||||
}
|
||||
}
|
||||
} else {
|
||||
graphlog = undefined;
|
||||
}
|
||||
|
||||
if (logsent == 1 || logsent == -1 || logsent == null) {
|
||||
logsent = undefined;
|
||||
} else {
|
||||
|
|
|
|||
Loading…
Reference in a new issue