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
N
Note Kfet 2015 django
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
Operations
Operations
Incidents
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
BDE
Note Kfet 2015 django
Commits
4c7156a4
Commit
4c7156a4
authored
Oct 07, 2014
by
Vincent Le gallic
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bugfix crédit carte bancaire
parent
6587da5f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
2 deletions
+4
-2
note/ajaj.py
note/ajaj.py
+4
-2
No files found.
note/ajaj.py
View file @
4c7156a4
...
...
@@ -172,7 +172,7 @@ def get_photo(request, idbde=None):
@
csrf_exempt
def
do_credit_retrait
(
request
,
action
):
types
=
{
"especes"
:
"Espèces"
,
"cheque"
:
"Chèque"
,
"virement"
:
"Virement bancaire"
}
types
=
{
"especes"
:
"Espèces"
,
"cheque"
:
"Chèque"
,
"virement"
:
"Virement bancaire"
,
"cb"
:
"Carte bancaire"
}
actions_write
=
{
"credit"
:
"crédit"
,
"retrait"
:
"retrait"
}
actions_socket
=
{
"credit"
:
"crediter"
,
"retrait"
:
"retirer"
}
# On appelle la fonction standard
...
...
@@ -183,8 +183,10 @@ def do_credit_retrait(request, action):
form
=
forms
.
CreditRetraitForm
(
request
.
POST
,
label_suffix
=
" :"
)
if
form
.
is_valid
():
data
=
form
.
cleaned_data
if
data
[
"type"
]
!=
"especes"
and
""
in
[
data
[
"nom"
],
data
[
"prenom"
],
data
[
"banque"
]]
:
if
(
data
[
"type"
]
in
[
"cheque"
,
"virement"
]
and
""
in
[
data
[
"nom"
],
data
[
"prenom"
],
data
[
"banque"
]])
:
return
HttpResponse
(
"""Pour un %s par %s, les champs Nom, Prénom et Banque doivent être spécifiés."""
%
(
actions_write
[
action
],
types
[
data
[
"type"
]]))
if
(
data
[
"type"
]
in
[
"cb"
]
and
""
in
[
data
[
"nom"
],
data
[
"prenom"
]]):
return
HttpResponse
(
"""Pour un %s par %s, les champs Nom et Prénom doivent être spécifiés."""
%
(
actions_write
[
action
],
types
[
data
[
"type"
]]))
to_send
=
[
data
[
"idbde"
],
data
[
"montant"
],
data
[
"type"
],
{
"nom"
:
data
[
"nom"
],
"prenom"
:
data
[
"prenom"
],
"banque"
:
data
[
"banque"
],
"commentaire"
:
data
[
"commentaire"
]}]
paquet
=
[
actions_socket
[
action
],
to_send
]
...
...
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