Add a footer and a second text field to invoices

Also, move to using localized strings for Invoice.additional_text
settings for consistency.
This commit is contained in:
Tobias Kunze
2016-08-22 19:05:11 +02:00
parent 157a16810d
commit 5f401f17d8
5 changed files with 68 additions and 10 deletions

View File

@@ -39,8 +39,12 @@ class Invoice(models.Model):
:type date: date
:param locale: The locale in which the invoice should be printed
:type locale: str
:param introductory_text: Introductory text for the invoice, e.g. for a greeting
:type introductory_text: str
:param additional_text: Additional text for the invoice
:type additional_text: str
:param footer_text: A footer text, displayed smaller and centered on every page
:type footer_text: str
:param file: The filename of the rendered invoice
:type file: File
"""
@@ -53,7 +57,9 @@ class Invoice(models.Model):
invoice_to = models.TextField()
date = models.DateField(default=date.today)
locale = models.CharField(max_length=50, default='en')
introductory_text = models.TextField(blank=True)
additional_text = models.TextField(blank=True)
footer_text = models.TextField(blank=True)
file = models.FileField(null=True, blank=True, upload_to=invoice_filename)
@staticmethod