def tabla_encabezado(self, styles):
orden_compra = self.orden_compra
sp = ParagraphStyle('parrafos',
alignment = TA_CENTER,
fontSize = 14,
fontName="Times-Roman")
try:
archivo_imagen = os.path.join(settings.MEDIA_ROOT,str(EMPRESA.logo))
imagen = Image(archivo_imagen, width=90, height=50,hAlign='LEFT')
except:
imagen = Paragraph(u"LOGO", sp)
nro = Paragraph(u"ORDEN DE COMPRA", sp)
ruc = Paragraph("R.U.C."+EMPRESA.ruc, sp)
encabezado = [[imagen,nro,ruc],['',u"N°"+orden_compra.codigo,EMPRESA.distrito + " " + orden_compra.fecha.strftime('%d de %b de %Y')]]
tabla_encabezado = Table(encabezado,colWidths=[4 * cm, 9 * cm, 6 * cm])
tabla_encabezado.setStyle(TableStyle(
[
('ALIGN',(0,0),(2,1),'CENTER'),
('VALIGN',(0,0),(2,0),'CENTER'),
('VALIGN',(1,1),(2,1),'TOP'),
('SPAN',(0,0),(0,1)),
]
))
return tabla_encabezado
评论列表
文章目录