forked from CGM_Public/pretix_original
Invoices: Label tax ID as ABN in Australia
This commit is contained in:
@@ -120,13 +120,19 @@ class Invoice(models.Model):
|
|||||||
|
|
||||||
@property
|
@property
|
||||||
def full_invoice_from(self):
|
def full_invoice_from(self):
|
||||||
|
taxidrow = ""
|
||||||
|
if self.invoice_from_tax_id:
|
||||||
|
if str(self.invoice_from_country) == "AU":
|
||||||
|
taxidrow = "ABN: %s" % self.invoice_from_tax_id
|
||||||
|
else:
|
||||||
|
taxidrow = pgettext("invoice", "Tax ID: %s") % self.invoice_from_tax_id
|
||||||
parts = [
|
parts = [
|
||||||
self.invoice_from_name,
|
self.invoice_from_name,
|
||||||
self.invoice_from,
|
self.invoice_from,
|
||||||
(self.invoice_from_zipcode or "") + " " + (self.invoice_from_city or ""),
|
(self.invoice_from_zipcode or "") + " " + (self.invoice_from_city or ""),
|
||||||
self.invoice_from_country.name if self.invoice_from_country else "",
|
self.invoice_from_country.name if self.invoice_from_country else "",
|
||||||
pgettext("invoice", "VAT-ID: %s") % self.invoice_from_vat_id if self.invoice_from_vat_id else "",
|
pgettext("invoice", "VAT-ID: %s") % self.invoice_from_vat_id if self.invoice_from_vat_id else "",
|
||||||
pgettext("invoice", "Tax ID: %s") % self.invoice_from_tax_id if self.invoice_from_tax_id else "",
|
taxidrow,
|
||||||
]
|
]
|
||||||
return '\n'.join([p.strip() for p in parts if p and p.strip()])
|
return '\n'.join([p.strip() for p in parts if p and p.strip()])
|
||||||
|
|
||||||
|
|||||||
@@ -527,6 +527,7 @@ DEFAULTS = {
|
|||||||
'serializer_class': serializers.CharField,
|
'serializer_class': serializers.CharField,
|
||||||
'form_kwargs': dict(
|
'form_kwargs': dict(
|
||||||
label=_("Domestic tax ID"),
|
label=_("Domestic tax ID"),
|
||||||
|
help_text=_("e.g. tax number in Germany, ABN in Australia, …")
|
||||||
)
|
)
|
||||||
},
|
},
|
||||||
'invoice_address_from_vat_id': {
|
'invoice_address_from_vat_id': {
|
||||||
|
|||||||
Reference in New Issue
Block a user