aboutsummaryrefslogtreecommitdiff
path: root/app/dispatch/models.py
diff options
context:
space:
mode:
authorMitch Riedstra <mitch@riedstra.us>2018-02-17 16:45:57 -0500
committerMitch Riedstra <mitch@riedstra.us>2018-02-17 16:45:57 -0500
commit0511dd5df2a753fea9273d7a7cdd3d0355659223 (patch)
tree8d600b6486a66d3fc6b2c6e1686df2d39ed746ff /app/dispatch/models.py
parent49f9df9b774b48ceef6f3a99f7a6f4912730dc5f (diff)
downloaddispatch-tracker-0511dd5df2a753fea9273d7a7cdd3d0355659223.tar.gz
dispatch-tracker-0511dd5df2a753fea9273d7a7cdd3d0355659223.tar.xz
Order invoiceitems by date
Diffstat (limited to 'app/dispatch/models.py')
-rw-r--r--app/dispatch/models.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/app/dispatch/models.py b/app/dispatch/models.py
index 451eb31..1d2bae2 100644
--- a/app/dispatch/models.py
+++ b/app/dispatch/models.py
@@ -177,6 +177,9 @@ class Invoice(models.Model):
def items(self):
return InvoiceItem.objects.filter(invoice__exact=self.pk)
+ def items_by_date(self):
+ return InvoiceItem.objects.filter(invoice__exact=self.pk).order_by('date')
+
def total(self):
t = 0
for i in InvoiceItem.objects.filter(invoice__exact=self.pk):