Bernd Wurst commited on 2024-02-14 18:20:51
Zeige 2 geänderte Dateien mit 9 Einfügungen und 1 Löschungen.
... | ... |
@@ -305,7 +305,7 @@ class PDF(object): |
305 | 305 |
self.canvas.drawString(self.rightcolumn, self.y, "Erstellungsdatum:") |
306 | 306 |
self.canvas.drawRightString(self.rightcontent, self.y, "%s" % self.invoice.date.strftime('%d. %m. %Y')) |
307 | 307 |
self.y -= (self.font_size + 0.1 * cm) |
308 |
- else: |
|
308 |
+ elif self.invoice.type: |
|
309 | 309 |
self.canvas.setFont(self.font + '-Bold', self.font_size) |
310 | 310 |
self.canvas.drawString(self.rightcolumn, self.y, "Bei Fragen bitte immer angeben:") |
311 | 311 |
self.y -= (self.font_size + 0.2 * cm) |
... | ... |
@@ -316,6 +316,10 @@ class PDF(object): |
316 | 316 |
self.canvas.drawString(self.rightcolumn, self.y, "Rechnungsnummer:") |
317 | 317 |
self.canvas.drawRightString(self.rightcontent, self.y, "%s" % self.invoice.id) |
318 | 318 |
self.y -= (self.font_size + 0.1 * cm) |
319 |
+ else: |
|
320 |
+ self.canvas.drawString(self.rightcolumn, self.y, "Datum:") |
|
321 |
+ self.canvas.drawRightString(self.rightcontent, self.y, "%s" % self.invoice.date.strftime('%d. %m. %Y')) |
|
322 |
+ self.y -= (self.font_size + 0.1 * cm) |
|
319 | 323 |
if self.invoice.customerno: |
320 | 324 |
self.canvas.drawString(self.rightcolumn, self.y, "Kundennummer:") |
321 | 325 |
self.canvas.drawRightString(self.rightcontent, self.y, "%s" % self.invoice.customerno) |
... | ... |
@@ -36,8 +36,12 @@ def InvoiceToText(invoice: Invoice): |
36 | 36 |
ret.append(f' {line}') |
37 | 37 |
ret.append('') |
38 | 38 |
ret.append(f'Kundennummer: {invoice.customerno}') |
39 |
+ if invoice.id: |
|
39 | 40 |
ret.append(f'Rechnungsnummer: {invoice.id}') |
41 |
+ if invoice.type: |
|
40 | 42 |
ret.append(f'Rechnungsdatum: {invoice.date.strftime("%d.%m.%Y")}') |
43 |
+ else: |
|
44 |
+ ret.append(f'Datum: {invoice.date.strftime("%d.%m.%Y")}') |
|
41 | 45 |
|
42 | 46 |
if invoice.leitweg_id: |
43 | 47 |
ret.append(f'Leitweg-ID: {invoice.leitweg_id}') |
44 | 48 |