totals row on top

This commit is contained in:
2021-10-19 23:08:41 -06:00
parent d87c38682b
commit b736ec9c0e
+1 -1
View File
@@ -18,6 +18,7 @@ def index():
'SELECT * FROM totals ORDER BY date DESC LIMIT 56' 'SELECT * FROM totals ORDER BY date DESC LIMIT 56'
).fetchall() ).fetchall()
lastseven = {} lastseven = {}
lastseven['Totals'] = {}
stops = 0 stops = 0
totstops = 0 totstops = 0
totpkgs = 0 totpkgs = 0
@@ -39,7 +40,6 @@ def index():
tottermpkgs += fourweeks[i]['prepkgs'] tottermpkgs += fourweeks[i]['prepkgs']
lastseven[fourweeks[i]['date']]['termpkgs'] = fourweeks[i]['prepkgs'] lastseven[fourweeks[i]['date']]['termpkgs'] = fourweeks[i]['prepkgs']
lastseven[fourweeks[i]['date']]['percenttermvol'] = round(100 * stops / fourweeks[i]['prepkgs'], 2) lastseven[fourweeks[i]['date']]['percenttermvol'] = round(100 * stops / fourweeks[i]['prepkgs'], 2)
lastseven['Totals'] = {}
lastseven['Totals']['pkgs'] = totpkgs lastseven['Totals']['pkgs'] = totpkgs
lastseven['Totals']['stops'] = totstops lastseven['Totals']['stops'] = totstops
lastseven['Totals']['pkgsperstop'] = round(totpkgs / totstops, 2) lastseven['Totals']['pkgsperstop'] = round(totpkgs / totstops, 2)