Skip to content

Commit e216160

Browse files
committed
feat(invoice): separate date of taxable supply
Needed for accounting reasons.
1 parent 70ca730 commit e216160

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

weblate_web/invoices/models.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -285,6 +285,10 @@ class Invoice(models.Model): # noqa: PLR0904
285285
blank=True,
286286
help_text="Due date / Quote validity, keep blank unless specific terms are needed",
287287
)
288+
tax_date = models.DateField(
289+
blank=True,
290+
help_text="Date of taxable supply, keep blank for issue date",
291+
)
288292

289293
kind = models.IntegerField(choices=InvoiceKind)
290294
category = models.IntegerField(
@@ -355,6 +359,8 @@ def save( # type: ignore[override]
355359
if self.extra is None:
356360
self.extra = {}
357361
extra_fields: list[str] = []
362+
if not self.tax_date:
363+
self.tax_date = self.issue_date
358364
if not self.due_date:
359365
self.due_date = self.issue_date + datetime.timedelta(
360366
days=self.get_due_delta()

weblate_web/invoices/templates/invoice-template.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,7 @@ <h2>Issued by</h2>
247247
<th>Contact</th>
248248
</tr>
249249
<tr>
250-
<td>{{ invoice.issue_date|date }}</td>
250+
<td>{{ invoice.tax_date|date }}</td>
251251
<td>21668027</td>
252252
<td>Michal Čihař</td>
253253
<td>C 52324/KSUL Krajský soud v Ústí nad Labem</td>

0 commit comments

Comments
 (0)