From 0664127e7069c917d8eea8415c8c942cf832a509 Mon Sep 17 00:00:00 2001 From: Raphael Michel Date: Tue, 14 Jan 2025 15:09:38 +0100 Subject: [PATCH] Invoices: Show sum of 0%-tax amount if there are any taxes (Z#23178464) (#4737) --- src/pretix/base/invoice.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/pretix/base/invoice.py b/src/pretix/base/invoice.py index 30de1433e8..ef9d00bf0d 100644 --- a/src/pretix/base/invoice.py +++ b/src/pretix/base/invoice.py @@ -775,8 +775,6 @@ class ClassicInvoiceRenderer(BaseReportlabInvoiceRenderer): for idx, gross in grossvalue_map.items(): rate, name = idx - if rate == 0: - continue tax = taxvalue_map[idx] tdata.append([ Paragraph(self._normalize(localize(rate) + " % " + name), self.stylesheet['Fineprint']), @@ -792,7 +790,7 @@ class ClassicInvoiceRenderer(BaseReportlabInvoiceRenderer): except ValueError: return localize(val) + ' ' + self.invoice.foreign_currency_display - if len(tdata) > 1 and has_taxes: + if any(rate != 0 and gross != 0 for (rate, name), gross in grossvalue_map.items()) and has_taxes: colwidths = [a * doc.width for a in (.25, .15, .15, .15, .3)] table = Table(tdata, colWidths=colwidths, repeatRows=2, hAlign=TA_LEFT) table.setStyle(TableStyle(tstyledata))