forked from CGM_Public/pretix_original
Invoices: Show sum of 0%-tax amount if there are any taxes (Z#23178464) (#4737)
This commit is contained in:
@@ -775,8 +775,6 @@ class ClassicInvoiceRenderer(BaseReportlabInvoiceRenderer):
|
|||||||
|
|
||||||
for idx, gross in grossvalue_map.items():
|
for idx, gross in grossvalue_map.items():
|
||||||
rate, name = idx
|
rate, name = idx
|
||||||
if rate == 0:
|
|
||||||
continue
|
|
||||||
tax = taxvalue_map[idx]
|
tax = taxvalue_map[idx]
|
||||||
tdata.append([
|
tdata.append([
|
||||||
Paragraph(self._normalize(localize(rate) + " % " + name), self.stylesheet['Fineprint']),
|
Paragraph(self._normalize(localize(rate) + " % " + name), self.stylesheet['Fineprint']),
|
||||||
@@ -792,7 +790,7 @@ class ClassicInvoiceRenderer(BaseReportlabInvoiceRenderer):
|
|||||||
except ValueError:
|
except ValueError:
|
||||||
return localize(val) + ' ' + self.invoice.foreign_currency_display
|
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)]
|
colwidths = [a * doc.width for a in (.25, .15, .15, .15, .3)]
|
||||||
table = Table(tdata, colWidths=colwidths, repeatRows=2, hAlign=TA_LEFT)
|
table = Table(tdata, colWidths=colwidths, repeatRows=2, hAlign=TA_LEFT)
|
||||||
table.setStyle(TableStyle(tstyledata))
|
table.setStyle(TableStyle(tstyledata))
|
||||||
|
|||||||
Reference in New Issue
Block a user