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
2dd21893
Commit
2dd21893
authored
Nov 07, 2016
by
Sli
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Download sellings as csv
parent
fa57d6cd
Pipeline
#369
passed with stage
in 3 minutes and 20 seconds
Changes
5
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
95 additions
and
46 deletions
+95
-46
club/templates/club/club_sellings.jinja
club/templates/club/club_sellings.jinja
+1
-0
club/urls.py
club/urls.py
+1
-0
club/views.py
club/views.py
+32
-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
+61
-45
No files found.
club/templates/club/club_sellings.jinja
View file @
2dd21893
...
...
@@ -7,6 +7,7 @@
{%
csrf_token
%}
{{
form
}}
<p><input
type=
"submit"
value=
"
{%
trans
%}
Show
{%
endtrans
%}
"
/></p>
<p><input
type=
"submit"
value=
"
{%
trans
%}
Download as cvs
{%
endtrans
%}
"
formaction=
"
{{
url
(
'club:sellings_csv'
,
club_id
=
object.id
)
}}
"
/></p>
</form>
<p>
{%
trans
%}
Quantity:
{%
endtrans
%}{{
total_quantity
}}
{%
trans
%}
units
{%
endtrans
%}
<br/>
...
...
club/urls.py
View file @
2dd21893
...
...
@@ -10,6 +10,7 @@ urlpatterns = [
url
(
r
'^(?P<club_id>[0-9]+)/members$'
,
ClubMembersView
.
as_view
(),
name
=
'club_members'
),
url
(
r
'^(?P<club_id>[0-9]+)/elderlies$'
,
ClubOldMembersView
.
as_view
(),
name
=
'club_old_members'
),
url
(
r
'^(?P<club_id>[0-9]+)/sellings$'
,
ClubSellingView
.
as_view
(),
name
=
'club_sellings'
),
url
(
r
'^(?P<club_id>[0-9]+)/sellings/csv$'
,
ClubSellingCSVView
.
as_view
(),
name
=
'sellings_csv'
),
url
(
r
'^(?P<club_id>[0-9]+)/prop$'
,
ClubEditPropView
.
as_view
(),
name
=
'club_prop'
),
url
(
r
'^(?P<club_id>[0-9]+)/tools$'
,
ClubToolsView
.
as_view
(),
name
=
'tools'
),
url
(
r
'^membership/(?P<membership_id>[0-9]+)/set_old$'
,
MembershipSetOldView
.
as_view
(),
name
=
'membership_set_old'
),
...
...
club/views.py
View file @
2dd21893
...
...
@@ -4,10 +4,11 @@ from django.views.generic import ListView, DetailView
from
django.views.generic.edit
import
UpdateView
,
CreateView
from
django.forms
import
CheckboxSelectMultiple
from
django.core.exceptions
import
ValidationError
from
django.http
import
HttpResponseRedirect
from
django.http
import
HttpResponseRedirect
,
HttpResponse
from
django.core.urlresolvers
import
reverse
from
django.utils
import
timezone
from
django.utils.translation
import
ugettext_lazy
as
_
from
django.utils.translation
import
ugettext
as
_t
from
django.conf
import
settings
from
ajax_select.fields
import
AutoCompleteSelectField
...
...
@@ -203,6 +204,36 @@ class ClubSellingView(ClubTabsMixin, CanEditMixin, DetailView):
kwargs
[
'form'
]
=
form
return
kwargs
class
ClubSellingCSVView
(
ClubSellingView
):
"""
Generate sellings in csv for a given period
"""
def
get
(
self
,
request
,
*
args
,
**
kwargs
):
import
csv
response
=
HttpResponse
(
content_type
=
'text/csv'
)
self
.
object
=
self
.
get_object
()
name
=
_
(
"Sellings"
)
+
"_"
+
self
.
object
.
name
+
".csv"
response
[
'Content-Disposition'
]
=
'filename='
+
name
kwargs
=
self
.
get_context_data
(
**
kwargs
)
writer
=
csv
.
writer
(
response
,
delimiter
=
";"
,
lineterminator
=
'
\n
'
,
quoting
=
csv
.
QUOTE_ALL
)
writer
.
writerow
([
_t
(
'Date'
),
_t
(
'Counter'
),
_t
(
'Barman'
),
_t
(
'Customer'
),
_t
(
'Label'
),
_t
(
'Quantity'
),
_t
(
'Total'
),
_t
(
'Payment method'
)])
for
o
in
kwargs
[
'result'
]:
row
=
[
o
.
date
,
o
.
counter
]
if
o
.
seller
:
row
.
append
(
o
.
seller
.
get_display_name
())
else
:
row
.
append
(
''
)
if
o
.
customer
:
row
.
append
(
o
.
customer
.
user
.
get_display_name
())
else
:
row
.
append
(
''
)
row
=
row
+
[
o
.
label
,
o
.
quantity
,
o
.
quantity
*
o
.
unit_price
,
o
.
get_payment_method_display
()]
writer
.
writerow
(
row
)
return
response
class
ClubEditView
(
ClubTabsMixin
,
CanEditMixin
,
UpdateView
):
"""
Edit a Club's main informations (for the club's members)
...
...
locale/fr/LC_MESSAGES/django.mo
View file @
2dd21893
No preview for this file type
locale/fr/LC_MESSAGES/django.po
View file @
2dd21893
...
...
@@ -6,7 +6,7 @@
msgid
""
msgstr
""
"Report-Msgid-Bugs-To:
\n
"
"POT-Creation-Date: 2016-11-0
3 16:28
+0100
\n
"
"POT-Creation-Date: 2016-11-0
7 22:00
+0100
\n
"
"PO-Revision-Date: 2016-07-18
\n
"
"Last-Translator: Skia <skia@libskia.so>
\n
"
"Language-Team: AE info <ae.info@utbm.fr>
\n
"
...
...
@@ -123,7 +123,7 @@ msgstr "numéro"
msgid
"journal"
msgstr
"classeur"
#: accounting/models.py:194 core/models.py:498 core/models.py:77
6
#: accounting/models.py:194 core/models.py:498 core/models.py:77
8
#: counter/models.py:237 counter/models.py:280 counter/models.py:397
#: eboutic/models.py:15 eboutic/models.py:48
msgid
"date"
...
...
@@ -277,7 +277,7 @@ msgstr "Liste des types comptable"
#: accounting/templates/accounting/label_list.jinja:9
#: accounting/templates/accounting/operation_edit.jinja:9
#: accounting/templates/accounting/simplifiedaccountingtype_list.jinja:9
#: core/templates/core/user_tools.jinja:4
2
#: core/templates/core/user_tools.jinja:4
3
msgid
"Accounting"
msgstr
"Comptabilité"
...
...
@@ -296,14 +296,14 @@ 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:
49
#: core/templates/core/user_tools.jinja:
50
msgid
"Bank account: "
msgstr
"Compte en banque : "
#: accounting/templates/accounting/bank_account_details.jinja:15
#: accounting/templates/accounting/club_account_details.jinja:16
#: accounting/templates/accounting/label_list.jinja:21
#: club/templates/club/club_sellings.jinja:
48
#: club/templates/club/club_sellings.jinja:
53
#: core/templates/core/file_detail.jinja:43
#: core/templates/core/group_list.jinja:13 core/templates/core/macros.jinja:66
#: core/templates/core/user_account_detail.jinja:38
...
...
@@ -316,7 +316,7 @@ msgid "Delete"
msgstr
"Supprimer"
#: accounting/templates/accounting/bank_account_details.jinja:17
#: club/views.py:3
1
core/views/user.py:130
#: club/views.py:3
2
core/views/user.py:130
msgid
"Infos"
msgstr
"Infos"
...
...
@@ -335,9 +335,9 @@ msgstr "Nouveau compte club"
#: accounting/templates/accounting/bank_account_details.jinja:26
#: accounting/templates/accounting/bank_account_list.jinja:21
#: accounting/templates/accounting/club_account_details.jinja:55
#: accounting/templates/accounting/journal_details.jinja:70 club/views.py:5
3
#: accounting/templates/accounting/journal_details.jinja:70 club/views.py:5
4
#: core/templates/core/file.jinja:38 core/templates/core/page.jinja:31
#: core/templates/core/user_tools.jinja:3
5
core/views/user.py:147
#: core/templates/core/user_tools.jinja:3
6
core/views/user.py:147
#: counter/templates/counter/cash_summary_list.jinja:53
#: counter/templates/counter/counter_list.jinja:17
#: counter/templates/counter/counter_list.jinja:32
...
...
@@ -472,7 +472,7 @@ msgid "Nb"
msgstr
"No"
#: accounting/templates/accounting/journal_details.jinja:29
#: club/templates/club/club_sellings.jinja:
18
#: club/templates/club/club_sellings.jinja:
23
#: core/templates/core/user_account_detail.jinja:17
#: core/templates/core/user_account_detail.jinja:50
#: core/templates/core/user_account_detail.jinja:79
...
...
@@ -483,7 +483,7 @@ msgid "Date"
msgstr
"Date"
#: accounting/templates/accounting/journal_details.jinja:30
#: club/templates/club/club_sellings.jinja:2
2
#: club/templates/club/club_sellings.jinja:2
7
#: core/templates/core/user_account_detail.jinja:20
#: counter/templates/counter/last_ops.jinja:42
msgid
"Label"
...
...
@@ -533,7 +533,8 @@ msgid "Edit operation"
msgstr
"Éditer l'opération"
#: accounting/templates/accounting/operation_edit.jinja:40
#: core/templates/core/create.jinja:12 core/templates/core/edit.jinja:12
#: core/templates/core/create.jinja:12 core/templates/core/edit.jinja:7
#: core/templates/core/edit.jinja.py:15 core/templates/core/edit.jinja:20
#: core/templates/core/file_edit.jinja:8 core/templates/core/page_prop.jinja:8
#: core/templates/core/pagerev_edit.jinja:24
#: core/templates/core/user_godfathers.jinja:35
...
...
@@ -619,6 +620,7 @@ msgid "Club list"
msgstr
"Liste des clubs"
#: club/templates/club/club_list.jinja:21
#: core/templates/core/user_tools.jinja:19
msgid
"New club"
msgstr
"Nouveau club"
...
...
@@ -675,7 +677,7 @@ msgstr "Du"
msgid
"To"
msgstr
"Au"
#: club/templates/club/club_sellings.jinja:5 club/views.py:5
8
#: club/templates/club/club_sellings.jinja:5 club/views.py:5
9
#: counter/templates/counter/counter_main.jinja:19
#: counter/templates/counter/last_ops.jinja:35
msgid
"Sellings"
...
...
@@ -686,29 +688,33 @@ msgstr "Ventes"
msgid
"Show"
msgstr
"Montrer"
#: club/templates/club/club_sellings.jinja:12
#: club/templates/club/club_sellings.jinja:10
msgid
"Download as cvs"
msgstr
"Télécharger en csv"
#: club/templates/club/club_sellings.jinja:13
msgid
"Quantity: "
msgstr
"Quantité : "
#: club/templates/club/club_sellings.jinja:1
2
#: club/templates/club/club_sellings.jinja:1
3
msgid
"units"
msgstr
"unités"
#: club/templates/club/club_sellings.jinja:1
3
#: club/templates/club/club_sellings.jinja:1
4
#: counter/templates/counter/counter_click.jinja:70
#: counter/templates/counter/counter_main.jinja:28
#: eboutic/templates/eboutic/eboutic_main.jinja:34
msgid
"Total: "
msgstr
"Total : "
#: club/templates/club/club_sellings.jinja:
19 club/views.py:165
#: club/templates/club/club_sellings.jinja:
24 club/views.py:166
#: 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:78
msgid
"Counter"
msgstr
"Comptoir"
#: club/templates/club/club_sellings.jinja:2
0
#: club/templates/club/club_sellings.jinja:2
5
#: core/templates/core/user_account_detail.jinja:19
#: core/templates/core/user_account_detail.jinja:52
#: counter/templates/counter/last_ops.jinja:15
...
...
@@ -716,21 +722,21 @@ msgstr "Comptoir"
msgid
"Barman"
msgstr
"Barman"
#: club/templates/club/club_sellings.jinja:2
1
#: club/templates/club/club_sellings.jinja:2
6
#: counter/templates/counter/counter_click.jinja:29
#: counter/templates/counter/last_ops.jinja:16
#: counter/templates/counter/last_ops.jinja:41
msgid
"Customer"
msgstr
"Client"
#: club/templates/club/club_sellings.jinja:2
3
#: club/templates/club/club_sellings.jinja:2
8
#: core/templates/core/user_account_detail.jinja:21
#: core/templates/core/user_stats.jinja:28
#: counter/templates/counter/last_ops.jinja:43
msgid
"Quantity"
msgstr
"Quantité"
#: club/templates/club/club_sellings.jinja:2
4
#: club/templates/club/club_sellings.jinja:2
9
#: core/templates/core/user_account.jinja:10
#: core/templates/core/user_account_detail.jinja:22
#: counter/templates/counter/cash_summary_list.jinja:35
...
...
@@ -739,7 +745,7 @@ msgstr "Quantité"
msgid
"Total"
msgstr
"Total"
#: club/templates/club/club_sellings.jinja:
25
#: club/templates/club/club_sellings.jinja:
30
#: core/templates/core/user_account_detail.jinja:23
#: core/templates/core/user_account_detail.jinja:54
#: counter/templates/counter/last_ops.jinja:18
...
...
@@ -748,7 +754,7 @@ msgid "Payment method"
msgstr
"Méthode de paiement"
#: club/templates/club/club_tools.jinja:4
#: core/templates/core/user_tools.jinja:6
1
#: core/templates/core/user_tools.jinja:6
2
msgid
"Club tools"
msgstr
"Outils club"
...
...
@@ -764,37 +770,37 @@ msgstr "Comptabilité : "
msgid
"Manage launderettes"
msgstr
"Gestion des laveries"
#: club/views.py:3
7
#: club/views.py:3
8
msgid
"Members"
msgstr
"Membres"
#: club/views.py:4
2
#: club/views.py:4
3
msgid
"Old members"
msgstr
"Anciens membres"
#: club/views.py:4
8
core/templates/core/base.jinja:40 core/views/user.py:141
#: club/views.py:4
9
core/templates/core/base.jinja:40 core/views/user.py:141
msgid
"Tools"
msgstr
"Outils"
#: club/views.py:6
4
counter/templates/counter/counter_list.jinja:21
#: club/views.py:6
5
counter/templates/counter/counter_list.jinja:21
#: counter/templates/counter/counter_list.jinja:36
#: counter/templates/counter/counter_list.jinja:51
msgid
"Props"
msgstr
"Propriétés"
#: club/views.py:10
2
core/views/forms.py:204 counter/views.py:39
#: club/views.py:10
3
core/views/forms.py:204 counter/views.py:39
msgid
"Select user"
msgstr
"Choisir un utilisateur"
#: club/views.py:16
3
counter/views.py:909
#: club/views.py:16
4
counter/views.py:909
msgid
"Begin date"
msgstr
"Date de début"
#: club/views.py:16
4
counter/views.py:910
#: club/views.py:16
5
counter/views.py:910
msgid
"End date"
msgstr
"Date de fin"
#: club/views.py:17
8
core/templates/core/user_stats.jinja:27
#: club/views.py:17
9
core/templates/core/user_stats.jinja:27
#: counter/views.py:990
msgid
"Product"
msgstr
"Produit"
...
...
@@ -1171,23 +1177,33 @@ msgstr "nom de la page"
msgid
"owner group"
msgstr
"groupe propriétaire"
#: core/models.py:660
#: core/models.py:633
#, fuzzy
#| msgid "Select user"
msgid
"lock user"
msgstr
"Choisir un utilisateur"
#: core/models.py:634
msgid
"lock_timeout"
msgstr
""
#: core/models.py:661
msgid
"Duplicate page"
msgstr
"Une page de ce nom existe déjà"
#: core/models.py:66
6
#: core/models.py:66
7
msgid
"Loop in page tree"
msgstr
"Boucle dans l'arborescence des pages"
#: core/models.py:77
3
#: core/models.py:77
5
msgid
"revision"
msgstr
"révision"
#: core/models.py:77
4
#: core/models.py:77
6
msgid
"page title"
msgstr
"titre de la page"
#: core/models.py:77
5
#: core/models.py:77
7
msgid
"page content"
msgstr
"contenu de la page"
...
...
@@ -1294,7 +1310,7 @@ msgstr "Confirmation"
msgid
"Cancel"
msgstr
"Annuler"
#: core/templates/core/edit.jinja:
4 core/templates/core/edit.jinja.py:8
#: core/templates/core/edit.jinja:
5 core/templates/core/edit.jinja.py:13
#: core/templates/core/file_edit.jinja:4
#: counter/templates/counter/cash_register_summary.jinja:4
#, python-format
...
...
@@ -1843,44 +1859,44 @@ msgstr "Fusionner deux utilisateurs"
msgid
"Subscriptions"
msgstr
"Cotisations"
#: core/templates/core/user_tools.jinja:2
3
counter/views.py:449
#: core/templates/core/user_tools.jinja:2
4
counter/views.py:449
#: counter/views.py:598
msgid
"Counters"
msgstr
"Comptoirs"
#: core/templates/core/user_tools.jinja:2
6
#: core/templates/core/user_tools.jinja:2
7
msgid
"General management"
msgstr
"Gestion générale"
#: core/templates/core/user_tools.jinja:2
7
#: core/templates/core/user_tools.jinja:2
8
msgid
"General counters management"
msgstr
"Gestion générale des comptoirs"
#: core/templates/core/user_tools.jinja:2
8
#: core/templates/core/user_tools.jinja:2
9
msgid
"Products management"
msgstr
"Gestion des produits"
#: core/templates/core/user_tools.jinja:
29
#: core/templates/core/user_tools.jinja:
30
msgid
"Product types management"
msgstr
"Gestion des types de produit"
#: core/templates/core/user_tools.jinja:3
0
#: core/templates/core/user_tools.jinja:3
1
#: counter/templates/counter/cash_summary_list.jinja:23 counter/views.py:469
msgid
"Cash register summaries"
msgstr
"Relevés de caisse"
#: core/templates/core/user_tools.jinja:3
6
core/views/user.py:169
#: core/templates/core/user_tools.jinja:3
7
core/views/user.py:169
#: 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
5
#: core/templates/core/user_tools.jinja:4
6
msgid
"General accounting"
msgstr
"Comptabilité générale"
#: core/templates/core/user_tools.jinja:5
4
#: core/templates/core/user_tools.jinja:5
5
msgid
"Club account: "
msgstr
"Compte club : "
...
...
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