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
A
amap
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
groupe-amap
amap
Commits
23c493ec
Commit
23c493ec
authored
Nov 24, 2016
by
Gabriel Detraz
Committed by
Admin Y Strator
Nov 24, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bug fix
parent
2ca28c7b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
6 deletions
+6
-6
panier/views.py
panier/views.py
+6
-6
No files found.
panier/views.py
View file @
23c493ec
...
...
@@ -473,12 +473,12 @@ def index(request):
user_ens
=
len
(
User
.
objects
.
filter
(
state
=
0
).
filter
(
is_ens
=
True
))
solde_moyen
=
round
(
solde_total
/
user_total
,
2
)
commandes_total
=
len
(
Commande
.
objects
.
all
())
try
:
next_livraison
=
Livraison
.
objects
.
order_by
(
'date'
).
filter
(
date__gt
=
timezone
.
now
())[
0
]
except
IndexError
:
next_livraison
=
None
next_livraison_commandes
=
len
(
Commande
.
objects
.
filter
(
date
=
Livraison
.
objects
.
filter
(
date
=
next_livraison
.
date
))
)
next_livraison_paniers
=
sum
(
pan
.
coefficient_panier
*
pan
.
quantite
for
pan
in
Commande
.
objects
.
filter
(
date
=
Livraison
.
objects
.
filter
(
date
=
next_livraison
.
date
)))
next_livraison
=
Livraison
.
objects
.
order_by
(
'date'
).
filter
(
date__gt
=
timezone
.
now
()).
first
()
next_livraison_commandes
=
0
next_livraison_paniers
=
0
if
next_livraison
:
next_livraison_commandes
=
Commande
.
objects
.
filter
(
date
=
Livraison
.
objects
.
filter
(
date
=
next_livraison
.
date
)).
count
(
)
next_livraison_paniers
=
sum
(
pan
.
coefficient_panier
*
pan
.
quantite
for
pan
in
Commande
.
objects
.
filter
(
date
=
Livraison
.
objects
.
filter
(
date
=
next_livraison
.
date
)))
return
render
(
request
,
'panier/index.html'
,
{
'paniers_list'
:
paniers_list
,
'management_view'
:
management_view
,
'credit_list'
:
credit_list
,
'solde_total'
:
solde_total
,
'user_total'
:
user_total
,
'user_ens'
:
user_ens
,
'solde_moyen'
:
solde_moyen
,
'commandes_total'
:
commandes_total
,
'next_livraison'
:
next_livraison
,
'next_livraison_commandes'
:
next_livraison_commandes
,
'next_livraison_paniers'
:
next_livraison_paniers
})
@
login_required
...
...
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