Changeset - 0e80e0336c20
[Not reviewed]
0 2 0
Christopher Neugebauer - 8 years ago 2016-04-07 07:17:15
chrisjrn@gmail.com
adds invoice_recipient to AttendeeProfileBase
2 files changed with 18 insertions and 1 deletions:
0 comments (0 inline, 0 general)
registrasion/controllers/invoice.py
Show inline comments
...
 
@@ -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)
registrasion/tests/test_cart.py
Show inline comments
...
 
@@ -23,6 +23,9 @@ class RegistrationCartTestCase(SetTimeMixin, TestCase):
 

	
 
    @classmethod
 
    def setUpTestData(cls):
 

	
 
        super(RegistrationCartTestCase, cls).setUpTestData()
 

	
 
        cls.USER_1 = User.objects.create_user(
 
            username='testuser',
 
            email='test@example.com',
...
 
@@ -33,6 +36,15 @@ class RegistrationCartTestCase(SetTimeMixin, TestCase):
 
            email='test2@example.com',
 
            password='top_secret')
 

	
 
        attendee1 = rego.Attendee.get_instance(cls.USER_1)
 
        attendee1.save()
 
        profile1 = rego.AttendeeProfileBase.objects.create(attendee=attendee1)
 
        profile1.save()
 
        attendee2 = rego.Attendee.get_instance(cls.USER_2)
 
        attendee2.save()
 
        profile2 = rego.AttendeeProfileBase.objects.create(attendee=attendee2)
 
        profile2.save()
 

	
 
        cls.RESERVATION = datetime.timedelta(hours=1)
 

	
 
        cls.categories = []
0 comments (0 inline, 0 general)