-
Notifications
You must be signed in to change notification settings - Fork 53
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement voucher per event and for all events of an organizer: apply…
… voucher in billing setting (#488) * Apply voucher * Add migration file, apply voucher for invoice * Add pydantic model, minor refactor * Fix spelling * Add None case for validation * Fix space * Add pydantic req, edit validation error * Add status paid for 0 ticket_fee invoice * Update migration file, invoice billing model * Change pdf format * Add missing colon * Resolve conversations
- Loading branch information
Showing
11 changed files
with
639 additions
and
311 deletions.
There are no files selected for viewing
39 changes: 39 additions & 0 deletions
39
src/pretix/base/migrations/0007_billinginvoice_final_ticket_fee_and_more.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
# Generated by Django 5.1.4 on 2024-12-26 08:14 | ||
|
||
import django.db.models.deletion | ||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('pretixbase', '0006_create_invoice_voucher'), | ||
] | ||
|
||
operations = [ | ||
migrations.AddField( | ||
model_name='billinginvoice', | ||
name='final_ticket_fee', | ||
field=models.DecimalField(decimal_places=2, default=0, max_digits=10), | ||
), | ||
migrations.AddField( | ||
model_name='billinginvoice', | ||
name='voucher_discount', | ||
field=models.DecimalField(decimal_places=2, default=0, max_digits=10), | ||
), | ||
migrations.AddField( | ||
model_name='organizerbillingmodel', | ||
name='invoice_voucher', | ||
field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='billing', to='pretixbase.invoicevoucher'), | ||
), | ||
migrations.AddField( | ||
model_name='billinginvoice', | ||
name='voucher_price_mode', | ||
field=models.CharField(max_length=20, null=True), | ||
), | ||
migrations.AddField( | ||
model_name='billinginvoice', | ||
name='voucher_value', | ||
field=models.DecimalField(decimal_places=2, default=0, max_digits=10), | ||
) | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
from django.db import models | ||
from django.utils.translation import gettext_lazy as _ | ||
|
||
|
||
class PriceModeChoices(models.TextChoices): | ||
NONE = 'none', _('No effect') | ||
SET = 'set', _('Set product price to') | ||
SUBTRACT = 'subtract', _('Subtract from product price') | ||
PERCENT = 'percent', _('Reduce product price by (%)') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.