Bernd Wurst commited on 2018-09-05 07:37:38
Zeige 1 geänderte Dateien mit 2 Einfügungen und 3 Löschungen.
| ... | ... |
@@ -14,8 +14,6 @@ from reportlab.lib.units import cm |
| 14 | 14 |
from reportlab.pdfgen import canvas as Canvas |
| 15 | 15 |
from reportlab.lib.colors import Color |
| 16 | 16 |
|
| 17 |
-num_pages = 1 |
|
| 18 |
- |
|
| 19 | 17 |
|
| 20 | 18 |
def _formatPrice(price, symbol='€'): |
| 21 | 19 |
'''_formatPrice(price, symbol='€'): |
| ... | ... |
@@ -131,6 +129,7 @@ def InvoiceToPDF(iv, bankdata=True): |
| 131 | 129 |
|
| 132 | 130 |
canvas.setFont(font, 12) |
| 133 | 131 |
|
| 132 |
+ num_pages = 1 |
|
| 134 | 133 |
# Waehrungssysmbol |
| 135 | 134 |
symbol = '€' |
| 136 | 135 |
y = topcontent |
| ... | ... |
@@ -189,7 +188,7 @@ def InvoiceToPDF(iv, bankdata=True): |
| 189 | 188 |
|
| 190 | 189 |
def _PageWrap(canvas): |
| 191 | 190 |
'''Seitenumbruch''' |
| 192 |
- global num_pages |
|
| 191 |
+ nonlocal num_pages |
|
| 193 | 192 |
num_pages += 1 |
| 194 | 193 |
canvas.setFont(font, default_font_size - 2) |
| 195 | 194 |
canvas.drawRightString(rightcontent, bottomcontent + line_padding, 'Fortsetzung auf Seite %i' % num_pages) |
| 196 | 195 |