Commit 53a2a160 authored by Sli's avatar Sli

Add CB refills sum

parent ec8ee15d
Pipeline #875 passed with stage
in 3 minutes and 26 seconds
......@@ -15,6 +15,9 @@
</select>
<input type="submit" value="{% trans %}Go{% endtrans %}" />
</form>
<br>
<p>{% trans %}CB Payments{% endtrans %} : {{sum_cb}}</p>
<br>
<table>
<thead>
<td>{% trans %}Club{% endtrans %}</td>
......
......@@ -1031,6 +1031,14 @@ class InvoiceCallView(CounterAdminTabsMixin, CounterAdminMixin, TemplateView):
start_date = start_date.replace(tzinfo=pytz.UTC)
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
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['sums'] = Selling.objects.values('club__name').annotate(selling_sum=Sum(
Case(When(date__gte=start_date,
......
......@@ -6,7 +6,7 @@
msgid ""
msgstr ""
"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"
"Last-Translator: Skia <skia@libskia.so>\n"
"Language-Team: AE info <ae.info@utbm.fr>\n"
......@@ -39,7 +39,7 @@ msgstr "code postal"
msgid "country"
msgstr "pays"
#: accounting/models.py:41 core/models.py:161
#: accounting/models.py:41 core/models.py:163
msgid "phone"
msgstr "téléphone"
......@@ -125,8 +125,8 @@ msgstr "numéro"
msgid "journal"
msgstr "classeur"
#: accounting/models.py:230 core/models.py:551 core/models.py:922
#: core/models.py:962 counter/models.py:247 counter/models.py:295
#: accounting/models.py:230 core/models.py:553 core/models.py:924
#: core/models.py:964 counter/models.py:247 counter/models.py:295
#: counter/models.py:421 eboutic/models.py:15 eboutic/models.py:48
#: forum/models.py:166 forum/models.py:221
msgid "date"
......@@ -186,7 +186,7 @@ msgstr "Utilisateur"
#: com/templates/com/news_admin_list.jinja:17
#: com/templates/com/news_admin_list.jinja:51
#: 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"
msgstr "Club"
......@@ -336,13 +336,13 @@ msgstr "Compte en banque : "
#: forum/templates/forum/macros.jinja:20 forum/templates/forum/macros.jinja:108
#: launderette/templates/launderette/launderette_admin.jinja:16
#: 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/picture.jinja.py:116
#: sas/templates/sas/moderation.jinja:18 sas/templates/sas/picture.jinja:74
#: sas/templates/sas/picture.jinja.py:124
msgid "Delete"
msgstr "Supprimer"
#: 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"
msgstr "Infos"
......@@ -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:102
#: 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"
msgstr "Éditer"
......@@ -575,7 +575,7 @@ msgid "Done"
msgstr "Effectué"
#: 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"
msgstr "Commentaire"
......@@ -621,7 +621,7 @@ msgstr "Type d'opération"
#: accounting/templates/accounting/journal_statement_nature.jinja:32
#: accounting/templates/accounting/journal_statement_person.jinja:17
#: accounting/templates/accounting/journal_statement_person.jinja:45
#: counter/templates/counter/invoices_call.jinja:21
#: counter/templates/counter/invoices_call.jinja:24
msgid "Sum"
msgstr "Somme"
......@@ -794,11 +794,11 @@ msgstr ""
msgid "A club with that unix name already exists."
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"
msgstr "Adresse"
#: club/models.py:38 core/models.py:124
#: club/models.py:38 core/models.py:126
msgid "home"
msgstr "home"
......@@ -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
#: 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"
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
msgid "role"
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
#: election/models.py:131 forum/models.py:26 forum/models.py:127
msgid "description"
......@@ -901,7 +901,7 @@ msgstr "Du"
msgid "To"
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/last_ops.jinja:35
msgid "Sellings"
......@@ -928,10 +928,10 @@ msgstr "unités"
msgid "Benefit: "
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: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"
msgstr "Comptoir"
......@@ -1016,7 +1016,7 @@ msgid "Old members"
msgstr "Anciens membres"
#: 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"
msgstr "Outils"
......@@ -1026,24 +1026,24 @@ msgstr "Outils"
msgid "Props"
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"
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"
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"
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"
msgstr "Date de fin"
#: club/views.py:184 core/templates/core/user_stats.jinja:27
#: counter/views.py:1016
#: club/views.py:186 core/templates/core/user_stats.jinja:27
#: counter/views.py:1068
msgid "Product"
msgstr "Produit"
......@@ -1092,7 +1092,7 @@ msgstr "résumé"
msgid "content"
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
msgid "type"
msgstr "type"
......@@ -1101,7 +1101,7 @@ msgstr "type"
msgid "author"
msgstr "auteur"
#: com/models.py:39 core/models.py:552
#: com/models.py:39 core/models.py:554
msgid "is moderated"
msgstr "est modéré"
......@@ -1201,7 +1201,7 @@ msgstr "Nouvelles à modérer"
#: com/templates/com/news_detail.jinja:26
#: core/templates/core/file_detail.jinja:65
#: 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"
msgstr "Modérer"
......@@ -1213,7 +1213,7 @@ msgstr "Retour aux nouvelles"
msgid "Author: "
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: "
msgstr "Modérateur : "
......@@ -1395,30 +1395,30 @@ msgstr "Supprimer et sauver pour regénérer"
msgid "Weekmail of the "
msgstr "Weekmail du "
#: core/models.py:31
#: core/models.py:33
msgid "meta group status"
msgstr "status du meta-groupe"
#: core/models.py:33
#: core/models.py:35
msgid "Whether a group is a meta group or not"
msgstr "Si un groupe est un meta-groupe ou pas"
#: core/models.py:65
#: core/models.py:67
#, python-format
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)"
#: core/models.py:81
#: core/models.py:83
msgid "username"
msgstr "nom d'utilisateur"
#: core/models.py:84
#: core/models.py:86
msgid "Required. 254 characters or fewer. Letters, digits and ./+/-/_ only."
msgstr ""
"Requis. Pas plus de 254 caractères. Uniquement des lettres, numéros, et ./"
"+/-/_"
#: core/models.py:88
#: core/models.py:90
msgid ""
"Enter a valid username. This value may contain only letters, numbers and ./"
"+/-/_ characters."
......@@ -1426,43 +1426,43 @@ msgstr ""
"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."
msgstr "Un utilisateur de ce nom existe déjà"
#: core/models.py:96
#: core/models.py:98
msgid "first name"
msgstr "Prénom"
#: core/models.py:97
#: core/models.py:99
msgid "last name"
msgstr "Nom"
#: core/models.py:98
#: core/models.py:100
msgid "email address"
msgstr "adresse email"
#: core/models.py:99
#: core/models.py:101
msgid "date of birth"
msgstr "date de naissance"
#: core/models.py:100
#: core/models.py:102
msgid "nick name"
msgstr "surnom"
#: core/models.py:102
#: core/models.py:104
msgid "staff status"
msgstr "status \"staff\""
#: core/models.py:104
#: core/models.py:106
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."
#: core/models.py:107
#: core/models.py:109
msgid "active"
msgstr "actif"
#: core/models.py:110
#: core/models.py:112
msgid ""
"Designates whether this user should be treated as active. Unselect this "
"instead of deleting accounts."
......@@ -1470,159 +1470,159 @@ msgstr ""
"Est-ce que l'utilisateur doit être traité comme actif. Déselectionnez au "
"lieu de supprimer les comptes."
#: core/models.py:114
#: core/models.py:116
msgid "date joined"
msgstr "date d'inscription"
#: core/models.py:115
#: core/models.py:117
msgid "last update"
msgstr "dernière mise à jour"
#: core/models.py:117
#: core/models.py:119
msgid "superuser"
msgstr "super-utilisateur"
#: core/models.py:120
#: core/models.py:122
msgid "Designates whether this user is a superuser. "
msgstr "Est-ce que l'utilisateur est super-utilisateur."
#: core/models.py:126
#: core/models.py:128
msgid "profile"
msgstr "profil"
#: core/models.py:128
#: core/models.py:130
msgid "avatar"
msgstr "avatar"
#: core/models.py:130
#: core/models.py:132
msgid "scrub"
msgstr "blouse"
#: core/models.py:132
#: core/models.py:134
msgid "sex"
msgstr "sexe"
#: core/models.py:132
#: core/models.py:134
msgid "Man"
msgstr "Homme"
#: core/models.py:132
#: core/models.py:134
msgid "Woman"
msgstr "Femme"
#: core/models.py:133
#: core/models.py:135
msgid "tshirt size"
msgstr "taille de tshirt"
#: core/models.py:134
#: core/models.py:136
msgid "-"
msgstr "-"
#: core/models.py:135
#: core/models.py:137
msgid "XS"
msgstr "XS"
#: core/models.py:136
#: core/models.py:138
msgid "S"
msgstr "S"
#: core/models.py:137
#: core/models.py:139
msgid "M"
msgstr "M"
#: core/models.py:138
#: core/models.py:140
msgid "L"
msgstr "L"
#: core/models.py:139
#: core/models.py:141
msgid "XL"
msgstr "XL"
#: core/models.py:140
#: core/models.py:142
msgid "XXL"
msgstr "XXL"
#: core/models.py:141
#: core/models.py:143
msgid "XXXL"
msgstr "XXXL"
#: core/models.py:144
#: core/models.py:146
msgid "Student"
msgstr "Étudiant"
#: core/models.py:145
#: core/models.py:147
msgid "Administrative agent"
msgstr "Personnel administratif"
#: core/models.py:146
#: core/models.py:148
msgid "Teacher"
msgstr "Enseignant"
#: core/models.py:147
#: core/models.py:149
msgid "Agent"
msgstr "Personnel"
#: core/models.py:148
#: core/models.py:150
msgid "Doctor"
msgstr "Doctorant"
#: core/models.py:149
#: core/models.py:151
msgid "Former student"
msgstr "Ancien étudiant"
#: core/models.py:150
#: core/models.py:152
msgid "Service"
msgstr "Service"
#: core/models.py:152
#: core/models.py:154
msgid "department"
msgstr "département"
#: core/models.py:154
#: core/models.py:156
msgid "dpt option"
msgstr "Filière"
#: core/models.py:155
#: core/models.py:157
msgid "semester"
msgstr "semestre"
#: core/models.py:156
#: core/models.py:158
msgid "quote"
msgstr "citation"
#: core/models.py:157
#: core/models.py:159
msgid "school"
msgstr "école"
#: core/models.py:158
#: core/models.py:160
msgid "promo"
msgstr "promo"
#: core/models.py:159
#: core/models.py:161
msgid "forum signature"
msgstr "signature du forum"
#: core/models.py:160
#: core/models.py:162
msgid "second email address"
msgstr "adresse email secondaire"
#: core/models.py:162
#: core/models.py:164
msgid "parent phone"
msgstr "téléphone des parents"
#: core/models.py:164
#: core/models.py:166
msgid "parent address"
msgstr "adresse des parents"
#: core/models.py:165
#: core/models.py:167
msgid "is subscriber viewable"
msgstr "profil visible par les cotisants"
#: core/models.py:304
#: core/models.py:306
msgid "A user with that username already exists"
msgstr "Un utilisateur de ce nom d'utilisateur existe déjà"
#: core/models.py:429 core/templates/core/macros.jinja:17
#: core/models.py:431 core/templates/core/macros.jinja:17
#: core/templates/core/user_detail.jinja:14
#: core/templates/core/user_detail.jinja:16
#: core/templates/core/user_edit.jinja:17
......@@ -1631,109 +1631,109 @@ msgstr "Un utilisateur de ce nom d'utilisateur existe déjà"
msgid "Profile"
msgstr "Profil"
#: core/models.py:509
#: core/models.py:511
msgid "Visitor"
msgstr "Visiteur"
#: core/models.py:514
#: core/models.py:516
msgid "do you want to receive the weekmail"
msgstr "voulez-vous recevoir le Weekmail"
#: core/models.py:519
#: core/models.py:521
msgid "define if we show a users stats"
msgstr "Definit si l'on montre les statistiques de l'utilisateur"
#: core/models.py:521
#: core/models.py:523
msgid "Show your account statistics to others"
msgstr "Montrez vos statistiques de compte aux autres"
#: core/models.py:540
#: core/models.py:542
msgid "file name"
msgstr "nom du fichier"
#: core/models.py:541 core/models.py:749
#: core/models.py:543 core/models.py:751
msgid "parent"
msgstr "parent"
#: core/models.py:542 core/models.py:558
#: core/models.py:544 core/models.py:560
msgid "file"
msgstr "fichier"
#: core/models.py:543
#: core/models.py:545
msgid "compressed file"
msgstr "version allégée"
#: core/models.py:544
#: core/models.py:546
msgid "thumbnail"
msgstr "miniature"
#: core/models.py:545 core/models.py:553
#: core/models.py:547 core/models.py:555
msgid "owner"
msgstr "propriétaire"
#: core/models.py:546 core/models.py:755 core/views/files.py:121
#: core/models.py:548 core/models.py:757 core/views/files.py:122
msgid "edit group"
msgstr "groupe d'édition"
#: core/models.py:547 core/models.py:756 core/views/files.py:122
#: core/models.py:549 core/models.py:758 core/views/files.py:123
msgid "view group"
msgstr "groupe de vue"
#: core/models.py:548
#: core/models.py:550
msgid "is folder"
msgstr "est un dossier"
#: core/models.py:549
#: core/models.py:551
msgid "mime type"
msgstr "type mime"
#: core/models.py:550
#: core/models.py:552
msgid "size"
msgstr "taille"
#: core/models.py:554
#: core/models.py:556
msgid "asked for removal"
msgstr "retrait demandé"
#: core/models.py:555
#: core/models.py:557
msgid "is in the SAS"
msgstr "est dans le SAS"
#: core/models.py:594
#: core/models.py:596
msgid "Character '/' not authorized in name"
msgstr "Le caractère '/' n'est pas autorisé dans les noms de fichier"
#: core/models.py:597 core/models.py:602
#: core/models.py:599 core/models.py:604
msgid "Loop in folder tree"
msgstr "Boucle dans l'arborescence des dossiers"
#: core/models.py:606
#: core/models.py:608
msgid "You can not make a file be a children of a non folder file"
msgstr ""
"Vous ne pouvez pas mettre un fichier enfant de quelque chose qui n'est pas "
"un dossier"
#: core/models.py:610
#: core/models.py:612
msgid "Duplicate file"
msgstr "Un fichier de ce nom existe déjà"
#: core/models.py:624
#: core/models.py:626
msgid "You must provide a file"
msgstr "Vous devez fournir un fichier"
#: core/models.py:690
#: core/models.py:692
msgid "Folder: "
msgstr "Dossier : "
#: core/models.py:692
#: core/models.py:694
msgid "File: "
msgstr "Fichier : "
#: core/models.py:740
#: core/models.py:742
msgid "page unix name"
msgstr "nom unix de la page"
#: core/models.py:744
#: core/models.py:746
msgid ""
"Enter a valid page name. This value may contain only unaccented letters, "
"numbers and ./+/-/_ characters."
......@@ -1741,51 +1741,51 @@ msgstr ""
"Entrez un nom de page correct. Uniquement des lettres non accentuées, "
"numéros, et ./+/-/_"
#: core/models.py:752
#: core/models.py:754
msgid "page name"
msgstr "nom de la page"
#: core/models.py:753
#: core/models.py:755