Skip to content

Commit

Permalink
Expose that sponsor cost is a VAT field in backend interface
Browse files Browse the repository at this point in the history
While normally sponsors are invoived without VAT, there are cases where
VAT is added and in those cases we want the same VAT preview there as we
have for registration types etc.

The code for dealing with that preview was clearly already designed to
handle this, but it was never enabled for levelcost.
  • Loading branch information
mhagander committed Dec 4, 2024
1 parent a59cddc commit dfff6e7
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions postgresqleu/confsponsor/backendforms.py
Original file line number Diff line number Diff line change
Expand Up @@ -308,6 +308,7 @@ class BackendSponsorshipLevelForm(BackendForm):
linked_objects = OrderedDict({
'benefit': BackendSponsorshipLevelBenefitManager(),
})
vat_fields = {'levelcost': 'sponsor'}
allow_copy_previous = True
auto_cascade_delete_to = ['sponsorshiplevel_paymentmethods', 'sponsorshipbenefit']
exclude_date_validators = ['paymentdueby', ]
Expand Down
2 changes: 1 addition & 1 deletion postgresqleu/confsponsor/migrations/0001_initial.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ class Migration(migrations.Migration):
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
('levelname', models.CharField(max_length=100, verbose_name='Level name')),
('urlname', models.CharField(max_length=100, validators=[postgresqleu.util.validators.validate_lowercase, postgresqleu.util.validators.validate_urlname], verbose_name='URL name')),
('levelcost', models.IntegerField(verbose_name="Cost")),
('levelcost', models.IntegerField(verbose_name="Cost", help_text='Cost excluding VAT.')),
('available', models.BooleanField(default=True, verbose_name='Available for signup')),
('instantbuy', models.BooleanField(default=False, verbose_name="Instant buy available")),
('canbuyvoucher', models.BooleanField(default=True, verbose_name="Can buy vouchers")),
Expand Down
2 changes: 1 addition & 1 deletion postgresqleu/confsponsor/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class SponsorshipLevel(models.Model):
urlname = models.CharField(max_length=100, null=False, blank=False,
validators=[validate_lowercase, validate_urlname],
verbose_name="URL name")
levelcost = models.IntegerField(null=False, blank=False, verbose_name="Cost")
levelcost = models.IntegerField(null=False, blank=False, verbose_name="Cost", help_text="Cost excluding VAT.")
available = models.BooleanField(null=False, blank=False, default=True, verbose_name="Available for signup")
public = models.BooleanField(null=False, blank=False, default=True, verbose_name="Publicly visible",
help_text="If unchecked the sponsorship level will be treated as internal, for example for testing")
Expand Down

0 comments on commit dfff6e7

Please sign in to comment.