New check-in features (#3022)

This commit is contained in:
Raphael Michel
2023-02-09 09:46:46 +01:00
committed by GitHub
parent 7b0d07065f
commit 6902725f3c
69 changed files with 1606 additions and 183 deletions

View File

@@ -216,10 +216,13 @@ class CheckInListMixin(BaseExporter):
)
if form_data.get('attention_only'):
qs = qs.filter(Q(item__checkin_attention=True) | Q(order__checkin_attention=True))
qs = qs.filter(Q(item__checkin_attention=True) | Q(order__checkin_attention=True) | Q(variation__checkin_attention=True))
if not cl.include_pending:
qs = qs.filter(order__status=Order.STATUS_PAID)
qs = qs.filter(
Q(order__status=Order.STATUS_PAID) |
Q(order__status=Order.STATUS_PENDING, order__valid_if_pending=True)
)
else:
qs = qs.filter(order__status__in=(Order.STATUS_PAID, Order.STATUS_PENDING))
@@ -363,12 +366,15 @@ class PDFCheckinList(ReportlabExportMixin, CheckInListMixin, BaseExporter):
)
if op.seat:
item += '<br/>' + str(op.seat)
name = bleach.clean(str(name), tags=['br']).strip().replace('<br>', '<br/>')
if op.blocked:
name = '<font face="OpenSansBd">[' + _('Blocked') + ']</font> ' + name
row = [
'!!' if op.item.checkin_attention or op.order.checkin_attention else '',
CBFlowable(bool(op.last_checked_in)),
'!!' if op.require_checkin_attention else '',
CBFlowable(bool(op.last_checked_in)) if not op.blocked else '',
'' if op.order.status != Order.STATUS_PAID else '',
op.order.code,
Paragraph(bleach.clean(str(name), tags=['br']).strip().replace('<br>', '<br/>'), self.get_style()),
Paragraph(name, self.get_style()),
Paragraph(bleach.clean(str(item), tags=['br']).strip().replace('<br>', '<br/>'), self.get_style()),
]
acache = {}
@@ -401,6 +407,12 @@ class PDFCheckinList(ReportlabExportMixin, CheckInListMixin, BaseExporter):
('TEXTCOLOR', (2, len(tdata)), (2, len(tdata)), '#ffffff'),
('ALIGN', (2, len(tdata)), (2, len(tdata)), 'CENTER'),
]
if op.blocked:
tstyledata += [
('BACKGROUND', (1, len(tdata)), (1, len(tdata)), '#990000'),
('TEXTCOLOR', (1, len(tdata)), (1, len(tdata)), '#ffffff'),
('ALIGN', (1, len(tdata)), (1, len(tdata)), 'CENTER'),
]
tdata.append(row)
table = Table(tdata, colWidths=colwidths, repeatRows=1)
@@ -440,7 +452,10 @@ class CSVCheckinList(CheckInListMixin, ListExporter):
_('Product'), _('Price'), _('Checked in'), _('Checked out'), _('Automatically checked in')
]
if not cl.include_pending:
qs = qs.filter(order__status=Order.STATUS_PAID)
qs = qs.filter(
Q(order__status=Order.STATUS_PAID) |
Q(order__status=Order.STATUS_PENDING, order__valid_if_pending=True)
)
else:
qs = qs.filter(order__status__in=(Order.STATUS_PAID, Order.STATUS_PENDING))
headers.append(_('Paid'))
@@ -470,6 +485,9 @@ class CSVCheckinList(CheckInListMixin, ListExporter):
headers.append(_('Seat zone'))
headers.append(_('Seat row'))
headers.append(_('Seat number'))
headers.append(_('Blocked'))
headers.append(_('Valid from'))
headers.append(_('Valid until'))
headers += [
_('Address'),
_('ZIP code'),
@@ -565,7 +583,7 @@ class CSVCheckinList(CheckInListMixin, ListExporter):
row.append(op.voucher.code if op.voucher else "")
row.append(op.order.datetime.astimezone(self.event.timezone).strftime('%Y-%m-%d'))
row.append(op.order.datetime.astimezone(self.event.timezone).strftime('%H:%M:%S'))
row.append(_('Yes') if op.order.checkin_attention or op.item.checkin_attention else _('No'))
row.append(_('Yes') if op.require_checkin_attention else _('No'))
row.append(op.order.comment or "")
if op.seat:
@@ -580,6 +598,9 @@ class CSVCheckinList(CheckInListMixin, ListExporter):
row += ['', '', '', '', '']
row += [
_('Yes') if op.blocked else '',
date_format(op.valid_from, 'SHORT_DATETIME_FORMAT') if op.valid_from else '',
date_format(op.valid_until, 'SHORT_DATETIME_FORMAT') if op.valid_until else '',
op.street or '',
op.zipcode or '',
op.city or '',