mirror of
https://github.com/pretix/pretix.git
synced 2026-05-06 15:24:02 +00:00
New data model for default tax rule and new options for cancellation fees (#4962)
* New data model for default tax rule * Remove misleading empty label when field is not optional * Allow to split cancellation fee * Fix API and tests * Update migration * Update src/tests/api/test_taxrules.py Co-authored-by: luelista <weller@rami.io> * Update src/tests/api/test_taxrules.py Co-authored-by: luelista <weller@rami.io> * Review note * Update src/pretix/base/models/tax.py Co-authored-by: luelista <weller@rami.io> * Flip API behaviour for default * Fix failing tests * Fix failing test * Split migration --------- Co-authored-by: luelista <weller@rami.io>
This commit is contained in:
@@ -66,7 +66,7 @@ from pretix.api.serializers.fields import (
|
||||
)
|
||||
from pretix.api.serializers.i18n import I18nURLField
|
||||
from pretix.base.forms import I18nMarkdownTextarea, I18nURLFormField
|
||||
from pretix.base.models.tax import VAT_ID_COUNTRIES, TaxRule
|
||||
from pretix.base.models.tax import VAT_ID_COUNTRIES
|
||||
from pretix.base.reldate import (
|
||||
RelativeDateField, RelativeDateTimeField, RelativeDateWrapper,
|
||||
SerializerRelativeDateField, SerializerRelativeDateTimeField,
|
||||
@@ -1027,9 +1027,47 @@ DEFAULTS = {
|
||||
widget=forms.CheckboxInput,
|
||||
)
|
||||
},
|
||||
'tax_rate_default': {
|
||||
'default': None,
|
||||
'type': TaxRule
|
||||
'tax_rule_payment': {
|
||||
'default': 'default',
|
||||
'type': str,
|
||||
'form_class': forms.ChoiceField,
|
||||
'serializer_class': serializers.ChoiceField,
|
||||
'serializer_kwargs': dict(
|
||||
choices=(
|
||||
('default', _('Use default tax rate')),
|
||||
('none', _('Charge no taxes')),
|
||||
),
|
||||
),
|
||||
'form_kwargs': dict(
|
||||
label=_("Tax handling on payment fees"),
|
||||
widget=forms.RadioSelect,
|
||||
choices=(
|
||||
('default', _('Use default tax rate')),
|
||||
('none', _('Charge no taxes')),
|
||||
),
|
||||
)
|
||||
},
|
||||
'tax_rule_cancellation': {
|
||||
'default': 'none',
|
||||
'type': str,
|
||||
'form_class': forms.ChoiceField,
|
||||
'serializer_class': serializers.ChoiceField,
|
||||
'serializer_kwargs': dict(
|
||||
choices=(
|
||||
('none', _('Charge no taxes')),
|
||||
('split', _('Use same taxes as order positions (split according to net prices)')),
|
||||
('default', _('Use default tax rate')),
|
||||
),
|
||||
),
|
||||
'form_kwargs': dict(
|
||||
label=_("Tax handling on cancellation fees"),
|
||||
widget=forms.RadioSelect,
|
||||
choices=(
|
||||
('none', _('Charge no taxes')),
|
||||
('split', _('Use same taxes as order positions (split according to net prices)')),
|
||||
('default', _('Use default tax rate')),
|
||||
),
|
||||
)
|
||||
},
|
||||
'invoice_generate': {
|
||||
'default': 'False',
|
||||
|
||||
Reference in New Issue
Block a user