Blocksatz auch für Beschreibung von Rechnungsposten
Bernd Wurst

Bernd Wurst commited on 2008-04-15 18:52:56
Zeige 1 geänderte Dateien mit 5 Einfügungen und 3 Löschungen.

... ...
@@ -217,7 +217,7 @@ def InvoiceToPDF(iv):
217 217
           subject = _splitToWidth(canvas, el['subject'], 9.3*cm, font, font_size)
218 218
         desc = []
219 219
         if 'desc' in el and el['desc'] != '':
220
-          desc = _splitToWidth(canvas, el['desc'], 14.5*cm, font, font_size)
220
+          desc = _splitToWidth(canvas, el['desc'], 11*cm, font, font_size)
221 221
 
222 222
         # draw the background
223 223
         if not odd:
... ...
@@ -244,8 +244,10 @@ def InvoiceToPDF(iv):
244 244
           for line in subject:
245 245
             canvas.drawString(left+1.7*cm, y-(x * line_height)-font_height, line)
246 246
             x += 1
247
-          for line in desc:
248
-            canvas.drawString(left+1.7*cm, y-(x * line_height)-font_height, line)
247
+          for line in desc[:-1]:
248
+            _drawJustifiedString(left+1.7*cm, y-(x * line_height)-font_height, line, canvas, 11*cm, font, font_size)
249
+            x += 1
250
+          canvas.drawString(left+1.7*cm, y-(x * line_height)-font_height, desc[-1])
249 251
           x += 1
250 252
         else:
251 253
           canvas.drawString(left+1.7*cm, y-font_height, subject[0])
252 254