add Invoice model

This commit is contained in:
Thomas Steen Rasmussen 2016-05-17 15:09:40 +02:00
parent 9cce10c281
commit 8a653265cc

View file

@ -197,3 +197,17 @@ class EpayPayment(CreatedUpdatedModel, UUIDModel):
callback = models.ForeignKey('shop.EpayCallback') callback = models.ForeignKey('shop.EpayCallback')
txnid = models.IntegerField() txnid = models.IntegerField()
class Invoice(CreatedUpdatedModel):
order = models.OneToOneField('shop.Order')
sent_to_customer = models.BooleanField(default=False)
def __str__(self):
return 'invoice#%s - order %s - %s - total %s DKK (sent to customer: %s)' % (
self.id,
self.order.id,
self.order.created,
self.order.total,
self.sent_to_customer,
)