diff --git a/doc/api/resources/items.rst b/doc/api/resources/items.rst index 1e115c19ed..e5233953d7 100644 --- a/doc/api/resources/items.rst +++ b/doc/api/resources/items.rst @@ -50,6 +50,9 @@ min_per_order integer This product ca max_per_order integer This product can only be bought if it is included at most this many times in the order (or ``null`` for no limitation). +checkin_attention boolean If ``True``, the check-in app should show a warning + that this ticket requires special attention if such + a product is being scanned. has_variations boolean Shows whether or not this item has variations (read-only). variations list of objects A list with one object for each variation of this item. @@ -73,7 +76,8 @@ addons list of objects Definition of a .. versionchanged:: 1.7 - The attribute ``tax_rule`` has been added. ``tax_rate`` is kept for compatibility. + The attribute ``tax_rule`` has been added. ``tax_rate`` is kept for compatibility. The attribute + ``checkin_attention`` has been added. Endpoints @@ -124,6 +128,7 @@ Endpoints "allow_cancel": true, "min_per_order": null, "max_per_order": null, + "checkin_attention": false, "has_variations": false, "variations": [ { @@ -205,6 +210,7 @@ Endpoints "allow_cancel": true, "min_per_order": null, "max_per_order": null, + "checkin_attention": false, "has_variations": false, "variations": [ { diff --git a/doc/plugins/pretixdroid.rst b/doc/plugins/pretixdroid.rst index 5dddc15cd6..602dfef203 100644 --- a/doc/plugins/pretixdroid.rst +++ b/doc/plugins/pretixdroid.rst @@ -99,6 +99,7 @@ uses to communicate with the pretix server. "variation": null, "attendee_name": "Peter Higgs", "redeemed": false, + "attention": false, "paid": true }, ... @@ -107,10 +108,10 @@ uses to communicate with the pretix server. } :query query: Search query - :query key: Secret API key - :statuscode 200: Valid request - :statuscode 404: Unknown organizer or event - :statuscode 403: Invalid authorization key + :query key: Secret API key + :statuscode 200: Valid request + :statuscode 404: Unknown organizer or event + :statuscode 403: Invalid authorization key .. http:get:: /pretixdroid/api/(organizer)/(event)/download/ @@ -140,6 +141,7 @@ uses to communicate with the pretix server. "variation": null, "attendee_name": "Peter Higgs", "redeemed": false, + "attention": false, "paid": true }, ... diff --git a/src/pretix/api/serializers/item.py b/src/pretix/api/serializers/item.py index 3cd4ba6100..bb86f13008 100644 --- a/src/pretix/api/serializers/item.py +++ b/src/pretix/api/serializers/item.py @@ -42,7 +42,7 @@ class ItemSerializer(I18nAwareModelSerializer): 'default_price', 'free_price', 'tax_rate', 'tax_rule', 'admission', 'position', 'picture', 'available_from', 'available_until', 'require_voucher', 'hide_without_voucher', 'allow_cancel', - 'min_per_order', 'max_per_order', 'has_variations', + 'min_per_order', 'max_per_order', 'checkin_attention', 'has_variations', 'variations', 'addons') diff --git a/src/pretix/base/migrations/0074_auto_20170825_1258.py b/src/pretix/base/migrations/0074_auto_20170825_1258.py new file mode 100644 index 0000000000..ac39e5c08b --- /dev/null +++ b/src/pretix/base/migrations/0074_auto_20170825_1258.py @@ -0,0 +1,38 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.11.4 on 2017-08-25 12:58 +from __future__ import unicode_literals + +import django.core.validators +from django.db import migrations, models + +import pretix.base.models.vouchers + + +class Migration(migrations.Migration): + + dependencies = [ + ('pretixbase', '0073_auto_20170716_1333'), + ] + + operations = [ + migrations.AddField( + model_name='item', + name='checkin_attention', + field=models.BooleanField(default=False, help_text='If you set this, the check-in app will show a visible warning that this ticket requires special attention. You can use this for example for student tickets to indicate to the person at check-in that the student ID card still needs to be checked.', verbose_name='Requires special attention'), + ), + migrations.AlterField( + model_name='event', + name='currency', + field=models.CharField(choices=[('AED', 'AED - UAE Dirham'), ('AFN', 'AFN - Afghani'), ('ALL', 'ALL - Lek'), ('AMD', 'AMD - Armenian Dram'), ('ANG', 'ANG - Netherlands Antillean Guilder'), ('AOA', 'AOA - Kwanza'), ('ARS', 'ARS - Argentine Peso'), ('AUD', 'AUD - Australian Dollar'), ('AWG', 'AWG - Aruban Florin'), ('AZN', 'AZN - Azerbaijanian Manat'), ('BAM', 'BAM - Convertible Mark'), ('BBD', 'BBD - Barbados Dollar'), ('BDT', 'BDT - Taka'), ('BGN', 'BGN - Bulgarian Lev'), ('BHD', 'BHD - Bahraini Dinar'), ('BIF', 'BIF - Burundi Franc'), ('BMD', 'BMD - Bermudian Dollar'), ('BND', 'BND - Brunei Dollar'), ('BOB', 'BOB - Boliviano'), ('BRL', 'BRL - Brazilian Real'), ('BSD', 'BSD - Bahamian Dollar'), ('BTN', 'BTN - Ngultrum'), ('BWP', 'BWP - Pula'), ('BYN', 'BYN - Belarusian Ruble'), ('BZD', 'BZD - Belize Dollar'), ('CAD', 'CAD - Canadian Dollar'), ('CDF', 'CDF - Congolese Franc'), ('CHF', 'CHF - Swiss Franc'), ('CLP', 'CLP - Chilean Peso'), ('CNY', 'CNY - Yuan Renminbi'), ('COP', 'COP - Colombian Peso'), ('CRC', 'CRC - Costa Rican Colon'), ('CUC', 'CUC - Peso Convertible'), ('CUP', 'CUP - Cuban Peso'), ('CVE', 'CVE - Cabo Verde Escudo'), ('CZK', 'CZK - Czech Koruna'), ('DJF', 'DJF - Djibouti Franc'), ('DKK', 'DKK - Danish Krone'), ('DOP', 'DOP - Dominican Peso'), ('DZD', 'DZD - Algerian Dinar'), ('EGP', 'EGP - Egyptian Pound'), ('ERN', 'ERN - Nakfa'), ('ETB', 'ETB - Ethiopian Birr'), ('EUR', 'EUR - Euro'), ('FJD', 'FJD - Fiji Dollar'), ('FKP', 'FKP - Falkland Islands Pound'), ('GBP', 'GBP - Pound Sterling'), ('GEL', 'GEL - Lari'), ('GHS', 'GHS - Ghana Cedi'), ('GIP', 'GIP - Gibraltar Pound'), ('GMD', 'GMD - Dalasi'), ('GNF', 'GNF - Guinea Franc'), ('GTQ', 'GTQ - Quetzal'), ('GYD', 'GYD - Guyana Dollar'), ('HKD', 'HKD - Hong Kong Dollar'), ('HNL', 'HNL - Lempira'), ('HRK', 'HRK - Kuna'), ('HTG', 'HTG - Gourde'), ('HUF', 'HUF - Forint'), ('IDR', 'IDR - Rupiah'), ('ILS', 'ILS - New Israeli Sheqel'), ('INR', 'INR - Indian Rupee'), ('IQD', 'IQD - Iraqi Dinar'), ('IRR', 'IRR - Iranian Rial'), ('ISK', 'ISK - Iceland Krona'), ('JMD', 'JMD - Jamaican Dollar'), ('JOD', 'JOD - Jordanian Dinar'), ('JPY', 'JPY - Yen'), ('KES', 'KES - Kenyan Shilling'), ('KGS', 'KGS - Som'), ('KHR', 'KHR - Riel'), ('KMF', 'KMF - Comoro Franc'), ('KPW', 'KPW - North Korean Won'), ('KRW', 'KRW - Won'), ('KWD', 'KWD - Kuwaiti Dinar'), ('KYD', 'KYD - Cayman Islands Dollar'), ('KZT', 'KZT - Tenge'), ('LAK', 'LAK - Kip'), ('LBP', 'LBP - Lebanese Pound'), ('LKR', 'LKR - Sri Lanka Rupee'), ('LRD', 'LRD - Liberian Dollar'), ('LSL', 'LSL - Loti'), ('LYD', 'LYD - Libyan Dinar'), ('MAD', 'MAD - Moroccan Dirham'), ('MDL', 'MDL - Moldovan Leu'), ('MGA', 'MGA - Malagasy Ariary'), ('MKD', 'MKD - Denar'), ('MMK', 'MMK - Kyat'), ('MNT', 'MNT - Tugrik'), ('MOP', 'MOP - Pataca'), ('MRO', 'MRO - Ouguiya'), ('MUR', 'MUR - Mauritius Rupee'), ('MVR', 'MVR - Rufiyaa'), ('MWK', 'MWK - Malawi Kwacha'), ('MXN', 'MXN - Mexican Peso'), ('MYR', 'MYR - Malaysian Ringgit'), ('MZN', 'MZN - Mozambique Metical'), ('NAD', 'NAD - Namibia Dollar'), ('NGN', 'NGN - Naira'), ('NIO', 'NIO - Cordoba Oro'), ('NOK', 'NOK - Norwegian Krone'), ('NPR', 'NPR - Nepalese Rupee'), ('NZD', 'NZD - New Zealand Dollar'), ('OMR', 'OMR - Rial Omani'), ('PAB', 'PAB - Balboa'), ('PEN', 'PEN - Sol'), ('PGK', 'PGK - Kina'), ('PHP', 'PHP - Philippine Peso'), ('PKR', 'PKR - Pakistan Rupee'), ('PLN', 'PLN - Zloty'), ('PYG', 'PYG - Guarani'), ('QAR', 'QAR - Qatari Rial'), ('RON', 'RON - Romanian Leu'), ('RSD', 'RSD - Serbian Dinar'), ('RUB', 'RUB - Russian Ruble'), ('RWF', 'RWF - Rwanda Franc'), ('SAR', 'SAR - Saudi Riyal'), ('SBD', 'SBD - Solomon Islands Dollar'), ('SCR', 'SCR - Seychelles Rupee'), ('SDG', 'SDG - Sudanese Pound'), ('SEK', 'SEK - Swedish Krona'), ('SGD', 'SGD - Singapore Dollar'), ('SHP', 'SHP - Saint Helena Pound'), ('SLL', 'SLL - Leone'), ('SOS', 'SOS - Somali Shilling'), ('SRD', 'SRD - Surinam Dollar'), ('SSP', 'SSP - South Sudanese Pound'), ('STD', 'STD - Dobra'), ('SVC', 'SVC - El Salvador Colon'), ('SYP', 'SYP - Syrian Pound'), ('SZL', 'SZL - Lilangeni'), ('THB', 'THB - Baht'), ('TJS', 'TJS - Somoni'), ('TMT', 'TMT - Turkmenistan New Manat'), ('TND', 'TND - Tunisian Dinar'), ('TOP', 'TOP - Pa’anga'), ('TRY', 'TRY - Turkish Lira'), ('TTD', 'TTD - Trinidad and Tobago Dollar'), ('TWD', 'TWD - New Taiwan Dollar'), ('TZS', 'TZS - Tanzanian Shilling'), ('UAH', 'UAH - Hryvnia'), ('UGX', 'UGX - Uganda Shilling'), ('USD', 'USD - US Dollar'), ('UYU', 'UYU - Peso Uruguayo'), ('UZS', 'UZS - Uzbekistan Sum'), ('VEF', 'VEF - Bolívar'), ('VND', 'VND - Dong'), ('VUV', 'VUV - Vatu'), ('WST', 'WST - Tala'), ('XAF', 'XAF - CFA Franc BEAC'), ('XAG', 'XAG - Silver'), ('XAU', 'XAU - Gold'), ('XBA', 'XBA - Bond Markets Unit European Composite Unit (EURCO)'), ('XBB', 'XBB - Bond Markets Unit European Monetary Unit (E.M.U.-6)'), ('XBC', 'XBC - Bond Markets Unit European Unit of Account 9 (E.U.A.-9)'), ('XBD', 'XBD - Bond Markets Unit European Unit of Account 17 (E.U.A.-17)'), ('XCD', 'XCD - East Caribbean Dollar'), ('XDR', 'XDR - SDR (Special Drawing Right)'), ('XOF', 'XOF - CFA Franc BCEAO'), ('XPD', 'XPD - Palladium'), ('XPF', 'XPF - CFP Franc'), ('XPT', 'XPT - Platinum'), ('XSU', 'XSU - Sucre'), ('XTS', 'XTS - Codes specifically reserved for testing purposes'), ('XUA', 'XUA - ADB Unit of Account'), ('XXX', 'XXX - The codes assigned for transactions where no currency is involved'), ('YER', 'YER - Yemeni Rial'), ('ZAR', 'ZAR - Rand'), ('ZMW', 'ZMW - Zambian Kwacha'), ('ZWL', 'ZWL - Zimbabwe Dollar')], default='EUR', max_length=10, verbose_name='Event currency'), + ), + migrations.AlterField( + model_name='taxrule', + name='price_includes_tax', + field=models.BooleanField(default=True, verbose_name='The configured product prices include the tax amount'), + ), + migrations.AlterField( + model_name='voucher', + name='code', + field=models.CharField(db_index=True, default=pretix.base.models.vouchers.generate_code, max_length=255, validators=[django.core.validators.MinLengthValidator(5)], verbose_name='Voucher code'), + ), + ] diff --git a/src/pretix/base/models/items.py b/src/pretix/base/models/items.py index 0af75ce3fa..9cf51036d4 100644 --- a/src/pretix/base/models/items.py +++ b/src/pretix/base/models/items.py @@ -159,6 +159,8 @@ class Item(LoggedModel): :type max_per_order: int :param min_per_order: Minimum number of times this item needs to be in an order if bought at all. None for unlimited. :type min_per_order: int + :param checkin_attention: Requires special attention at checkin + :type checkin_attention: bool """ event = models.ForeignKey( @@ -266,6 +268,13 @@ class Item(LoggedModel): 'empty or set it to 0, there is no special limit for this product. The limit for the maximum ' 'number of items in the whole order applies regardless.') ) + checkin_attention = models.BooleanField( + verbose_name=_('Requires special attention'), + default=False, + help_text=_('If you set this, the check-in app will show a visible warning that this ticket requires special ' + 'attention. You can use this for example for student tickets to indicate to the person at ' + 'check-in that the student ID card still needs to be checked.') + ) # !!! Attention: If you add new fields here, also add them to the copying code in # pretix/control/views/item.py if applicable. diff --git a/src/pretix/control/forms/item.py b/src/pretix/control/forms/item.py index 6f42799b25..ae6aabefd7 100644 --- a/src/pretix/control/forms/item.py +++ b/src/pretix/control/forms/item.py @@ -194,6 +194,7 @@ class ItemCreateForm(I18nModelForm): self.instance.allow_cancel = self.cleaned_data['copy_from'].allow_cancel self.instance.min_per_order = self.cleaned_data['copy_from'].min_per_order self.instance.max_per_order = self.cleaned_data['copy_from'].max_per_order + self.instance.checkin_attention = self.cleaned_data['copy_from'].checkin_attention self.instance.position = (self.event.items.aggregate(p=Max('position'))['p'] or 0) + 1 instance = super().save(*args, **kwargs) @@ -283,6 +284,7 @@ class ItemUpdateForm(I18nModelForm): 'allow_cancel', 'max_per_order', 'min_per_order', + 'checkin_attention' ] widgets = { 'available_from': forms.DateTimeInput(attrs={'class': 'datetimepicker'}), diff --git a/src/pretix/control/templates/pretixcontrol/item/index.html b/src/pretix/control/templates/pretixcontrol/item/index.html index 75c1aa470e..451139492d 100644 --- a/src/pretix/control/templates/pretixcontrol/item/index.html +++ b/src/pretix/control/templates/pretixcontrol/item/index.html @@ -31,6 +31,10 @@ {% bootstrap_field form.hide_without_voucher layout="horizontal" %} {% bootstrap_field form.allow_cancel layout="horizontal" %} +