Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Sith
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
59
Issues
59
List
Boards
Labels
Service Desk
Milestones
Merge Requests
9
Merge Requests
9
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
AE
Sith
Commits
7a2985b1
Commit
7a2985b1
authored
Sep 22, 2016
by
Skia
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add product top 10
parent
24d744ee
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
92 additions
and
66 deletions
+92
-66
core/templates/core/user_stats.jinja
core/templates/core/user_stats.jinja
+19
-2
core/views/user.py
core/views/user.py
+4
-1
locale/fr/LC_MESSAGES/django.mo
locale/fr/LC_MESSAGES/django.mo
+0
-0
locale/fr/LC_MESSAGES/django.po
locale/fr/LC_MESSAGES/django.po
+69
-63
No files found.
core/templates/core/user_stats.jinja
View file @
7a2985b1
...
...
@@ -6,20 +6,37 @@
{%
block
content
%}
{%
if
profile.permanencies
%}
<h3>
{%
trans
%}
Permanencies
{%
endtrans
%}
</h3>
<div>
<h3>
{%
trans
%}
Permanencies
{%
endtrans
%}
</h3>
<p>
Total:
{{
total_perm_time
}}
</p>
<p>
Foyer:
{{
total_foyer_time
}}
</p>
<p>
MDE:
{{
total_mde_time
}}
</p>
<p>
La Gommette:
{{
total_gommette_time
}}
</p>
</div>
{%
endif
%}
<h3>
{%
trans
%}
Buyings
{%
endtrans
%}
</h3>
<div>
<h3>
{%
trans
%}
Buyings
{%
endtrans
%}
</h3>
<p>
Foyer:
{{
total_foyer_buyings
}}
€
</p>
<p>
MDE:
{{
total_mde_buyings
}}
€
</p>
<p>
La Gommette:
{{
total_gommette_buyings
}}
€
</p>
</div>
<h3>
{%
trans
%}
Product top 10
{%
endtrans
%}
</h3>
<table>
<thead>
<tr>
<td>
{%
trans
%}
Product
{%
endtrans
%}
</td>
<td>
{%
trans
%}
Quantity
{%
endtrans
%}
</td>
</tr>
</thead>
<tbody>
{%
for
p
in
top_product
%}
<tr>
<td>
{{
p
[
'product__name'
]
}}
</td>
<td>
{{
p
[
'product_sum'
]
}}
</td>
</tr>
{%
endfor
%}
</tbody>
</table>
{%
endblock
%}
core/views/user.py
View file @
7a2985b1
...
...
@@ -222,7 +222,8 @@ class UserStatsView(UserTabsMixin, CanViewMixin, DetailView):
def
get_context_data
(
self
,
**
kwargs
):
kwargs
=
super
(
UserStatsView
,
self
).
get_context_data
(
**
kwargs
)
from
counter.models
import
Counter
from
counter.models
import
Counter
,
Product
,
Selling
from
django.db.models
import
Sum
foyer
=
Counter
.
objects
.
filter
(
name
=
"Foyer"
).
first
()
mde
=
Counter
.
objects
.
filter
(
name
=
"MDE"
).
first
()
gommette
=
Counter
.
objects
.
filter
(
name
=
"La Gommette"
).
first
()
...
...
@@ -237,6 +238,8 @@ class UserStatsView(UserTabsMixin, CanViewMixin, DetailView):
date__gte
=
semester_start
)])
kwargs
[
'total_gommette_buyings'
]
=
sum
([
b
.
unit_price
*
b
.
quantity
for
b
in
self
.
object
.
customer
.
buyings
.
filter
(
counter
=
gommette
,
date__gte
=
semester_start
)])
kwargs
[
'top_product'
]
=
self
.
object
.
customer
.
buyings
.
values
(
'product__name'
).
annotate
(
product_sum
=
Sum
(
'quantity'
)).
exclude
(
product_sum
=
None
).
order_by
(
'-product_sum'
).
all
()[:
10
]
return
kwargs
class
UserMiniView
(
CanViewMixin
,
DetailView
):
...
...
locale/fr/LC_MESSAGES/django.mo
View file @
7a2985b1
No preview for this file type
locale/fr/LC_MESSAGES/django.po
View file @
7a2985b1
...
...
@@ -6,7 +6,7 @@
msgid
""
msgstr
""
"Report-Msgid-Bugs-To:
\n
"
"POT-Creation-Date: 2016-09-2
1 12:42
+0200
\n
"
"POT-Creation-Date: 2016-09-2
2 11:08
+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
"
...
...
@@ -85,12 +85,12 @@ msgstr "Compte club"
msgid
"%(club_account)s on %(bank_account)s"
msgstr
"%(club_account)s sur %(bank_account)s"
#: accounting/models.py:130 club/models.py:146 counter/models.py:33
0
#: accounting/models.py:130 club/models.py:146 counter/models.py:33
1
#: launderette/models.py:122
msgid
"start date"
msgstr
"date de début"
#: accounting/models.py:131 club/models.py:147 counter/models.py:33
1
#: accounting/models.py:131 club/models.py:147 counter/models.py:33
2
msgid
"end date"
msgstr
"date de fin"
...
...
@@ -103,7 +103,7 @@ msgid "club account"
msgstr
"compte club"
#: accounting/models.py:135 accounting/models.py:178 counter/models.py:25
#: counter/models.py:21
8
#: counter/models.py:21
9
msgid
"amount"
msgstr
"montant"
...
...
@@ -124,16 +124,16 @@ msgid "journal"
msgstr
"classeur"
#: accounting/models.py:179 core/models.py:461 core/models.py:739
#: counter/models.py:22
1 counter/models.py:264 counter/models.py:347
#: counter/models.py:22
2 counter/models.py:265 counter/models.py:348
#: eboutic/models.py:15 eboutic/models.py:48
msgid
"date"
msgstr
"date"
#: accounting/models.py:180 counter/models.py:34
8
#: accounting/models.py:180 counter/models.py:34
9
msgid
"comment"
msgstr
"commentaire"
#: accounting/models.py:181 counter/models.py:22
2 counter/models.py:265
#: accounting/models.py:181 counter/models.py:22
3 counter/models.py:266
#: subscription/models.py:57
msgid
"payment method"
msgstr
"méthode de paiement"
...
...
@@ -232,7 +232,7 @@ msgstr "code"
msgid
"An accounting type code contains only numbers"
msgstr
"Un code comptable ne contient que des numéros"
#: accounting/models.py:282 accounting/models.py:308 counter/models.py:25
6
#: accounting/models.py:282 accounting/models.py:308 counter/models.py:25
7
msgid
"label"
msgstr
"intitulé"
...
...
@@ -272,7 +272,7 @@ msgstr "Liste des types comptable"
#: accounting/templates/accounting/journal_details.jinja:9
#: accounting/templates/accounting/operation_edit.jinja:9
#: accounting/templates/accounting/simplifiedaccountingtype_list.jinja:9
#: core/templates/core/user_tools.jinja:4
1
#: core/templates/core/user_tools.jinja:4
2
msgid
"Accounting"
msgstr
"Comptabilité"
...
...
@@ -291,7 +291,7 @@ msgstr "Il n'y a pas de types comptable dans ce site web."
#: accounting/templates/accounting/bank_account_details.jinja:4
#: accounting/templates/accounting/bank_account_details.jinja:13
#: core/templates/core/user_tools.jinja:4
8
#: core/templates/core/user_tools.jinja:4
9
msgid
"Bank account: "
msgstr
"Compte en banque : "
...
...
@@ -327,7 +327,7 @@ msgstr "Nouveau compte club"
#: accounting/templates/accounting/club_account_details.jinja:53
#: accounting/templates/accounting/journal_details.jinja:66 club/views.py:52
#: core/templates/core/file.jinja:38 core/templates/core/page.jinja:31
#: core/templates/core/user_tools.jinja:3
4
core/views/user.py:151
#: core/templates/core/user_tools.jinja:3
5
core/views/user.py:151
#: counter/templates/counter/counter_list.jinja:17
#: counter/templates/counter/counter_list.jinja:32
#: counter/templates/counter/counter_list.jinja:47
...
...
@@ -545,7 +545,7 @@ msgstr "Vous ne pouvez pas faire de boucles dans les clubs"
msgid
"A club with that unix_name already exists"
msgstr
"Un club avec ce nom UNIX existe déjà."
#: club/models.py:144 counter/models.py:32
8 counter/models.py:345
#: club/models.py:144 counter/models.py:32
9 counter/models.py:346
#: eboutic/models.py:14 eboutic/models.py:47 launderette/models.py:89
#: launderette/models.py:126
msgid
"user"
...
...
@@ -675,6 +675,7 @@ msgstr "Intitulé"
#: club/templates/club/club_sellings.jinja:23
#: core/templates/core/user_account_detail.jinja:50
#: core/templates/core/user_stats.jinja:28
msgid
"Quantity"
msgstr
"Quantité"
...
...
@@ -693,7 +694,7 @@ msgid "Payment method"
msgstr
"Méthode de paiement"
#: club/templates/club/club_tools.jinja:4
#: core/templates/core/user_tools.jinja:6
0
#: core/templates/core/user_tools.jinja:6
1
msgid
"Club tools"
msgstr
"Outils club"
...
...
@@ -735,7 +736,7 @@ msgstr "Date de début"
msgid
"End date"
msgstr
"Date de fin"
#: club/views.py:172
#: club/views.py:172
core/templates/core/user_stats.jinja:27
msgid
"Product"
msgstr
"Produit"
...
...
@@ -1019,8 +1020,8 @@ msgid "A user with that username already exists"
msgstr
"Un utilisateur de ce nom d'utilisateur existe déjà"
#: core/models.py:396 core/templates/core/macros.jinja:17
#: core/templates/core/user_detail.jinja:1
5
#: core/templates/core/user_detail.jinja:1
7
#: core/templates/core/user_detail.jinja:1
4
#: core/templates/core/user_detail.jinja:1
6
#: core/templates/core/user_edit.jinja:16
msgid
"Profile"
msgstr
"Profil"
...
...
@@ -1348,12 +1349,12 @@ msgid "Lost password?"
msgstr
"Mot de passe perdu ?"
#: core/templates/core/macros.jinja:27
#: core/templates/core/user_detail.jinja:2
8
#: core/templates/core/user_detail.jinja:2
7
msgid
"Born: "
msgstr
"Né le : "
#: core/templates/core/macros.jinja:31
#: core/templates/core/user_detail.jinja:4
9
#: core/templates/core/user_detail.jinja:4
8
msgid
"Promo: "
msgstr
"Promo : "
...
...
@@ -1623,25 +1624,25 @@ msgstr "Articles"
msgid
"%(user_name)s's profile"
msgstr
"Profil de %(user_name)s"
#: core/templates/core/user_detail.jinja:3
4
#: core/templates/core/user_detail.jinja:3
3
msgid
"Option: "
msgstr
"Filière : "
#: core/templates/core/user_detail.jinja:5
9
#: core/templates/core/user_detail.jinja:5
8
#, python-format
msgid
"Subscribed until %(subscription_end)s"
msgstr
"Cotisant jusqu'au %(subscription_end)s"
#: core/templates/core/user_detail.jinja:6
1
#: core/templates/core/user_detail.jinja:6
0
#: core/templates/core/user_edit.jinja:39
msgid
"Account number: "
msgstr
"Numero de compte : "
#: core/templates/core/user_detail.jinja:6
8
#: core/templates/core/user_detail.jinja:6
7
msgid
"Not subscribed"
msgstr
"Non cotisant"
#: core/templates/core/user_detail.jinja:
70
#: core/templates/core/user_detail.jinja:
69
#: subscription/templates/subscription/subscription.jinja:4
#: subscription/templates/subscription/subscription.jinja:8
msgid
"New subscription"
...
...
@@ -1718,14 +1719,18 @@ msgstr "Liste d'utilisateurs"
msgid
"%(user_name)s's stats"
msgstr
"Stats de %(user_name)s"
#: core/templates/core/user_stats.jinja:
10
#: core/templates/core/user_stats.jinja:
9
msgid
"Permanencies"
msgstr
"Permanences"
#: core/templates/core/user_stats.jinja:1
8
#: core/templates/core/user_stats.jinja:1
7
msgid
"Buyings"
msgstr
"Achats"
#: core/templates/core/user_stats.jinja:23
msgid
"Product top 10"
msgstr
"Top 10 produits"
#: core/templates/core/user_tools.jinja:4
#, python-format
msgid
"%(user_name)s's tools"
...
...
@@ -1743,48 +1748,53 @@ msgstr "Gestion de Sith"
msgid
"Groups"
msgstr
"Groupes"
#: core/templates/core/user_tools.jinja:17
#: core/templates/core/user_tools.jinja:15
#: rootplace/templates/rootplace/merge.jinja:4
msgid
"Merge users"
msgstr
"Fusionner deux utilisateurs"
#: core/templates/core/user_tools.jinja:18
msgid
"Subscriptions"
msgstr
"Cotisations"
#: core/templates/core/user_tools.jinja:2
2
counter/views.py:395
#: core/templates/core/user_tools.jinja:2
3
counter/views.py:395
#: counter/views.py:534
msgid
"Counters"
msgstr
"Comptoirs"
#: core/templates/core/user_tools.jinja:2
5
#: core/templates/core/user_tools.jinja:2
6
msgid
"General management"
msgstr
"Gestion générale"
#: core/templates/core/user_tools.jinja:2
6
#: core/templates/core/user_tools.jinja:2
7
msgid
"General counters management"
msgstr
"Gestion générale des comptoirs"
#: core/templates/core/user_tools.jinja:2
7
#: core/templates/core/user_tools.jinja:2
8
msgid
"Products management"
msgstr
"Gestion des produits"
#: core/templates/core/user_tools.jinja:2
8
#: core/templates/core/user_tools.jinja:2
9
msgid
"Product types management"
msgstr
"Gestion des types de produit"
#: core/templates/core/user_tools.jinja:
29
#: core/templates/core/user_tools.jinja:
30
#: counter/templates/counter/cash_summary_list.jinja:18 counter/views.py:415
msgid
"Cash register summaries"
msgstr
"Relevés de caisse"
#: core/templates/core/user_tools.jinja:3
5
core/views/user.py:145
#: core/templates/core/user_tools.jinja:3
6
core/views/user.py:145
#: counter/templates/counter/counter_list.jinja:18
#: counter/templates/counter/counter_list.jinja:33
#: counter/templates/counter/counter_list.jinja:48
msgid
"Stats"
msgstr
"Stats"
#: core/templates/core/user_tools.jinja:4
4
#: core/templates/core/user_tools.jinja:4
5
msgid
"General accounting"
msgstr
"Comptabilité générale"
#: core/templates/core/user_tools.jinja:5
3
#: core/templates/core/user_tools.jinja:5
4
msgid
"Club account: "
msgstr
"Compte club : "
...
...
@@ -1846,7 +1856,7 @@ msgstr "Fillot"
msgid
"Select user"
msgstr
"Choisir un utilisateur"
#: core/views/user.py:27
2
#: core/views/user.py:27
5
msgid
"User already has a profile picture"
msgstr
"L'utilisateur a déjà une photo de profil"
...
...
@@ -1939,73 +1949,77 @@ msgstr "Eboutic"
msgid
"sellers"
msgstr
"vendeurs"
#: counter/models.py:131 counter/models.py:329 counter/models.py:346
#: counter/models.py:129 launderette/models.py:125
msgid
"token"
msgstr
"jeton"
#: counter/models.py:132 counter/models.py:330 counter/models.py:347
#: launderette/models.py:16
msgid
"counter"
msgstr
"comptoir"
#: counter/models.py:22
4
#: counter/models.py:22
5
msgid
"bank"
msgstr
"banque"
#: counter/models.py:22
6 counter/models.py:267
#: counter/models.py:22
7 counter/models.py:268
msgid
"is validated"
msgstr
"est validé"
#: counter/models.py:2
29
#: counter/models.py:2
30
msgid
"refilling"
msgstr
"rechargement"
#: counter/models.py:26
0
eboutic/models.py:103
#: counter/models.py:26
1
eboutic/models.py:103
msgid
"unit price"
msgstr
"prix unitaire"
#: counter/models.py:26
1 counter/models.py:379
eboutic/models.py:104
#: counter/models.py:26
2 counter/models.py:380
eboutic/models.py:104
msgid
"quantity"
msgstr
"quantité"
#: counter/models.py:26
6
#: counter/models.py:26
7
msgid
"Sith account"
msgstr
"Compte utilisateur"
#: counter/models.py:26
6
sith/settings.py:271 sith/settings.py:276
#: counter/models.py:26
7
sith/settings.py:271 sith/settings.py:276
#: sith/settings.py:298
msgid
"Credit card"
msgstr
"Carte bancaire"
#: counter/models.py:27
0
#: counter/models.py:27
1
msgid
"selling"
msgstr
"vente"
#: counter/models.py:33
2
#: counter/models.py:33
3
msgid
"last activity date"
msgstr
"dernière activité"
#: counter/models.py:33
5
#: counter/models.py:33
6
msgid
"permanency"
msgstr
"permanence"
#: counter/models.py:3
49
#: counter/models.py:3
50
msgid
"emptied"
msgstr
"coffre vidée"
#: counter/models.py:35
2
#: counter/models.py:35
3
msgid
"cash register summary"
msgstr
"relevé de caisse"
#: counter/models.py:37
7
#: counter/models.py:37
8
msgid
"cash summary"
msgstr
"relevé"
#: counter/models.py:37
8
#: counter/models.py:37
9
msgid
"value"
msgstr
"valeur"
#: counter/models.py:38
0
#: counter/models.py:38
1
msgid
"check"
msgstr
"chèque"
#: counter/models.py:38
3
#: counter/models.py:38
4
msgid
"cash register summary item"
msgstr
"élément de relevé de caisse"
...
...
@@ -2384,10 +2398,6 @@ msgstr "Le nom du jeton ne peut pas être vide"
msgid
"machine"
msgstr
"machine"
#: launderette/models.py:125
msgid
"token"
msgstr
"jeton"
#: launderette/templates/launderette/launderette_admin.jinja:4
msgid
"Launderette admin"
msgstr
"Gestion de la laverie"
...
...
@@ -2474,10 +2484,6 @@ msgstr "L'utilisateur n'a pas réservé de créneau"
msgid
"Token not found"
msgstr
"Jeton non trouvé"
#: rootplace/templates/rootplace/merge.jinja:4
msgid
"Merge users"
msgstr
"Fusionner deux utilisateurs"
#: rootplace/templates/rootplace/merge.jinja:8
msgid
"Merge two users"
msgstr
"Fusionner deux utilisateurs"
...
...
@@ -2486,11 +2492,11 @@ msgstr "Fusionner deux utilisateurs"
msgid
"Merge"
msgstr
"Fusion"
#: rootplace/views.py:6
3
#: rootplace/views.py:6
6
msgid
"User that will be kept"
msgstr
"Utilisateur qui sera conservé"
#: rootplace/views.py:6
4
#: rootplace/views.py:6
7
msgid
"User that will be deleted"
msgstr
"Utilisateur qui sera supprimé"
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment