Commit 53a2a160 authored by Sli's avatar Sli
Browse files

Add CB refills sum

parent ec8ee15d
Pipeline #875 passed with stage
in 3 minutes and 26 seconds
...@@ -15,6 +15,9 @@ ...@@ -15,6 +15,9 @@
</select> </select>
<input type="submit" value="{% trans %}Go{% endtrans %}" /> <input type="submit" value="{% trans %}Go{% endtrans %}" />
</form> </form>
<br>
<p>{% trans %}CB Payments{% endtrans %} : {{sum_cb}}</p>
<br>
<table> <table>
<thead> <thead>
<td>{% trans %}Club{% endtrans %}</td> <td>{% trans %}Club{% endtrans %}</td>
......
...@@ -1031,6 +1031,14 @@ class InvoiceCallView(CounterAdminTabsMixin, CounterAdminMixin, TemplateView): ...@@ -1031,6 +1031,14 @@ class InvoiceCallView(CounterAdminTabsMixin, CounterAdminMixin, TemplateView):
start_date = start_date.replace(tzinfo=pytz.UTC) start_date = start_date.replace(tzinfo=pytz.UTC)
end_date = (start_date + timedelta(days=32)).replace(day=1, hour=0, minute=0, microsecond=0) end_date = (start_date + timedelta(days=32)).replace(day=1, hour=0, minute=0, microsecond=0)
from django.db.models import Sum, Case, When, F, DecimalField from django.db.models import Sum, Case, When, F, DecimalField
sum_cb = 0
for r in Refilling.objects.filter(payment_method='CARD', is_validated=True,
date__gte=start_date, date__lte=end_date):
sum_cb +=r.amount
for s in Selling.objects.filter(payment_method='CARD', is_validated=True,
date__gte=start_date, date__lte=end_date):
sum_cb +=s.quantity*s.unit_price
kwargs['sum_cb'] = sum_cb
kwargs['start_date'] = start_date kwargs['start_date'] = start_date
kwargs['sums'] = Selling.objects.values('club__name').annotate(selling_sum=Sum( kwargs['sums'] = Selling.objects.values('club__name').annotate(selling_sum=Sum(
Case(When(date__gte=start_date, Case(When(date__gte=start_date,
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
msgid "" msgid ""
msgstr "" msgstr ""
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2017-03-30 22:12+0200\n" "POT-Creation-Date: 2017-04-05 13:42+0200\n"
"PO-Revision-Date: 2016-07-18\n" "PO-Revision-Date: 2016-07-18\n"
"Last-Translator: Skia <skia@libskia.so>\n" "Last-Translator: Skia <skia@libskia.so>\n"
"Language-Team: AE info <ae.info@utbm.fr>\n" "Language-Team: AE info <ae.info@utbm.fr>\n"
...@@ -39,7 +39,7 @@ msgstr "code postal" ...@@ -39,7 +39,7 @@ msgstr "code postal"
msgid "country" msgid "country"
msgstr "pays" msgstr "pays"
#: accounting/models.py:41 core/models.py:161 #: accounting/models.py:41 core/models.py:163
msgid "phone" msgid "phone"
msgstr "téléphone" msgstr "téléphone"
...@@ -125,8 +125,8 @@ msgstr "numéro" ...@@ -125,8 +125,8 @@ msgstr "numéro"
msgid "journal" msgid "journal"
msgstr "classeur" msgstr "classeur"
#: accounting/models.py:230 core/models.py:551 core/models.py:922 #: accounting/models.py:230 core/models.py:553 core/models.py:924
#: core/models.py:962 counter/models.py:247 counter/models.py:295 #: core/models.py:964 counter/models.py:247 counter/models.py:295
#: counter/models.py:421 eboutic/models.py:15 eboutic/models.py:48 #: counter/models.py:421 eboutic/models.py:15 eboutic/models.py:48
#: forum/models.py:166 forum/models.py:221 #: forum/models.py:166 forum/models.py:221
msgid "date" msgid "date"
...@@ -186,7 +186,7 @@ msgstr "Utilisateur" ...@@ -186,7 +186,7 @@ msgstr "Utilisateur"
#: com/templates/com/news_admin_list.jinja:17 #: com/templates/com/news_admin_list.jinja:17
#: com/templates/com/news_admin_list.jinja:51 #: com/templates/com/news_admin_list.jinja:51
#: com/templates/com/weekmail.jinja:18 com/templates/com/weekmail.jinja:47 #: com/templates/com/weekmail.jinja:18 com/templates/com/weekmail.jinja:47
#: counter/templates/counter/invoices_call.jinja:20 #: counter/templates/counter/invoices_call.jinja:23
msgid "Club" msgid "Club"
msgstr "Club" msgstr "Club"
...@@ -336,13 +336,13 @@ msgstr "Compte en banque : " ...@@ -336,13 +336,13 @@ msgstr "Compte en banque : "
#: forum/templates/forum/macros.jinja:20 forum/templates/forum/macros.jinja:108 #: forum/templates/forum/macros.jinja:20 forum/templates/forum/macros.jinja:108
#: launderette/templates/launderette/launderette_admin.jinja:16 #: launderette/templates/launderette/launderette_admin.jinja:16
#: launderette/views.py:154 sas/templates/sas/album.jinja:26 #: launderette/views.py:154 sas/templates/sas/album.jinja:26
#: sas/templates/sas/moderation.jinja:18 sas/templates/sas/picture.jinja:66 #: sas/templates/sas/moderation.jinja:18 sas/templates/sas/picture.jinja:74
#: sas/templates/sas/picture.jinja.py:116 #: sas/templates/sas/picture.jinja.py:124
msgid "Delete" msgid "Delete"
msgstr "Supprimer" msgstr "Supprimer"
#: accounting/templates/accounting/bank_account_details.jinja:17 #: accounting/templates/accounting/bank_account_details.jinja:17
#: club/views.py:33 core/views/user.py:130 sas/templates/sas/picture.jinja:78 #: club/views.py:33 core/views/user.py:130 sas/templates/sas/picture.jinja:86
msgid "Infos" msgid "Infos"
msgstr "Infos" msgstr "Infos"
...@@ -377,7 +377,7 @@ msgstr "Nouveau compte club" ...@@ -377,7 +377,7 @@ msgstr "Nouveau compte club"
#: forum/templates/forum/macros.jinja:19 forum/templates/forum/macros.jinja:56 #: forum/templates/forum/macros.jinja:19 forum/templates/forum/macros.jinja:56
#: forum/templates/forum/macros.jinja:102 #: forum/templates/forum/macros.jinja:102
#: launderette/templates/launderette/launderette_list.jinja:16 #: launderette/templates/launderette/launderette_list.jinja:16
#: sas/templates/sas/album.jinja:18 sas/templates/sas/picture.jinja:92 #: sas/templates/sas/album.jinja:18 sas/templates/sas/picture.jinja:100
msgid "Edit" msgid "Edit"
msgstr "Éditer" msgstr "Éditer"
...@@ -575,7 +575,7 @@ msgid "Done" ...@@ -575,7 +575,7 @@ msgid "Done"
msgstr "Effectué" msgstr "Effectué"
#: accounting/templates/accounting/journal_details.jinja:39 #: accounting/templates/accounting/journal_details.jinja:39
#: counter/templates/counter/cash_summary_list.jinja:37 counter/views.py:712 #: counter/templates/counter/cash_summary_list.jinja:37 counter/views.py:756
msgid "Comment" msgid "Comment"
msgstr "Commentaire" msgstr "Commentaire"
...@@ -621,7 +621,7 @@ msgstr "Type d'opération" ...@@ -621,7 +621,7 @@ msgstr "Type d'opération"
#: accounting/templates/accounting/journal_statement_nature.jinja:32 #: accounting/templates/accounting/journal_statement_nature.jinja:32
#: accounting/templates/accounting/journal_statement_person.jinja:17 #: accounting/templates/accounting/journal_statement_person.jinja:17
#: accounting/templates/accounting/journal_statement_person.jinja:45 #: accounting/templates/accounting/journal_statement_person.jinja:45
#: counter/templates/counter/invoices_call.jinja:21 #: counter/templates/counter/invoices_call.jinja:24
msgid "Sum" msgid "Sum"
msgstr "Somme" msgstr "Somme"
...@@ -794,11 +794,11 @@ msgstr "" ...@@ -794,11 +794,11 @@ msgstr ""
msgid "A club with that unix name already exists." msgid "A club with that unix name already exists."
msgstr "Un club avec ce nom UNIX existe déjà." msgstr "Un club avec ce nom UNIX existe déjà."
#: club/models.py:32 core/models.py:163 #: club/models.py:32 core/models.py:165
msgid "address" msgid "address"
msgstr "Adresse" msgstr "Adresse"
#: club/models.py:38 core/models.py:124 #: club/models.py:38 core/models.py:126
msgid "home" msgid "home"
msgstr "home" msgstr "home"
...@@ -812,16 +812,16 @@ msgstr "Un club avec ce nom UNIX existe déjà." ...@@ -812,16 +812,16 @@ msgstr "Un club avec ce nom UNIX existe déjà."
#: club/models.py:147 counter/models.py:402 counter/models.py:419 #: club/models.py:147 counter/models.py:402 counter/models.py:419
#: eboutic/models.py:14 eboutic/models.py:47 election/models.py:130 #: eboutic/models.py:14 eboutic/models.py:47 election/models.py:130
#: launderette/models.py:87 launderette/models.py:124 sas/models.py:131 #: launderette/models.py:87 launderette/models.py:124 sas/models.py:132
msgid "user" msgid "user"
msgstr "nom d'utilisateur" msgstr "nom d'utilisateur"
#: club/models.py:151 core/models.py:143 election/models.py:129 #: club/models.py:151 core/models.py:145 election/models.py:129
#: election/models.py:145 #: election/models.py:145
msgid "role" msgid "role"
msgstr "rôle" msgstr "rôle"
#: club/models.py:153 core/models.py:35 counter/models.py:76 #: club/models.py:153 core/models.py:37 counter/models.py:76
#: counter/models.py:101 election/models.py:15 election/models.py:82 #: counter/models.py:101 election/models.py:15 election/models.py:82
#: election/models.py:131 forum/models.py:26 forum/models.py:127 #: election/models.py:131 forum/models.py:26 forum/models.py:127
msgid "description" msgid "description"
...@@ -901,7 +901,7 @@ msgstr "Du" ...@@ -901,7 +901,7 @@ msgstr "Du"
msgid "To" msgid "To"
msgstr "Au" msgstr "Au"
#: club/templates/club/club_sellings.jinja:5 club/views.py:60 club/views.py:221 #: club/templates/club/club_sellings.jinja:5 club/views.py:60 club/views.py:223
#: counter/templates/counter/counter_main.jinja:19 #: counter/templates/counter/counter_main.jinja:19
#: counter/templates/counter/last_ops.jinja:35 #: counter/templates/counter/last_ops.jinja:35
msgid "Sellings" msgid "Sellings"
...@@ -928,10 +928,10 @@ msgstr "unités" ...@@ -928,10 +928,10 @@ msgstr "unités"
msgid "Benefit: " msgid "Benefit: "
msgstr "Bénéfice : " msgstr "Bénéfice : "
#: club/templates/club/club_sellings.jinja:21 club/views.py:171 #: club/templates/club/club_sellings.jinja:21 club/views.py:173
#: core/templates/core/user_account_detail.jinja:18 #: core/templates/core/user_account_detail.jinja:18
#: core/templates/core/user_account_detail.jinja:51 #: core/templates/core/user_account_detail.jinja:51
#: counter/templates/counter/cash_summary_list.jinja:33 counter/views.py:75 #: counter/templates/counter/cash_summary_list.jinja:33 counter/views.py:103
msgid "Counter" msgid "Counter"
msgstr "Comptoir" msgstr "Comptoir"
...@@ -1016,7 +1016,7 @@ msgid "Old members" ...@@ -1016,7 +1016,7 @@ msgid "Old members"
msgstr "Anciens membres" msgstr "Anciens membres"
#: club/views.py:50 core/templates/core/base.jinja:64 core/views/user.py:146 #: club/views.py:50 core/templates/core/base.jinja:64 core/views/user.py:146
#: sas/templates/sas/picture.jinja:87 #: sas/templates/sas/picture.jinja:95
msgid "Tools" msgid "Tools"
msgstr "Outils" msgstr "Outils"
...@@ -1026,24 +1026,24 @@ msgstr "Outils" ...@@ -1026,24 +1026,24 @@ msgstr "Outils"
msgid "Props" msgid "Props"
msgstr "Propriétés" msgstr "Propriétés"
#: club/views.py:107 core/views/forms.py:206 counter/views.py:40 #: club/views.py:107 core/views/forms.py:206 counter/views.py:68
msgid "Select user" msgid "Select user"
msgstr "Choisir un utilisateur" msgstr "Choisir un utilisateur"
#: club/views.py:154 sas/views.py:82 sas/views.py:133 sas/views.py:204 #: club/views.py:156 sas/views.py:82 sas/views.py:133 sas/views.py:204
msgid "You do not have the permission to do that" msgid "You do not have the permission to do that"
msgstr "Vous n'avez pas la permission de faire cela" msgstr "Vous n'avez pas la permission de faire cela"
#: club/views.py:169 counter/views.py:933 #: club/views.py:171 counter/views.py:977
msgid "Begin date" msgid "Begin date"
msgstr "Date de début" msgstr "Date de début"
#: club/views.py:170 com/views.py:99 counter/views.py:934 election/views.py:131 #: club/views.py:172 com/views.py:99 counter/views.py:978 election/views.py:131
msgid "End date" msgid "End date"
msgstr "Date de fin" msgstr "Date de fin"
#: club/views.py:184 core/templates/core/user_stats.jinja:27 #: club/views.py:186 core/templates/core/user_stats.jinja:27
#: counter/views.py:1016 #: counter/views.py:1068
msgid "Product" msgid "Product"
msgstr "Produit" msgstr "Produit"
...@@ -1092,7 +1092,7 @@ msgstr "résumé" ...@@ -1092,7 +1092,7 @@ msgstr "résumé"
msgid "content" msgid "content"
msgstr "contenu de la nouvelle" msgstr "contenu de la nouvelle"
#: com/models.py:36 core/models.py:961 launderette/models.py:60 #: com/models.py:36 core/models.py:963 launderette/models.py:60
#: launderette/models.py:85 launderette/models.py:121 #: launderette/models.py:85 launderette/models.py:121
msgid "type" msgid "type"
msgstr "type" msgstr "type"
...@@ -1101,7 +1101,7 @@ msgstr "type" ...@@ -1101,7 +1101,7 @@ msgstr "type"
msgid "author" msgid "author"
msgstr "auteur" msgstr "auteur"
#: com/models.py:39 core/models.py:552 #: com/models.py:39 core/models.py:554
msgid "is moderated" msgid "is moderated"
msgstr "est modéré" msgstr "est modéré"
...@@ -1201,7 +1201,7 @@ msgstr "Nouvelles à modérer" ...@@ -1201,7 +1201,7 @@ msgstr "Nouvelles à modérer"
#: com/templates/com/news_detail.jinja:26 #: com/templates/com/news_detail.jinja:26
#: core/templates/core/file_detail.jinja:65 #: core/templates/core/file_detail.jinja:65
#: core/templates/core/file_moderation.jinja:23 #: core/templates/core/file_moderation.jinja:23
#: sas/templates/sas/moderation.jinja:17 sas/templates/sas/picture.jinja:114 #: sas/templates/sas/moderation.jinja:17 sas/templates/sas/picture.jinja:122
msgid "Moderate" msgid "Moderate"
msgstr "Modérer" msgstr "Modérer"
...@@ -1213,7 +1213,7 @@ msgstr "Retour aux nouvelles" ...@@ -1213,7 +1213,7 @@ msgstr "Retour aux nouvelles"
msgid "Author: " msgid "Author: "
msgstr "Auteur : " msgstr "Auteur : "
#: com/templates/com/news_detail.jinja:24 sas/templates/sas/picture.jinja:82 #: com/templates/com/news_detail.jinja:24 sas/templates/sas/picture.jinja:90
msgid "Moderator: " msgid "Moderator: "
msgstr "Modérateur : " msgstr "Modérateur : "
...@@ -1395,30 +1395,30 @@ msgstr "Supprimer et sauver pour regénérer" ...@@ -1395,30 +1395,30 @@ msgstr "Supprimer et sauver pour regénérer"
msgid "Weekmail of the " msgid "Weekmail of the "
msgstr "Weekmail du " msgstr "Weekmail du "
#: core/models.py:31 #: core/models.py:33
msgid "meta group status" msgid "meta group status"
msgstr "status du meta-groupe" msgstr "status du meta-groupe"
#: core/models.py:33 #: core/models.py:35
msgid "Whether a group is a meta group or not" msgid "Whether a group is a meta group or not"
msgstr "Si un groupe est un meta-groupe ou pas" msgstr "Si un groupe est un meta-groupe ou pas"
#: core/models.py:65 #: core/models.py:67
#, python-format #, python-format
msgid "%(value)s is not a valid promo (between 0 and %(end)s)" msgid "%(value)s is not a valid promo (between 0 and %(end)s)"
msgstr "%(value)s n'est pas une promo valide (doit être entre 0 et %(end)s)" msgstr "%(value)s n'est pas une promo valide (doit être entre 0 et %(end)s)"
#: core/models.py:81 #: core/models.py:83
msgid "username" msgid "username"
msgstr "nom d'utilisateur" msgstr "nom d'utilisateur"
#: core/models.py:84 #: core/models.py:86
msgid "Required. 254 characters or fewer. Letters, digits and ./+/-/_ only." msgid "Required. 254 characters or fewer. Letters, digits and ./+/-/_ only."
msgstr "" msgstr ""
"Requis. Pas plus de 254 caractères. Uniquement des lettres, numéros, et ./" "Requis. Pas plus de 254 caractères. Uniquement des lettres, numéros, et ./"
"+/-/_" "+/-/_"
#: core/models.py:88 #: core/models.py:90
msgid "" msgid ""
"Enter a valid username. This value may contain only letters, numbers and ./" "Enter a valid username. This value may contain only letters, numbers and ./"
"+/-/_ characters." "+/-/_ characters."
...@@ -1426,43 +1426,43 @@ msgstr "" ...@@ -1426,43 +1426,43 @@ msgstr ""
"Entrez un nom d'utilisateur correct. Uniquement des lettres, numéros, et ./" "Entrez un nom d'utilisateur correct. Uniquement des lettres, numéros, et ./"
"+/-/_" "+/-/_"
#: core/models.py:93 #: core/models.py:95
msgid "A user with that username already exists." msgid "A user with that username already exists."
msgstr "Un utilisateur de ce nom existe déjà" msgstr "Un utilisateur de ce nom existe déjà"
#: core/models.py:96 #: core/models.py:98
msgid "first name" msgid "first name"
msgstr "Prénom" msgstr "Prénom"
#: core/models.py:97 #: core/models.py:99
msgid "last name" msgid "last name"
msgstr "Nom" msgstr "Nom"
#: core/models.py:98 #: core/models.py:100
msgid "email address" msgid "email address"
msgstr "adresse email" msgstr "adresse email"
#: core/models.py:99 #: core/models.py:101
msgid "date of birth" msgid "date of birth"
msgstr "date de naissance" msgstr "date de naissance"
#: core/models.py:100 #: core/models.py:102
msgid "nick name" msgid "nick name"
msgstr "surnom" msgstr "surnom"
#: core/models.py:102 #: core/models.py:104
msgid "staff status" msgid "staff status"
msgstr "status \"staff\"" msgstr "status \"staff\""
#: core/models.py:104 #: core/models.py:106
msgid "Designates whether the user can log into this admin site." msgid "Designates whether the user can log into this admin site."
msgstr "Est-ce que l'utilisateur peut se logger à la partie admin du site." msgstr "Est-ce que l'utilisateur peut se logger à la partie admin du site."
#: core/models.py:107 #: core/models.py:109
msgid "active" msgid "active"
msgstr "actif" msgstr "actif"
#: core/models.py:110 #: core/models.py:112
msgid "" msgid ""
"Designates whether this user should be treated as active. Unselect this " "Designates whether this user should be treated as active. Unselect this "
"instead of deleting accounts." "instead of deleting accounts."
...@@ -1470,159 +1470,159 @@ msgstr "" ...@@ -1470,159 +1470,159 @@ msgstr ""
"Est-ce que l'utilisateur doit être traité comme actif. Déselectionnez au " "Est-ce que l'utilisateur doit être traité comme actif. Déselectionnez au "
"lieu de supprimer les comptes." "lieu de supprimer les comptes."
#: core/models.py:114 #: core/models.py:116
msgid "date joined" msgid "date joined"
msgstr "date d'inscription" msgstr "date d'inscription"
#: core/models.py:115 #: core/models.py:117
msgid "last update" msgid "last update"
msgstr "dernière mise à jour" msgstr "dernière mise à jour"
#: core/models.py:117 #: core/models.py:119
msgid "superuser" msgid "superuser"
msgstr "super-utilisateur" msgstr "super-utilisateur"
#: core/models.py:120 #: core/models.py:122
msgid "Designates whether this user is a superuser. " msgid "Designates whether this user is a superuser. "
msgstr "Est-ce que l'utilisateur est super-utilisateur." msgstr "Est-ce que l'utilisateur est super-utilisateur."
#: core/models.py:126 #: core/models.py:128
msgid "profile" msgid "profile"
msgstr "profil" msgstr "profil"
#: core/models.py:128 #: core/models.py:130
msgid "avatar" msgid "avatar"
msgstr "avatar" msgstr "avatar"
#: core/models.py:130 #: core/models.py:132
msgid "scrub" msgid "scrub"
msgstr "blouse" msgstr "blouse"
#: core/models.py:132 #: core/models.py:134
msgid "sex" msgid "sex"
msgstr "sexe" msgstr "sexe"
#: core/models.py:132 #: core/models.py:134
msgid "Man" msgid "Man"
msgstr "Homme" msgstr "Homme"
#: core/models.py:132 #: core/models.py:134
msgid "Woman" msgid "Woman"
msgstr "Femme" msgstr "Femme"
#: core/models.py:133 #: core/models.py:135
msgid "tshirt size" msgid "tshirt size"
msgstr "taille de tshirt" msgstr "taille de tshirt"
#: core/models.py:134 #: core/models.py:136
msgid "-" msgid "-"
msgstr "-" msgstr "-"
#: core/models.py:135 #: core/models.py:137
msgid "XS" msgid "XS"
msgstr "XS" msgstr "XS"
#: core/models.py:136 #: core/models.py:138
msgid "S" msgid "S"
msgstr "S" msgstr "S"
#: core/models.py:137 #: core/models.py:139
msgid "M" msgid "M"
msgstr "M" msgstr "M"
#: core/models.py:138 #: core/models.py:140
msgid "L" msgid "L"
msgstr "L" msgstr "L"
#: core/models.py:139 #: core/models.py:141
msgid "XL" msgid "XL"
msgstr "XL" msgstr "XL"
#: core/models.py:140 #: core/models.py:142
msgid "XXL" msgid "XXL"
msgstr "XXL" msgstr "XXL"
#: core/models.py:141 #: core/models.py:143
msgid "XXXL" msgid "XXXL"
msgstr "XXXL" msgstr "XXXL"
#: core/models.py:144 #: core/models.py:146
msgid "Student" msgid "Student"
msgstr "Étudiant" msgstr "Étudiant"
#: core/models.py:145 #: core/models.py:147
msgid "Administrative agent" msgid "Administrative agent"
msgstr "Personnel administratif" msgstr "Personnel administratif"