From 39a79075b929ee1891b058f609f50e1eac230aa9 Mon Sep 17 00:00:00 2001 From: Vincent Le Gallic Date: Sat, 18 Nov 2017 11:39:09 +0100 Subject: [PATCH] =?utf8?q?[bde/stats/depenses.py]=20Encore=20des=20confusi?= =?utf8?q?ons=20d=C3=A9penses/gains?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit J'espère que c'est enfin correct :D --- bde/stats/depenses.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/bde/stats/depenses.py b/bde/stats/depenses.py index 88e7c90..5ea5c9c 100755 --- a/bde/stats/depenses.py +++ b/bde/stats/depenses.py @@ -37,7 +37,7 @@ display_all = """ SELECT * FROM past ; """ -display_sum = """ SELECT sum(gains) AS gains, sum(depenses) AS depenses +display_sum = """ SELECT sum(depenses) AS depenses, sum(gains) AS gains FROM past ; """ @@ -60,7 +60,7 @@ def get_depenses(idbde, bymonth=False): def display_depenses(idbde, all, tot, bymonth=False): """Pretty-printing des résultats.""" month = "\tmois" if bymonth else "" - print "Compte %s:\nannee%s\tgains\t\tdépenses" % (idbde, month) + print "Compte %s:\nannee%s\tdépenses\tgains" % (idbde, month) for li in all: if bymonth: li = [int(li[0]), int(li[1]), li[2], li[3]] @@ -68,7 +68,7 @@ def display_depenses(idbde, all, tot, bymonth=False): else: li = [int(li[0]), li[1], li[2]] print "%s\t%s\t\t%s" % tuple(li) - print "\nTotal :\n\tgains\t\tdépenses" + print "\nTotal :\n\tdépenses\tgains" print "\t%s\t\t%s\n" % tuple(tot) if __name__ == "__main__": -- 2.39.2