Store subevent data for invoice lines

This commit is contained in:
Raphael Michel
2019-02-08 13:56:04 +01:00
parent bf36ad009f
commit 17392f3ef4
3 changed files with 9 additions and 0 deletions

View File

@@ -142,6 +142,7 @@ def build_invoice(invoice: Invoice) -> Invoice:
InvoiceLine.objects.create(
position=i, invoice=invoice, description=desc,
gross_value=p.price, tax_value=p.tax_value,
subevent=p.subevent, event_date_from=(p.subevent.date_from if p.subevent else invoice.event.date_from),
tax_rate=p.tax_rate, tax_name=p.tax_rule.name if p.tax_rule else ''
)