@@ -40,6 +40,7 @@ def gen(self, filename):
40
40
41
41
# Texty
42
42
self .drawMain ()
43
+ self .drawTitle ()
43
44
self .drawProvider (self .TOP - 10 ,self .LEFT + 3 )
44
45
self .drawClient (self .TOP - 35 ,self .LEFT + 91 )
45
46
self .drawPayment (self .TOP - 47 ,self .LEFT + 3 )
@@ -60,14 +61,15 @@ def addMetaInformation(self, pdf):
60
61
pdf .setTitle (self .invoice .title )
61
62
pdf .setAuthor (self .invoice .creator .name )
62
63
63
- def drawMain (self ):
64
+ def drawTitle (self ):
64
65
# Up line
65
66
self .pdf .drawString (self .LEFT * mm , self .TOP * mm , self .invoice .title )
66
67
self .pdf .drawString ((self .LEFT + 90 ) * mm ,
67
- self .TOP * mm ,
68
- _ (u'Variable symbol: %s' ) %
69
- self .invoice .variable_symbol )
68
+ self .TOP * mm ,
69
+ _ (u'Variable symbol: %s' ) %
70
+ self .invoice .variable_symbol )
70
71
72
+ def drawMain (self ):
71
73
# Borders
72
74
self .pdf .rect (self .LEFT * mm , (self .TOP - 68 ) * mm ,
73
75
(self .LEFT + 156 ) * mm , 65 * mm , stroke = True , fill = False )
@@ -293,3 +295,46 @@ def drawDates(self,TOP,LEFT):
293
295
top += - 5
294
296
295
297
298
+ class CorrectingInvoice (SimpleInvoice ):
299
+ def gen (self , filename ):
300
+ self .TOP = 260
301
+ self .LEFT = 20
302
+ self .filename = filename
303
+
304
+ pdfmetrics .registerFont (TTFont ('DejaVu' , FONT_PATH ))
305
+ pdfmetrics .registerFont (TTFont ('DejaVu-Bold' , FONT_BOLD_PATH ))
306
+
307
+ self .pdf = Canvas (self .filename , pagesize = letter )
308
+ self .addMetaInformation (self .pdf )
309
+
310
+ self .pdf .setFont ('DejaVu' , 15 )
311
+ self .pdf .setStrokeColorRGB (0 , 0 , 0 )
312
+
313
+ # Texty
314
+ self .drawMain ()
315
+ self .drawTitle ()
316
+ self .drawProvider (self .TOP - 10 ,self .LEFT + 3 )
317
+ self .drawClient (self .TOP - 35 ,self .LEFT + 91 )
318
+ self .drawPayment (self .TOP - 47 ,self .LEFT + 3 )
319
+ self .drawCorretion (self .TOP - 73 ,self .LEFT )
320
+ self .drawItems (self .TOP - 82 ,self .LEFT )
321
+ self .drawDates (self .TOP - 10 ,self .LEFT + 91 )
322
+
323
+ #self.pdf.setFillColorRGB(0, 0, 0)
324
+
325
+ self .pdf .showPage ()
326
+ self .pdf .save ()
327
+
328
+ def drawTitle (self ):
329
+ # Up line
330
+ self .pdf .drawString (self .LEFT * mm , self .TOP * mm , self .invoice .title )
331
+ self .pdf .drawString ((self .LEFT + 90 ) * mm ,
332
+ self .TOP * mm ,
333
+ _ (u'Correcting document: %s' ) %
334
+ self .invoice .number )
335
+
336
+
337
+ def drawCorretion (self ,TOP ,LEFT ):
338
+ self .pdf .setFont ('DejaVu' , 8 )
339
+ self .pdf .drawString (LEFT * mm , TOP * mm , _ (u'Correction document for invoice: %s' ) % self .invoice .variable_symbol )
340
+ self .pdf .drawString (LEFT * mm , (TOP - 4 ) * mm , _ (u'Reason to correction: %s' ) % self .invoice .reason )
0 commit comments