Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
AlekSIS-App-Paweljong
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Monitor
Service Desk
Analyze
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
Teckids
Projekt Hack-n-Fun
AlekSIS-App-Paweljong
Commits
f2bfe8db
Commit
f2bfe8db
authored
1 month ago
by
magicfelix
Browse files
Options
Downloads
Patches
Plain Diff
Fix voucher stuff
parent
dc816151
No related branches found
No related tags found
1 merge request
!78
Resolve "Rewrite registration wizard"
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
aleksis/apps/paweljong/schema/event_registration.py
+5
-3
5 additions, 3 deletions
aleksis/apps/paweljong/schema/event_registration.py
with
5 additions
and
3 deletions
aleksis/apps/paweljong/schema/event_registration.py
+
5
−
3
View file @
f2bfe8db
...
...
@@ -131,6 +131,7 @@ class SendEventRegistrationMutation(graphene.Mutation):
event
=
event
,
person
=
person
,
medical_information
=
event_registration
[
"
medical_information
"
],
donation
=
0
,
**
school_details
,
)
for
field
in
event
.
additional_fields
.
all
():
...
...
@@ -145,18 +146,19 @@ class SendEventRegistrationMutation(graphene.Mutation):
registration
.
cost
=
event
.
cost
if
event
.
max_cost
is
not
None
and
event
.
max_cost
>
0
:
if
event
.
max_cost
is
None
or
event
.
max_cost
>
0
:
amount
=
event_registration
[
"
payment
"
][
"
amount
"
]
if
amount
<
event
.
cost
:
voucher_amount
=
event
.
cost
-
amount
discount
=
voucher_amount
/
event
.
cost
Voucher
.
objects
.
create
(
discount
=
voucher_amount
/
event
.
cost
*
100
voucher
=
Voucher
.
objects
.
create
(
person
=
person
,
event
=
event
,
used
=
True
,
discount
=
discount
,
)
registration
.
voucher
=
voucher
elif
amount
>
event
.
cost
:
registration
.
donation
=
amount
-
event
.
cost
...
...
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