From 152dfa8f627572aa0748a3a5a38be4642b98ca56 Mon Sep 17 00:00:00 2001 From: evilny0 Date: Mon, 11 Apr 2011 23:04:30 +0200 Subject: [PATCH] Display spent amount when currency is EUR in tournament reports --- pyfpdb/SQL.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyfpdb/SQL.py b/pyfpdb/SQL.py index 6245e94b..46bcccb9 100644 --- a/pyfpdb/SQL.py +++ b/pyfpdb/SQL.py @@ -2935,7 +2935,7 @@ class Sql: ,SUM(CASE WHEN rank = 2 THEN 1 ELSE 0 END) AS _2nd ,SUM(CASE WHEN rank = 3 THEN 1 ELSE 0 END) AS _3rd ,SUM(tp.winnings)/100.0 AS won - ,SUM(CASE WHEN tt.currency = 'USD' THEN (tt.buyIn+tt.fee)/100.0 ELSE tt.buyIn END) AS spent + ,SUM(CASE WHEN tt.currency = 'USD' THEN (tt.buyIn+tt.fee)/100.0 WHEN tt.currency = 'EUR' THEN (tt.buyIn+tt.fee)/100.0 ELSE tt.buyIn END) AS spent ,SUM(tp.winnings)/SUM(tt.buyin+tt.fee)*100.0-100 AS roi ,SUM(tp.winnings-(tt.buyin+tt.fee))/100.0/(COUNT(1)-SUM(CASE WHEN tp.rank > 0 THEN 0 ELSE 1 END)) AS profitPerTourney from TourneysPlayers tp