mirror of
https://github.com/pretix/pretix.git
synced 2025-12-18 16:12:26 +00:00
Invoice renderer: Do not show end date if same as start date
This commit is contained in:
@@ -395,7 +395,13 @@ class ClassicInvoiceRenderer(BaseReportlabInvoiceRenderer):
|
|||||||
return txt
|
return txt
|
||||||
|
|
||||||
if not self.invoice.event.has_subevents and self.invoice.event.settings.show_dates_on_frontpage:
|
if not self.invoice.event.has_subevents and self.invoice.event.settings.show_dates_on_frontpage:
|
||||||
if self.invoice.event.settings.show_date_to and self.invoice.event.date_to:
|
tz = self.invoice.event.timezone
|
||||||
|
show_end_date = (
|
||||||
|
self.invoice.event.settings.show_date_to and
|
||||||
|
self.invoice.event.date_to and
|
||||||
|
self.invoice.event.date_to.astimezone(tz).date() != self.invoice.event.date_from.astimezone(tz).date()
|
||||||
|
)
|
||||||
|
if show_end_date:
|
||||||
p_str = (
|
p_str = (
|
||||||
shorten(self.invoice.event.name) + '\n' +
|
shorten(self.invoice.event.name) + '\n' +
|
||||||
pgettext('invoice', '{from_date}\nuntil {to_date}').format(
|
pgettext('invoice', '{from_date}\nuntil {to_date}').format(
|
||||||
|
|||||||
Reference in New Issue
Block a user