From 45cc7cfa33e3ccf0b1065429718118458f639767 Mon Sep 17 00:00:00 2001 From: Ludovic Stephan Date: Thu, 1 Dec 2016 01:39:16 -0200 Subject: [PATCH 1/2] =?UTF-8?q?correction=20n=C3=A9gatif=20total?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- kfet/views.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kfet/views.py b/kfet/views.py index f95fb2c6..daf84207 100644 --- a/kfet/views.py +++ b/kfet/views.py @@ -506,7 +506,7 @@ class AccountNegativeList(ListView): offset = Coalesce(Sum('balance_offset'),0), ) ) - context['negatives_sum'] = negs_sum['bal'] + negs_sum['offset'] + context['negatives_sum'] = negs_sum['bal'] - negs_sum['offset'] return context # ----- From a7f3b85b254104d7f3cce36018bdf2ddeb863416 Mon Sep 17 00:00:00 2001 From: Ludovic Stephan Date: Thu, 1 Dec 2016 01:44:41 -0200 Subject: [PATCH 2/2] =?UTF-8?q?exclut=20#13=20du=20n=C3=A9gatif=20total?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- kfet/views.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/kfet/views.py b/kfet/views.py index daf84207..7083d489 100644 --- a/kfet/views.py +++ b/kfet/views.py @@ -490,7 +490,8 @@ class AccountGroupUpdate(UpdateView): class AccountNegativeList(ListView): queryset = (AccountNegative.objects - .select_related('account', 'account__cofprofile__user')) + .select_related('account', 'account__cofprofile__user') + .exclude(account__trigramme='#13')) template_name = 'kfet/account_negative.html' context_object_name = 'negatives' @@ -501,6 +502,7 @@ class AccountNegativeList(ListView): 'overdraft_duration': Settings.OVERDRAFT_DURATION(), } negs_sum = (AccountNegative.objects + .exclude(account__trigramme='#13') .aggregate( bal = Coalesce(Sum('account__balance'),0), offset = Coalesce(Sum('balance_offset'),0),