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
328c030c
Commit
328c030c
authored
Jul 03, 2018
by
Hugo LEVY-FALK
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Supprime la vue 'recharge' qui faisait doublon avec 'credit_solde'
parent
ebe5633f
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
19 additions
and
47 deletions
+19
-47
cotisations/templates/cotisations/facture.html
cotisations/templates/cotisations/facture.html
+6
-1
cotisations/urls.py
cotisations/urls.py
+0
-5
cotisations/views.py
cotisations/views.py
+11
-39
users/templates/users/profil.html
users/templates/users/profil.html
+2
-2
No files found.
cotisations/templates/cotisations/facture.html
View file @
328c030c
...
...
@@ -31,7 +31,12 @@ with this program; if not, write to the Free Software Foundation, Inc.,
{% block content %}
{% bootstrap_form_errors factureform %}
{% if title %}
<h3>
{{title}}
</h3>
{% endif %}
{% if balance %}
<h4>
{% trans "Current balance :" %}{{balance}}€
</h4>
{% endif %}
<form
class=
"form"
method=
"post"
>
{% csrf_token %}
{% if articlesformset %}
...
...
cotisations/urls.py
View file @
328c030c
...
...
@@ -138,11 +138,6 @@ urlpatterns = [
views
.
new_facture_solde
,
name
=
'new_facture_solde'
),
url
(
r
'^recharge/$'
,
views
.
recharge
,
name
=
'recharge'
),
url
(
r
'^$'
,
views
.
index
,
name
=
'index'
),
]
+
payment_methods
.
urls
.
urlpatterns
cotisations/views.py
View file @
328c030c
...
...
@@ -326,39 +326,6 @@ def del_facture(request, facture, **_kwargs):
},
'cotisations/delete.html'
,
request
)
# TODO : change solde to balance
@
login_required
@
can_create
(
Facture
)
@
can_edit
(
User
)
def
credit_solde
(
request
,
user
,
**
_kwargs
):
"""
View used to edit the balance of a user.
Can be use either to increase or decrease a user's balance.
"""
# TODO : change facture to invoice
invoice
=
CreditSoldeForm
(
request
.
POST
or
None
)
if
invoice
.
is_valid
():
invoice_instance
=
invoice
.
save
(
commit
=
False
)
invoice_instance
.
user
=
user
invoice_instance
.
save
()
new_purchase
=
Vente
.
objects
.
create
(
facture
=
invoice_instance
,
name
=
"solde"
,
prix
=
invoice
.
cleaned_data
[
'montant'
],
number
=
1
)
new_purchase
.
save
()
messages
.
success
(
request
,
_
(
"Balance successfully updated."
)
)
return
redirect
(
reverse
(
'cotisations:index'
))
return
form
({
'factureform'
:
invoice
,
'action_name'
:
_
(
"Edit"
)
},
'cotisations/facture.html'
,
request
)
@
login_required
@
can_create
(
Article
)
def
add_article
(
request
):
...
...
@@ -815,11 +782,14 @@ def new_facture_solde(request, userid):
},
'cotisations/new_facture_solde.html'
,
request
)
# TODO : change
recharge to refill
# TODO : change
solde to balance
@
login_required
def
recharge
(
request
):
@
can_create
(
Facture
)
@
can_edit
(
User
)
def
credit_solde
(
request
,
user
,
**
_kwargs
):
"""
View used to refill the balance by using online payment.
View used to edit the balance of a user.
Can be use either to increase or decrease a user's balance.
"""
refill_form
=
RechargeForm
(
request
.
POST
or
None
,
user
=
request
.
user
)
if
refill_form
.
is_valid
():
...
...
@@ -835,6 +805,8 @@ def recharge(request):
)
return
invoice
.
paiement
.
end_payment
(
invoice
,
request
)
return
form
({
'rechargeform'
:
refill_form
,
'solde'
:
request
.
user
.
solde
},
'cotisations/recharge.html'
,
request
)
'factureform'
:
refill_form
,
'balance'
:
request
.
user
.
solde
,
'title'
:
_
(
"Refill your balance"
),
'action_name'
:
_
(
"Pay"
)
},
'cotisations/facture.html'
,
request
)
users/templates/users/profil.html
View file @
328c030c
...
...
@@ -34,7 +34,7 @@ non adhérent</span>{% endif %} et votre connexion est {% if users.has_access %}
<span
class=
"label label-success"
>
active
</span>
{% else %}
<span
class=
"label label-danger"
>
désactivée
</span>
{% endif %}.
</p>
{% if user_solde %}
<p>
Votre solde est de
<span
class=
"badge"
>
{{ users.solde }}€
</span>
.
<a
class=
"btn btn-primary btn-sm"
role=
"button"
href=
"{% url 'cotisations:
recharge'
%}"
>
<a
class=
"btn btn-primary btn-sm"
role=
"button"
href=
"{% url 'cotisations:
credit-solde' users.pk
%}"
>
<i
class=
"fa fa-euro-sign"
></i>
Recharger
</a>
...
...
@@ -165,7 +165,7 @@ non adhérent</span>{% endif %} et votre connexion est {% if users.has_access %}
<th>
Solde
</th>
<td>
{{ users.solde }} €
{% if user_solde %}
<a
class=
"btn btn-primary btn-sm"
style=
'float:right'
role=
"button"
href=
"{% url 'cotisations:
recharge'
%}"
>
<a
class=
"btn btn-primary btn-sm"
style=
'float:right'
role=
"button"
href=
"{% url 'cotisations:
credit-solde' users.pk
%}"
>
<i
class=
"fa fa-euro-sign"
></i>
Recharger
</a>
...
...
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