Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
T
third-party
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
2
Merge Requests
2
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
cooperatic-foodcoops
third-party
Commits
4950aec7
Commit
4950aec7
authored
Apr 14, 2022
by
Damien Moulard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ES: afficher la date d'encaissement des enveloppes
parent
1e561340
Pipeline
#2111
passed with stage
in 1 minute 28 seconds
Changes
3
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
3 deletions
+14
-3
models.py
envelops/models.py
+1
-0
envelops.js
envelops/static/js/envelops.js
+12
-2
views.py
envelops/views.py
+1
-1
No files found.
envelops/models.py
View file @
4950aec7
...
...
@@ -132,6 +132,7 @@ class CagetteEnvelops(models.Model):
def
archive_envelop
(
self
,
envelop
):
envelop
[
'archive'
]
=
True
envelop
[
'cashing_date'
]
=
datetime
.
date
.
today
()
.
strftime
(
"
%
d/
%
m/
%
Y"
)
return
self
.
c_db
.
dbc
.
update
([
envelop
])
def
generate_envelop_display_id
(
self
):
...
...
envelops/static/js/envelops.js
View file @
4950aec7
...
...
@@ -96,8 +96,18 @@ function set_envelop_dom(envelop, envelop_name, envelop_content_id, envelop_inde
if
((
envelop
.
type
==
'cash'
||
envelop
.
type
==
'ch'
&&
envelop_index
==
0
)
&&
!
envelop
.
archive
)
{
new_html
+=
'<button class="accordion w80">'
+
envelop_name
+
' - <i>'
+
total_amount
+
'€</i></button>'
+
'<button class="btn--success archive_button item-fluid" onClick="openModal(
\'
<h3>Êtes-vous sûr ?</h3>
\'
, function() {archive_envelop(
\'
'
+
envelop
.
type
+
'
\'
, '
+
envelop_index
+
');},
\'
Encaisser
\'
, false)">Encaisser</button>'
;
}
else
if
(
envelop
.
archive
&&
envelop
.
canceled
)
{
new_html
+=
'<button class="accordion w100">'
+
envelop_name
+
' - <i>'
+
total_amount
+
'€ (Enveloppe supprimée) </i></button>'
;
}
else
if
(
envelop
.
archive
===
true
)
{
new_html
+=
'<button class="accordion w100">'
+
envelop_name
+
' - <i>'
+
total_amount
+
'€'
;
if
(
envelop
.
cashing_date
!==
undefined
)
{
new_html
+=
' - Encaissée le '
+
envelop
.
cashing_date
;
}
if
(
envelop
.
canceled
)
{
new_html
+=
' - Enveloppe supprimée'
;
}
new_html
+=
'</i></button>'
;
}
else
{
new_html
+=
'<button class="accordion w100">'
+
envelop_name
+
' - <i>'
+
total_amount
+
'€</i></button>'
;
}
...
...
envelops/views.py
View file @
4950aec7
...
...
@@ -21,7 +21,7 @@ def index(request):
return
HttpResponse
(
template
.
render
(
context
,
request
))
def
archive_envelop
(
request
):
"""Save members payment and
destroy
the envelop"""
"""Save members payment and
archive
the envelop"""
m
=
CagetteEnvelops
()
res_payments
=
[]
res_envelop
=
""
...
...
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