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
R
re2o
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
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Nounous
re2o
Commits
d0e0da86
Commit
d0e0da86
authored
Jun 17, 2018
by
Hugo LEVY-FALK
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix la validation de facture.
parent
beff1bbd
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
15 deletions
+18
-15
cotisations/payment.py
cotisations/payment.py
+16
-13
cotisations/views.py
cotisations/views.py
+2
-2
No files found.
cotisations/payment.py
View file @
d0e0da86
...
...
@@ -26,23 +26,26 @@ def accept_payment(request, factureid):
The view called when an online payment has been accepted.
"""
invoice
=
get_object_or_404
(
Facture
,
id
=
factureid
)
messages
.
success
(
request
,
_
(
"The payment of %(amount)s € has been accepted."
)
%
{
'amount'
:
invoice
.
prix_total
()
}
)
# In case a cotisation was bought, inform the user, the
# cotisation time has been extended too
if
any
(
purchase
.
type_cotisation
for
purchase
in
invoice
.
vente_set
.
all
()):
if
invoice
.
valid
:
messages
.
success
(
request
,
_
(
"The cotisation of %(member_name)s has been
\
extended to %(end_date)s."
)
%
{
'member_name'
:
request
.
user
.
pseudo
,
'end_date'
:
request
.
user
.
end_adhesion
()
_
(
"The payment of %(amount)s € has been accepted."
)
%
{
'amount'
:
invoice
.
prix_total
()
}
)
# In case a cotisation was bought, inform the user, the
# cotisation time has been extended too
if
any
(
purchase
.
type_cotisation
for
purchase
in
invoice
.
vente_set
.
all
()):
messages
.
success
(
request
,
_
(
"The cotisation of %(member_name)s has been
\
extended to %(end_date)s."
)
%
{
'member_name'
:
request
.
user
.
pseudo
,
'end_date'
:
request
.
user
.
end_adhesion
()
}
)
else
:
invoice
.
delete
()
return
redirect
(
reverse
(
'users:profil'
,
kwargs
=
{
'userid'
:
request
.
user
.
id
}
...
...
cotisations/views.py
View file @
d0e0da86
...
...
@@ -162,7 +162,7 @@ def new_facture(request, user, userid):
is_online_payment
=
new_invoice_instance
.
paiement
==
(
Paiement
.
objects
.
get_or_create
(
moyen
=
'Rechargement en ligne'
)[
0
])
new_invoice_instance
.
valid
=
is_online_payment
new_invoice_instance
.
valid
=
not
is_online_payment
# Saving the invoice
new_invoice_instance
.
save
()
...
...
@@ -185,7 +185,7 @@ def new_facture(request, user, userid):
if
is_online_payment
:
content
=
online_payment
.
PAYMENT_SYSTEM
[
AssoOption
.
get_cached_value
(
'payment'
)
](
invoi
ce
,
request
)
](
new_invoice_instan
ce
,
request
)
return
render
(
request
,
'cotisations/payment.html'
,
content
)
# In case a cotisation was bought, inform the user, the
...
...
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