diff --git a/registrasion/controllers/invoice.py b/registrasion/controllers/invoice.py index a25221f1e76346893da25a60dc601e113a697331..f7ae13e5c7f44bcc0248578f46a1e3b25b854f70 100644 --- a/registrasion/controllers/invoice.py +++ b/registrasion/controllers/invoice.py @@ -73,6 +73,11 @@ class InvoiceController(object): # Never generate a due time that is before the issue time due = max(issued, reservation_limit) + # Get the invoice recipient + profile = rego.AttendeeProfileBase.objects.get_subclass( + id=cart.user.attendee.attendeeprofilebase.id, + ) + recipient = profile.invoice_recipient() invoice = rego.Invoice.objects.create( user=cart.user, cart=cart, @@ -81,7 +86,7 @@ class InvoiceController(object): value=Decimal(), issue_time=issued, due_time=due, - recipient="BOB_THOMAS", # TODO: add recipient generating code + recipient=recipient, ) product_items = rego.ProductItem.objects.filter(cart=cart)