Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
AlekSIS-App-FiBu
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Katharineum zu Lübeck
AlekSIS-App-FiBu
Commits
941121e2
Commit
941121e2
authored
5 years ago
by
Frank Poetzsch-Heffter
Browse files
Options
Downloads
Patches
Plain Diff
switch status to ordered or submit-invoice
parent
7bb3ebcb
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
biscuit/apps/fibu/models.py
+0
-1
0 additions, 1 deletion
biscuit/apps/fibu/models.py
biscuit/apps/fibu/templates/fibu/index.html
+13
-11
13 additions, 11 deletions
biscuit/apps/fibu/templates/fibu/index.html
biscuit/apps/fibu/views.py
+7
-9
7 additions, 9 deletions
biscuit/apps/fibu/views.py
with
20 additions
and
21 deletions
biscuit/apps/fibu/models.py
+
0
−
1
View file @
941121e2
...
...
@@ -63,7 +63,6 @@ class Booking(models.Model):
def
getStatus
(
self
):
print
(
self
.
status
,
self
.
contact
,
self
.
id
)
return
status_list
[
self
.
status
]
...
...
This diff is collapsed.
Click to expand it.
biscuit/apps/fibu/templates/fibu/index.html
+
13
−
11
View file @
941121e2
...
...
@@ -20,34 +20,36 @@
<h4>
Laufende Anträge
</h4>
<div
class=
"collection"
>
{% for booking in bookings %}
STATUS_ID: {{ booking.status }}
<div
class=
"collection-item row"
>
{#
<a
href=
"{% url 'booking_edit' booking.id %}"
class=
"collection-item row"
>
#}
<span
class=
"col s12 m8"
>
{{ booking.description }}
</span>
<span
class=
"col s12 m2 flushright"
>
{{ booking.planned_amount }} €
</span>
<span
class=
"col s12 m1 badge new {{ booking.getStatus.style_class }}"
>
{{ booking.getStatus.name }}
</span>
<form
action=
"{% url 'booking_edit' booking.id %}"
class=
"col s12 m1"
>
<span
class=
"col s12 m9"
>
{{ booking.description }}
</span>
<span
class=
"col s12 m1 right-align"
>
{{ booking.planned_amount }} €
</span>
<span
class=
"col s12 m1 badge new center-align {{ booking.getStatus.style_class }}"
>
{{ booking.getStatus.name }}
</span>
<form
action=
"{% url 'booking_edit' booking.id %}"
class=
"col s12 m1 right-align"
>
{% csrf_token %}
<input
type=
"hidden"
value=
"{{ booking.id }}"
name=
"booking-id"
>
{% if booking.status == 0 %}
<button
type=
"submit"
name=
"edit"
class=
"waves-effect waves-light btn-flat btn-flat-
large
"
title=
"Bearbeiten"
>
class=
"waves-effect waves-light btn-flat btn-flat-
medium
"
title=
"Bearbeiten"
>
<i
class=
"material-icons center green-text"
>
create
</i>
</button>
{% endif %}
</form>
<form
action=
"
{% url 'fibu_index' %}
"
class=
"col s12 m1"
>
<form
action=
"
"
method=
"POST
"
class=
"col s12 m1"
>
{% csrf_token %}
<input
type=
"hidden"
value=
"{{ booking.id }}"
name=
"booking-id"
>
<input
type=
"hidden"
value=
"{{ booking.status }}"
name=
"booking-status"
>
{% if booking.status == 1 %}
<button
type=
"submit"
name=
"order"
class=
"waves-effect waves-light btn-flat btn-flat-
large
"
title=
"Status auf 'bestellt' ändern"
>
<button
type=
"submit"
name=
"order
ed
"
class=
"waves-effect waves-light btn-flat btn-flat-
medium right-align
"
title=
"Status auf 'bestellt' ändern"
>
<i
class=
"material-icons center red-text"
>
shopping_cart
</i>
</button>
{% elif booking.status == 3 %}
<button
type=
"submit"
name=
"submit-invoice"
class=
"waves-effect waves-light btn-flat btn-flat-medium right-align"
title=
"Status auf 'Rechnung eingereicht' ändern"
>
<i
class=
"material-icons center red-text"
>
description
</i>
</button>
{% endif %}
</form>
{#
</a>
#}
</div>
{% endfor %}
</div>
...
...
This diff is collapsed.
Click to expand it.
biscuit/apps/fibu/views.py
+
7
−
9
View file @
941121e2
...
...
@@ -10,22 +10,20 @@ from .forms import EditBookingForm
#@permission_required('fibu.view_booking')
def
index
(
request
):
bookings
=
Booking
.
objects
.
filter
()
print
(
'
request:
'
,
request
.
method
)
# @login_required
# @permission_required('fibu.make_booking')
# def make_booking(request):
if
request
.
method
==
'
POST
'
:
if
'
booking-id
'
in
request
.
POST
:
booking_id
=
request
.
POST
[
'
booking-id
'
]
booking
=
Booking
.
objects
.
get
(
id
=
booking_id
)
form
=
EditBookingForm
(
instance
=
booking
)
if
'
ordered
'
in
request
.
POST
:
Booking
.
objects
.
filter
(
id
=
booking_id
).
update
(
status
=
3
)
return
redirect
(
'
fibu_index
'
)
elif
'
submit-invoice
'
in
request
.
POST
:
Booking
.
objects
.
filter
(
id
=
booking_id
).
update
(
status
=
4
)
return
redirect
(
'
fibu_index
'
)
print
(
'
Edit-Form erstellt ############# form.is_valid:
'
,
form
.
is_valid
())
form
=
EditBookingForm
(
instance
=
booking
)
else
:
form
=
EditBookingForm
(
request
.
POST
or
None
)
elif
'
booking-status
'
in
request
.
GET
:
print
(
'
status
'
,
request
.
GET
)
# booking-status = str(int(booking-status)+1)
else
:
form
=
EditBookingForm
()
if
form
.
is_valid
():
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment