mirror of
https://github.com/pretix/pretix.git
synced 2026-05-05 15:14:04 +00:00
Refs #131 -- Allow to regenerate an invoice
This commit is contained in:
@@ -5,6 +5,7 @@ from decimal import Decimal
|
||||
|
||||
from django.db import DatabaseError, models
|
||||
from django.db.models import Max
|
||||
from django.utils.functional import cached_property
|
||||
|
||||
|
||||
def invoice_filename(instance, filename: str) -> str:
|
||||
@@ -80,6 +81,10 @@ class Invoice(models.Model):
|
||||
"""
|
||||
return '%s-%05d' % (self.event.slug.upper(), self.invoice_no)
|
||||
|
||||
@cached_property
|
||||
def canceled(self):
|
||||
return self.refered.filter(is_cancellation=True).exists()
|
||||
|
||||
class Meta:
|
||||
unique_together = ('event', 'invoice_no')
|
||||
|
||||
|
||||
Reference in New Issue
Block a user