Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
AE
Sith
Commits
a12f9dd5
Commit
a12f9dd5
authored
Oct 03, 2016
by
Skia
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix club sellings
parent
2ef5a4d3
Pipeline
#269
failed with stage
in 19 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
1 deletion
+2
-1
club/templates/club/club_sellings.jinja
club/templates/club/club_sellings.jinja
+1
-1
club/views.py
club/views.py
+1
-0
No files found.
club/templates/club/club_sellings.jinja
View file @
a12f9dd5
...
...
@@ -9,7 +9,7 @@
<p><input
type=
"submit"
value=
"
{%
trans
%}
Show
{%
endtrans
%}
"
/></p>
</form>
<p>
{%
trans
%}
Quantity:
{%
endtrans
%}{{
result.count
()
}}
{%
trans
%}
units
{%
endtrans
%}
<br/>
{%
trans
%}
Quantity:
{%
endtrans
%}{{
total_quantity
}}
{%
trans
%}
units
{%
endtrans
%}
<br/>
{%
trans
%}
Total:
{%
endtrans
%}{{
total
}}
€
</p>
<table>
...
...
club/views.py
View file @
a12f9dd5
...
...
@@ -196,6 +196,7 @@ class ClubSellingView(ClubTabsMixin, CanEditMixin, DetailView):
qs
=
qs
.
filter
(
product__id
=
form
.
cleaned_data
[
'product'
].
id
)
kwargs
[
'result'
]
=
qs
.
all
().
order_by
(
'-id'
)
kwargs
[
'total'
]
=
sum
([
s
.
quantity
*
s
.
unit_price
for
s
in
qs
.
all
()])
kwargs
[
'total_quantity'
]
=
sum
([
s
.
quantity
for
s
in
qs
.
all
()])
else
:
kwargs
[
'result'
]
=
qs
[:
0
]
kwargs
[
'form'
]
=
form
...
...
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