Check-in list PDF: Proper word wrapping

This commit is contained in:
Raphael Michel
2018-08-10 16:43:27 +02:00
parent 3d5cc98df5
commit de33d6d44c

View File

@@ -216,9 +216,9 @@ class PDFCheckinList(ReportlabExportMixin, BaseCheckinList):
CBFlowable(bool(op.last_checked_in)), CBFlowable(bool(op.last_checked_in)),
'' if op.order.status != Order.STATUS_PAID else '', '' if op.order.status != Order.STATUS_PAID else '',
op.order.code, op.order.code,
name, Paragraph(name, self.get_style()),
str(op.item) + (" " + str(op.variation.value) if op.variation else "") + "\n" + Paragraph(str(op.item) + (" " + str(op.variation.value) if op.variation else "") + "<br/>" +
money_filter(op.price, self.event.currency), money_filter(op.price, self.event.currency), self.get_style()),
] ]
acache = {} acache = {}
if op.addon_to: if op.addon_to:
@@ -227,7 +227,7 @@ class PDFCheckinList(ReportlabExportMixin, BaseCheckinList):
for a in op.answers.all(): for a in op.answers.all():
acache[a.question_id] = str(a) acache[a.question_id] = str(a)
for q in questions: for q in questions:
row.append(acache.get(q.pk, '')) row.append(Paragraph(acache.get(q.pk, ''), self.get_style()))
if op.order.status != Order.STATUS_PAID: if op.order.status != Order.STATUS_PAID:
tstyledata += [ tstyledata += [
('BACKGROUND', (2, len(tdata)), (2, len(tdata)), '#990000'), ('BACKGROUND', (2, len(tdata)), (2, len(tdata)), '#990000'),