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
51f342a7
Commit
51f342a7
authored
Sep 29, 2016
by
Skia
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add invoices calls
parent
ddceb82a
Pipeline
#264
failed with stage
in 13 seconds
Changes
6
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
109 additions
and
28 deletions
+109
-28
club/templates/club/club_sellings.jinja
club/templates/club/club_sellings.jinja
+8
-0
counter/templates/counter/invoices_call.jinja
counter/templates/counter/invoices_call.jinja
+34
-0
counter/urls.py
counter/urls.py
+1
-0
counter/views.py
counter/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
+34
-27
No files found.
club/templates/club/club_sellings.jinja
View file @
51f342a7
...
...
@@ -30,8 +30,16 @@
<tr>
<td>
{{
s.date
|
localtime
|
date
(
DATETIME_FORMAT
)
}}
{{
s.date
|
localtime
|
time
(
DATETIME_FORMAT
)
}}
</td>
<td>
{{
s.counter
}}
</td>
{%
if
s.seller
%}
<td><a
href=
"
{{
s.seller.get_absolute_url
()
}}
"
>
{{
s.seller.get_display_name
()
}}
</a></td>
{%
else
%}
<td></td>
{%
endif
%}
{%
if
s.customer
%}
<td><a
href=
"
{{
s.customer.user.get_absolute_url
()
}}
"
>
{{
s.customer.user.get_display_name
()
}}
</a></td>
{%
else
%}
<td></td>
{%
endif
%}
<td>
{{
s.label
}}
</td>
<td>
{{
s.quantity
}}
</td>
<td>
{{
s.quantity
*
s.unit_price
}}
€
</td>
...
...
counter/templates/counter/invoices_call.jinja
0 → 100644
View file @
51f342a7
{%
extends
"core/base.jinja"
%}
{%
block
title
%}
{%
trans
%}
Invoices call
{%
endtrans
%}
{%
endblock
%}
{%
block
content
%}
<h3>
{%
trans
%}
Invoices call
{%
endtrans
%}
</h3>
<form
method=
"get"
action=
""
>
<select
name=
"month"
>
{%
for
m
in
months
%}
<option
value=
"
{{
m
|
date
(
"Y-m"
)
}}
"
>
{{
m
|
date
(
"Y-m"
)
}}
</option>
{%
endfor
%}
</select>
<input
type=
"submit"
value=
"
{%
trans
%}
Go
{%
endtrans
%}
"
/>
</form>
<table>
<thead>
<td>
{%
trans
%}
Club
{%
endtrans
%}
</td>
<td>
{%
trans
%}
Sum
{%
endtrans
%}
</td>
</thead>
<tbody>
{%
for
i
in
sums
%}
<tr>
<td>
{{
i
[
'club__name'
]
}}
</td>
<td>
{{
i
[
'selling_sum'
]
}}
€
</td>
</tr>
{%
endfor
%}
</tbody>
</table>
{%
endblock
%}
counter/urls.py
View file @
51f342a7
...
...
@@ -16,6 +16,7 @@ urlpatterns = [
url
(
r
'^admin$'
,
CounterListView
.
as_view
(),
name
=
'admin_list'
),
url
(
r
'^admin/new$'
,
CounterCreateView
.
as_view
(),
name
=
'new'
),
url
(
r
'^admin/delete/(?P<counter_id>[0-9]+)$'
,
CounterDeleteView
.
as_view
(),
name
=
'delete'
),
url
(
r
'^admin/invoices_call$'
,
InvoiceCallView
.
as_view
(),
name
=
'invoices_call'
),
url
(
r
'^admin/cash_summary/list$'
,
CashSummaryListView
.
as_view
(),
name
=
'cash_summary_list'
),
url
(
r
'^admin/cash_summary/(?P<cashsummary_id>[0-9]+)$'
,
CashSummaryEditView
.
as_view
(),
name
=
'cash_summary_edit'
),
url
(
r
'^admin/product/list$'
,
ProductListView
.
as_view
(),
name
=
'product_list'
),
...
...
counter/views.py
View file @
51f342a7
from
django.shortcuts
import
render
from
django.core.exceptions
import
PermissionDenied
from
django.views.generic
import
ListView
,
DetailView
,
RedirectView
from
django.views.generic
import
ListView
,
DetailView
,
RedirectView
,
TemplateView
from
django.views.generic.edit
import
UpdateView
,
CreateView
,
DeleteView
,
ProcessFormView
,
FormMixin
from
django.forms.models
import
modelform_factory
from
django.forms
import
CheckboxSelectMultiple
...
...
@@ -459,6 +459,11 @@ class CounterAdminTabsMixin(TabedViewMixin):
'slug'
:
'cash_summary'
,
'name'
:
_
(
"Cash register summaries"
),
},
{
'url'
:
reverse_lazy
(
'counter:invoices_call'
),
'slug'
:
'invoices_call'
,
'name'
:
_
(
"Invoices call"
),
},
]
class
CounterListView
(
CounterAdminTabsMixin
,
CanViewMixin
,
ListView
):
...
...
@@ -908,3 +913,29 @@ class CashSummaryListView(CanEditPropMixin, CounterAdminTabsMixin, ListView):
kwargs
[
'refilling_sums'
][
c
.
name
]
=
sum
([
s
.
amount
for
s
in
Refilling
.
objects
.
filter
(
counter
=
c
,
date__gt
=
last_date
).
all
()])
return
kwargs
class
InvoiceCallView
(
CounterAdminTabsMixin
,
TemplateView
):
template_name
=
'counter/invoices_call.jinja'
current_tab
=
'invoices_call'
def
get_context_data
(
self
,
**
kwargs
):
""" Add sums to the context """
kwargs
=
super
(
InvoiceCallView
,
self
).
get_context_data
(
**
kwargs
)
kwargs
[
'months'
]
=
Selling
.
objects
.
datetimes
(
'date'
,
'month'
,
order
=
'DESC'
)
start_date
=
None
end_date
=
None
try
:
start_date
=
datetime
.
strptime
(
self
.
request
.
GET
[
'month'
],
'%Y-%m'
)
except
:
start_date
=
datetime
(
year
=
timezone
.
now
().
year
,
month
=
(
timezone
.
now
().
month
+
10
)
%
12
+
1
,
day
=
1
)
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
kwargs
[
'sums'
]
=
Selling
.
objects
.
values
(
'club__name'
).
annotate
(
selling_sum
=
Sum
(
Case
(
When
(
date__gte
=
start_date
,
date__lt
=
end_date
,
then
=
F
(
'unit_price'
)
*
F
(
'quantity'
)),
output_field
=
CurrencyField
()
)
)).
exclude
(
selling_sum
=
None
).
order_by
(
'-selling_sum'
)
return
kwargs
#).exclude(selling_sum=None).order_by('-selling_sum').all()[:100]
locale/fr/LC_MESSAGES/django.mo
View file @
51f342a7
No preview for this file type
locale/fr/LC_MESSAGES/django.po
View file @
51f342a7
...
...
@@ -6,7 +6,7 @@
msgid
""
msgstr
""
"Report-Msgid-Bugs-To:
\n
"
"POT-Creation-Date: 2016-09-29 1
6:18
+0200
\n
"
"POT-Creation-Date: 2016-09-29 1
8:19
+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
"
...
...
@@ -171,6 +171,7 @@ msgid "User"
msgstr
"Utilisateur"
#: accounting/models.py:190 club/templates/club/club_detail.jinja:5
#: counter/templates/counter/invoices_call.jinja:19
msgid
"Club"
msgstr
"Club"
...
...
@@ -297,7 +298,7 @@ msgstr "Compte en banque : "
#: accounting/templates/accounting/bank_account_details.jinja:15
#: accounting/templates/accounting/club_account_details.jinja:16
#: club/templates/club/club_sellings.jinja:4
0
#: club/templates/club/club_sellings.jinja:4
8
#: core/templates/core/file_detail.jinja:43
#: core/templates/core/group_list.jinja:13 core/templates/core/macros.jinja:61
#: core/templates/core/user_account_detail.jinja:67
...
...
@@ -484,7 +485,7 @@ msgid "Done"
msgstr
"Effectué"
#: accounting/templates/accounting/journal_details.jinja:34
#: counter/templates/counter/cash_summary_list.jinja:32 counter/views.py:69
2
#: counter/templates/counter/cash_summary_list.jinja:32 counter/views.py:69
7
msgid
"Comment"
msgstr
"Commentaire"
...
...
@@ -1725,20 +1726,16 @@ msgid "Godfathers"
msgstr
"Parrains"
#: core/templates/core/user_godfathers.jinja:18
#, fuzzy
#| msgid "Godfathers"
msgid
"No godfathers"
msgstr
"Parrains"
msgstr
"Pa
s de pa
rrains"
#: core/templates/core/user_godfathers.jinja:21
msgid
"Godchildren"
msgstr
"Fillots"
#: core/templates/core/user_godfathers.jinja:29
#, fuzzy
#| msgid "Godchildren"
msgid
"No godchildren"
msgstr
"
F
illots"
msgstr
"
Pas de f
illots"
#: core/templates/core/user_group.jinja:4
#, python-format
...
...
@@ -1793,7 +1790,7 @@ msgid "Subscriptions"
msgstr
"Cotisations"
#: core/templates/core/user_tools.jinja:23 counter/views.py:440
#: counter/views.py:5
79
#: counter/views.py:5
84
msgid
"Counters"
msgstr
"Comptoirs"
...
...
@@ -2077,7 +2074,7 @@ msgstr "Liste des relevés de caisse"
msgid
"Theoric sums"
msgstr
"Sommes théoriques"
#: counter/templates/counter/cash_summary_list.jinja:31 counter/views.py:69
3
#: counter/templates/counter/cash_summary_list.jinja:31 counter/views.py:69
8
msgid
"Emptied"
msgstr
"Coffre vidé"
...
...
@@ -2108,6 +2105,7 @@ msgstr "Pas de date de naissance renseigné"
#: counter/templates/counter/counter_click.jinja:52
#: counter/templates/counter/counter_click.jinja:86
#: counter/templates/counter/invoices_call.jinja:15
#: launderette/templates/launderette/launderette_admin.jinja:35
#: launderette/templates/launderette/launderette_click.jinja:13
msgid
"Go"
...
...
@@ -2183,6 +2181,15 @@ msgstr "Merci de vous identifier"
msgid
"Barman: "
msgstr
"Barman : "
#: counter/templates/counter/invoices_call.jinja:4
#: counter/templates/counter/invoices_call.jinja:8 counter/views.py:465
msgid
"Invoices call"
msgstr
"Appels à facture"
#: counter/templates/counter/invoices_call.jinja:20
msgid
"Sum"
msgstr
"Somme"
#: counter/templates/counter/last_ops.jinja:5
#: counter/templates/counter/last_ops.jinja:9
#, python-format
...
...
@@ -2290,61 +2297,61 @@ msgstr "Produits archivés"
msgid
"Product types"
msgstr
"Types de produit"
#: counter/views.py:5
76
#: counter/views.py:5
81
msgid
"Parent product"
msgstr
"Produit parent"
#: counter/views.py:5
77
#: counter/views.py:5
82
msgid
"Buying groups"
msgstr
"Groupes d'achat"
#: counter/views.py:67
2
#: counter/views.py:67
7
msgid
"10 cents"
msgstr
"10 centimes"
#: counter/views.py:67
3
#: counter/views.py:67
8
msgid
"20 cents"
msgstr
"20 centimes"
#: counter/views.py:67
4
#: counter/views.py:67
9
msgid
"50 cents"
msgstr
"50 centimes"
#: counter/views.py:6
75
#: counter/views.py:6
80
msgid
"1 euro"
msgstr
"1 €"
#: counter/views.py:6
76
#: counter/views.py:6
81
msgid
"2 euros"
msgstr
"2 €"
#: counter/views.py:6
77
#: counter/views.py:6
82
msgid
"5 euros"
msgstr
"5 €"
#: counter/views.py:6
78
#: counter/views.py:6
83
msgid
"10 euros"
msgstr
"10 €"
#: counter/views.py:6
79
#: counter/views.py:6
84
msgid
"20 euros"
msgstr
"20 €"
#: counter/views.py:68
0
#: counter/views.py:68
5
msgid
"50 euros"
msgstr
"50 €"
#: counter/views.py:68
1
#: counter/views.py:68
6
msgid
"100 euros"
msgstr
"100 €"
#: counter/views.py:68
2 counter/views.py:684 counter/views.py:686
#: counter/views.py:6
88 counter/views.py:690
#: counter/views.py:68
7 counter/views.py:689 counter/views.py:691
#: counter/views.py:6
93 counter/views.py:695
msgid
"Check amount"
msgstr
"Montant du chèque"
#: counter/views.py:68
3 counter/views.py:685 counter/views.py:687
#: counter/views.py:6
89 counter/views.py:691
#: counter/views.py:68
8 counter/views.py:690 counter/views.py:692
#: counter/views.py:6
94 counter/views.py:696
msgid
"Check quantity"
msgstr
"Nombre de chèque"
...
...
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