JourneyJoker/payment/models/invoiceitem.py
Klaus-Uwe Mitterer d2792b8aa3 Refactor payment app
Generate invoice from HTML
Remove now unused dependency on PyInvoice
2021-06-10 13:18:52 +02:00

14 lines
No EOL
450 B
Python

from django.db import models
from .invoice import Invoice
class InvoiceItem(models.Model):
invoice = models.ForeignKey(Invoice, models.CASCADE)
name = models.CharField(max_length=64)
description = models.CharField(max_length=256, null=True, blank=True)
count = models.IntegerField()
net_each = models.DecimalField(max_digits=11, decimal_places=2)
@property
def net_total(self):
return self.net_each * self.count