Bernd Wurst commited on 2017-12-15 11:28:07
Zeige 1 geänderte Dateien mit 16 Einfügungen und 14 Löschungen.
... | ... |
@@ -374,14 +374,6 @@ def InvoiceToPDF(iv, bankdata=True): |
374 | 374 |
if part.summary: |
375 | 375 |
y -= (0.3*cm) |
376 | 376 |
if part.vatType == 'gross': |
377 |
- canvas.setFont(font+'-Bold', font_size) |
|
378 |
- if iv.tender: |
|
379 |
- canvas.drawRightString(left + 14.5*cm, y-font_height, 'Gesamtbetrag:') |
|
380 |
- else: |
|
381 |
- canvas.drawRightString(left + 14.5*cm, y-font_height, 'Rechnungsbetrag:') |
|
382 |
- canvas.drawRightString(left + 16.8*cm, y-font_height, _formatPrice(part.sum)) |
|
383 |
- canvas.setFont(font, font_size) |
|
384 |
- y -= line_height + line_padding |
|
385 | 377 |
summaries = [] |
386 | 378 |
if len(part.vat) == 1: |
387 | 379 |
vat = list(part.vat.keys())[0] |
... | ... |
@@ -389,23 +381,33 @@ def InvoiceToPDF(iv, bankdata=True): |
389 | 381 |
vatstr = '%s' % integer |
390 | 382 |
if decimals: |
391 | 383 |
vatstr += ',%s' % decimals |
392 |
- if iv.tender: |
|
393 |
- summaries.append(('Im Gesamtbetrag sind %s%% MwSt enthalten:' % vatstr, _formatPrice((part.sum/(vat+1))*vat))) |
|
394 |
- else: |
|
395 |
- summaries.append(('Im Rechnungsbetrag sind %s%% MwSt enthalten:' % vatstr, _formatPrice((part.sum/(vat+1))*vat))) |
|
396 |
- summaries.append(('Nettobetrag:', _formatPrice(part.sum - (part.sum/(vat+1))*vat))) |
|
384 |
+ canvas.drawRightString(left + 14.5*cm, y-font_height, 'Nettobetrag:') |
|
385 |
+ canvas.drawRightString(left + 16.8*cm, y-font_height, _formatPrice(part.sum - (part.sum/(vat+1))*vat)) |
|
386 |
+ y -= line_height |
|
387 |
+ summaries.append(('%s%% MwSt:' % vatstr, _formatPrice((part.sum/(vat+1))*vat))) |
|
397 | 388 |
else: |
389 |
+ net = 0.0 |
|
398 | 390 |
for vat, vatdata in part.vat.items(): |
399 | 391 |
(integer, decimals) = _niceCount( (vat * 100) ) |
400 | 392 |
vatstr = '%s' % integer |
401 | 393 |
if decimals: |
402 | 394 |
vatstr += ',%s' % decimals |
403 |
- summaries.append(('%s: Im Teilbetrag von %s sind %s%% MwSt enthalten:' % (vatdata[1], _formatPrice(vatdata[0]), vatstr), _formatPrice((vatdata[0]/(vat+1))*vat))) |
|
395 |
+ summaries.append(('%s: Teilbetrag %s zzgl. %s%% MwSt:' % (vatdata[1], _formatPrice(vatdata[0]), vatstr), _formatPrice((vatdata[0]/(vat+1))*vat))) |
|
396 |
+ net += vatdata[0] |
|
397 |
+ summaries.append(('Nettobetrag gesamt:', _formatPrice(net))) |
|
404 | 398 |
summaries.sort() |
405 | 399 |
for line in summaries: |
406 | 400 |
canvas.drawRightString(left + 14.5*cm, y-font_height, line[0]) |
407 | 401 |
canvas.drawRightString(left + 16.8*cm, y-font_height, line[1]) |
408 | 402 |
y -= line_height |
403 |
+ canvas.setFont(font+'-Bold', font_size) |
|
404 |
+ if iv.tender: |
|
405 |
+ canvas.drawRightString(left + 14.5*cm, y-font_height, 'Gesamtbetrag:') |
|
406 |
+ else: |
|
407 |
+ canvas.drawRightString(left + 14.5*cm, y-font_height, 'Rechnungsbetrag:') |
|
408 |
+ canvas.drawRightString(left + 16.8*cm, y-font_height, _formatPrice(part.sum)) |
|
409 |
+ canvas.setFont(font, font_size) |
|
410 |
+ y -= line_height + line_padding |
|
409 | 411 |
else: |
410 | 412 |
canvas.drawRightString(left + 14.5*cm, y-font_height, 'Nettobetrag:') |
411 | 413 |
canvas.drawRightString(left + 16.8*cm, y-font_height, _formatPrice(part.sum)) |
412 | 414 |