diff options
-rw-r--r-- | app/income/models.py | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/app/income/models.py b/app/income/models.py index 68b963f..77a6d24 100644 --- a/app/income/models.py +++ b/app/income/models.py @@ -45,3 +45,25 @@ class Gig(models.Model): days = self.publisher.payment_time * 7 if self.invoice_date: return self.invoice_date + datetime.timedelta(float(days)) + + +class Invoice(models.Model): + title = models.CharField(max_length=200) + date_start = models.DateField(null=True, blank=True) + date_end = models.DateField(null=True, blank=True) + + def __str__(self): + return self.title + + +class InvoiceItem(models.Model): + time_start = models.DateTimeField(null=True, blank=True) + time_end = models.DateTimeField(null=True, blank=True) + work_done = models.TextField(null=True, blank=True) + + def __str__(self): + return self.time_start + + @property + def total(self): + return self.time_end - self.time_start |