diff --git a/doc/api/resources/invoices.rst b/doc/api/resources/invoices.rst index 68e166d02..ac69feb3a 100644 --- a/doc/api/resources/invoices.rst +++ b/doc/api/resources/invoices.rst @@ -58,6 +58,12 @@ lines list of objects The actual invo created before this field was introduced as well as for all lines not created by a product (e.g. a shipping or cancellation fee). +├ subevent integer Event series date ID used to create this line. Note that everything + about the subevent might have changed since the creation + of the invoice. Can be ``null`` for all invoice lines + created before this field was introduced as well as for + all lines not created by a product (e.g. a shipping or + cancellation fee) as well as for all events that are not a series. ├ fee_type string Fee type, e.g. ``shipping``, ``service``, ``payment``, ``cancellation``, ``giftcard``, or ``other. Can be ``null`` for all invoice lines @@ -120,6 +126,10 @@ internal_reference string Customer's refe The attribute ``lines.event_location`` has been added. +.. versionchanged:: 4.6 + + The attribute ``lines.subevent`` has been added. + Endpoints --------- @@ -185,6 +195,7 @@ Endpoints "description": "Budget Ticket", "item": 1234, "variation": 245, + "subevent": null, "fee_type": null, "fee_internal_type": null, "event_date_from": "2017-12-27T10:00:00Z", @@ -274,6 +285,7 @@ Endpoints "description": "Budget Ticket", "item": 1234, "variation": 245, + "subevent": null, "fee_type": null, "fee_internal_type": null, "event_date_from": "2017-12-27T10:00:00Z", diff --git a/src/pretix/api/serializers/order.py b/src/pretix/api/serializers/order.py index 17a14eb64..78991180c 100644 --- a/src/pretix/api/serializers/order.py +++ b/src/pretix/api/serializers/order.py @@ -1426,7 +1426,7 @@ class InlineInvoiceLineSerializer(I18nAwareModelSerializer): class Meta: model = InvoiceLine - fields = ('position', 'description', 'item', 'variation', 'attendee_name', 'event_date_from', + fields = ('position', 'description', 'item', 'variation', 'subevent', 'attendee_name', 'event_date_from', 'event_date_to', 'gross_value', 'tax_value', 'tax_rate', 'tax_name', 'fee_type', 'fee_internal_type', 'event_location') diff --git a/src/tests/api/test_orders.py b/src/tests/api/test_orders.py index ad690604a..129ff7142 100644 --- a/src/tests/api/test_orders.py +++ b/src/tests/api/test_orders.py @@ -1020,6 +1020,7 @@ TEST_INVOICE_RES = { { "position": 1, "description": "Budget Ticket
Attendee: Peter", + 'subevent': None, 'event_date_from': '2017-12-27T10:00:00Z', 'event_date_to': None, 'event_location': None, @@ -1036,6 +1037,7 @@ TEST_INVOICE_RES = { { "position": 2, "description": "Payment fee", + 'subevent': None, 'event_date_from': '2017-12-27T10:00:00Z', 'event_date_to': None, 'event_location': None, @@ -4440,6 +4442,7 @@ def test_order_create_invoice(token_client, organizer, event, order): { 'position': 1, 'description': 'Budget Ticket
Attendee: Peter', + 'subevent': None, 'event_date_from': '2017-12-27T10:00:00Z', 'event_date_to': None, 'event_location': None, @@ -4456,6 +4459,7 @@ def test_order_create_invoice(token_client, organizer, event, order): { 'position': 2, 'description': 'Payment fee', + 'subevent': None, 'event_date_from': '2017-12-27T10:00:00Z', 'event_date_to': None, 'event_location': None,