Merge branch 'k-fet' of git.eleves.ens.fr:cof-geek/gestioCOF into qwann/k-fet/stats
This commit is contained in:
commit
4da9327666
5 changed files with 77 additions and 26 deletions
|
@ -493,7 +493,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'
|
||||
|
||||
|
@ -504,12 +505,13 @@ 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),
|
||||
)
|
||||
)
|
||||
context['negatives_sum'] = negs_sum['bal'] + negs_sum['offset']
|
||||
context['negatives_sum'] = negs_sum['bal'] - negs_sum['offset']
|
||||
return context
|
||||
|
||||
# -----
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue