def __init__(self): super(Observacoes, self).__init__() self.elements = [] self.elements.append( Line(top=0.1 * cm, bottom=0.1 * cm, left=0 * cm, right=19.4 * cm, stroke_width=0.3)) txt = Label(text='Observações', top=0.2 * cm, left=0 * cm, width=19.4 * cm, height=0.5 * cm) txt.style = { 'fontName': REPORT_FONT_BOLD, 'fontSize': 11, 'alignment': TA_CENTER, 'leading': 11 } self.elements.append(txt) txt = ObjectValue(attribute_name='observacoes', top=0.8 * cm, left=0.5 * cm, width=19.4 * cm, height=2 * cm) txt.style = {'fontName': REPORT_FONT, 'fontSize': 9, 'leading': 9} self.elements.append(txt) self.height = 2 * cm
def __init__(self): super(BandaPagamento, self).__init__() self.elements = [] self.elements.append(Line(top=0.1 * cm, bottom=0.1 * cm, left=0 * cm, right=19.4 * cm, stroke_width=0.3)) txt = Label(text='Pagamento', top=0.2 * cm, left=0 * cm, width=19.4 * cm, height=0.5 * cm) txt.style = {'fontName': REPORT_FONT_BOLD, 'fontSize': 11, 'alignment': TA_CENTER, 'leading': 11} self.elements.append(txt) # Condicao de pagamento txt = ObjectValue(attribute_name='cond_pagamento.get_forma_display', display_format='Forma: %s', top=1 * cm, left=0.5 * cm, width=4 * cm, height=0.5 * cm) txt.style = {'fontName': REPORT_FONT, 'fontSize': 9, 'leading': 9} self.elements.append(txt) txt = ObjectValue(attribute_name='cond_pagamento.n_parcelas', display_format='Nº de parcelas: %s', top=1 * cm, left=5 * cm, width=3 * cm, height=0.5 * cm) txt.style = {'fontName': REPORT_FONT, 'fontSize': 9, 'leading': 9} self.elements.append(txt) self.height = 2 * cm
def inserir_endereco_empresa(self, endereco): self.ender_info = True txt = Label(text=endereco, top=0.5 * cm, left=0 * cm, width=19.4 * cm, height=0.5 * cm) txt.style = {'fontName': REPORT_FONT, 'fontSize': 9, 'alignment': TA_CENTER, 'leading': 9} self.elements.append(txt)
def __init__(self): super(DadosPagamento.band_header, self).__init__() self.elements = [] txt = Label(text='Parcela', top=2 * cm, left=0 * cm, width=4 * cm, height=0.5 * cm) txt.style = { 'fontName': REPORT_FONT_BOLD, 'alignment': TA_CENTER, 'fontSize': 10, 'leading': 10 } self.elements.append(txt) txt = Label(text='Vencimento', top=2 * cm, left=4.1 * cm, width=4.1 * cm, height=0.5 * cm) txt.style = { 'fontName': REPORT_FONT_BOLD, 'alignment': TA_CENTER, 'fontSize': 10, 'leading': 10 } self.elements.append(txt) txt = Label(text='Valor', top=2 * cm, left=8.3 * cm, width=4.5 * cm, height=0.5 * cm) txt.style = { 'fontName': REPORT_FONT_BOLD, 'alignment': TA_CENTER, 'fontSize': 10, 'leading': 10 } self.elements.append(txt) self.height = 2.7 * cm
def inserir_telefone_empresa(self, telefone): if self.ender_info: top = 1 * cm else: top = 0.5 * cm txt = Label(text=telefone, top=top, left=0 * cm, width=19.4 * cm, height=0.5 * cm) txt.style = {'fontName': REPORT_FONT, 'fontSize': 9, 'alignment': TA_CENTER, 'leading': 9} self.elements.append(txt)
def __init__(self): super(BandaFoot, self).__init__() self.ender_info = False self.elements = [] self.elements.append(Line(top=1.5 * cm, bottom=1.5 * cm, left=0 * cm, right=19.4 * cm, stroke_width=0.3)) txt = Label(text='Gerado por SGEO', top=1.5 * cm, left=0 * cm, width=19.4 * cm, height=0.5 * cm) txt.style = {'fontName': REPORT_FONT_BOLD, 'fontSize': 8, 'alignment': TA_LEFT, 'leading': 8} self.elements.append(txt) txt = SystemField(expression='Data da impressão: %(now:%d/%m/%Y)s', top=1.5 * cm, left=0 * cm, width=19.4 * cm, height=0.5 * cm) txt.style = {'fontName': REPORT_FONT, 'fontSize': 8, 'alignment': TA_RIGHT, 'leading': 8} self.elements.append(txt) self.height = 2 * cm
def __init__(self): super(DadosProdutos.band_header, self).__init__() self.elements = [] self.elements.append(Line( top=0.1 * cm, bottom=0.1 * cm, left=0 * cm, right=19.4 * cm, stroke_width=0.3)) txt = Label(text='Produtos', top=0.2 * cm, left=0 * cm, width=19.4 * cm, height=0.5 * cm) txt.style = {'fontName': REPORT_FONT_BOLD, 'fontSize': 11, 'alignment': TA_CENTER, 'leading': 11} self.elements.append(txt) txt = Label(text='Cód.', top=1.1 * cm, left=0 * cm, width=2.1 * cm, height=0.5 * cm) txt.style = {'fontName': REPORT_FONT_BOLD, 'alignment': TA_CENTER, 'fontSize': 9, 'leading': 9} self.elements.append(txt) txt = Label(text='Descrição', top=1.1 * cm, left=2.1 * cm, width=4.8 * cm, height=0.5 * cm) txt.style = {'fontName': REPORT_FONT_BOLD, 'fontSize': 9, 'alignment': TA_CENTER, 'leading': 9} self.elements.append(txt) txt = Label(text='Un.', top=1.1 * cm, left=6.9 * cm, width=1.5 * cm, height=0.5 * cm) txt.style = {'fontName': REPORT_FONT_BOLD, 'fontSize': 9, 'alignment': TA_CENTER, 'leading': 9} self.elements.append(txt) txt = Label(text='Qtde.', top=1.1 * cm, left=8.4 * cm, width=1.9 * cm, height=0.5 * cm) txt.style = {'fontName': REPORT_FONT_BOLD, 'fontSize': 9, 'alignment': TA_CENTER, 'leading': 9} self.elements.append(txt) txt = Label(text='Vl. Unit. (R$)', top=1.1 * cm, left=10.3 * cm, width=3.5 * cm, height=0.5 * cm) txt.style = {'fontName': REPORT_FONT_BOLD, 'fontSize': 9, 'alignment': TA_CENTER, 'leading': 9} self.elements.append(txt) txt = Label(text='Desconto (R$)', top=1.1 * cm, left=13.8 * cm, width=2.4 * cm, height=0.5 * cm) txt.style = {'fontName': REPORT_FONT_BOLD, 'fontSize': 9, 'alignment': TA_CENTER, 'leading': 9} self.elements.append(txt) txt = Label(text='Total (R$)', top=1.1 * cm, left=16.2 * cm, width=3.2 * cm, height=0.5 * cm) txt.style = {'fontName': REPORT_FONT_BOLD, 'fontSize': 9, 'alignment': TA_CENTER, 'leading': 9} self.elements.append(txt) self.height = 1.8 * cm
def inserir_nome_empresa(self, nome): txt = Label(text=nome, top=0 * cm, left=0 * cm, width=19.4 * cm, height=0.5 * cm) txt.style = { 'fontName': REPORT_FONT, 'fontSize': 9, 'alignment': TA_CENTER, 'leading': 9 } self.elements.append(txt)
def __init__(self): super(TotaisVenda, self).__init__() self.elements = [] self.elements.append( Line(top=0.1 * cm, bottom=0.1 * cm, left=0 * cm, right=19.4 * cm, stroke_width=0.3)) txt = Label(text='Totais', top=0.2 * cm, left=0 * cm, width=19.4 * cm, height=0.5 * cm) txt.style = { 'fontName': REPORT_FONT_BOLD, 'fontSize': 11, 'alignment': TA_CENTER, 'leading': 11 } self.elements.append(txt) txt = Label(text='Frete', top=1 * cm, left=0 * cm, width=4 * cm, height=0.5 * cm) txt.style = { 'fontName': REPORT_FONT_BOLD, 'fontSize': 10, 'alignment': TA_CENTER, 'leading': 10 } self.elements.append(txt) txt = ObjectValue(attribute_name='format_frete', display_format='R$ %s', top=1.5 * cm, left=0 * cm, width=4 * cm, height=0.5 * cm) txt.style = { 'fontName': REPORT_FONT, 'fontSize': 10, 'alignment': TA_CENTER, 'leading': 10 } self.elements.append(txt) txt = Label(text='Seguro', top=1 * cm, left=4 * cm, width=4 * cm, height=0.5 * cm) txt.style = { 'fontName': REPORT_FONT_BOLD, 'fontSize': 10, 'alignment': TA_CENTER, 'leading': 10 } self.elements.append(txt) txt = ObjectValue(attribute_name='format_seguro', display_format='R$ %s', top=1.5 * cm, left=4 * cm, width=4 * cm, height=0.5 * cm) txt.style = { 'fontName': REPORT_FONT, 'fontSize': 10, 'alignment': TA_CENTER, 'leading': 10 } self.elements.append(txt) txt = Label(text='Despesas', top=1 * cm, left=8 * cm, width=4 * cm, height=0.5 * cm) txt.style = { 'fontName': REPORT_FONT_BOLD, 'fontSize': 10, 'alignment': TA_CENTER, 'leading': 10 } self.elements.append(txt) txt = ObjectValue(attribute_name='format_despesas', display_format='R$ %s', top=1.5 * cm, left=8 * cm, width=4 * cm, height=0.5 * cm) txt.style = { 'fontName': REPORT_FONT, 'fontSize': 10, 'alignment': TA_CENTER, 'leading': 10 } self.elements.append(txt) txt = Label(text='Desconto', top=1 * cm, left=12 * cm, width=4 * cm, height=0.5 * cm) txt.style = { 'fontName': REPORT_FONT_BOLD, 'fontSize': 10, 'alignment': TA_CENTER, 'leading': 10 } self.elements.append(txt) txt = ObjectValue(attribute_name='format_desconto', display_format='R$ %s', top=1.5 * cm, left=12 * cm, width=4 * cm, height=0.5 * cm) txt.style = { 'fontName': REPORT_FONT, 'fontSize': 10, 'alignment': TA_CENTER, 'leading': 10 } self.elements.append(txt) txt = Label(text='Impostos', top=1 * cm, left=16 * cm, width=3.4 * cm, height=0.5 * cm) txt.style = { 'fontName': REPORT_FONT_BOLD, 'fontSize': 10, 'alignment': TA_CENTER, 'leading': 10 } self.elements.append(txt) txt = ObjectValue(attribute_name='format_impostos', display_format='R$ %s', top=1.5 * cm, left=16 * cm, width=3.4 * cm, height=0.5 * cm) txt.style = { 'fontName': REPORT_FONT, 'fontSize': 10, 'alignment': TA_CENTER, 'leading': 10 } self.elements.append(txt) # Totais self.elements.append( Line(top=2.3 * cm, bottom=2.3 * cm, left=0.4 * cm, right=19 * cm, stroke_width=0.3)) txt = Label(text='Total sem impostos:', top=2.4 * cm, left=0 * cm, width=13.4 * cm, height=0.5 * cm) txt.style = { 'fontName': REPORT_FONT_BOLD, 'fontSize': 10, 'alignment': TA_RIGHT, 'leading': 10 } self.elements.append(txt) txt = ObjectValue(attribute_name='format_total_sem_imposto', display_format='R$ %s', top=2.4 * cm, left=13.4 * cm, width=5.6 * cm, height=0.5 * cm) txt.style = { 'fontName': REPORT_FONT, 'fontSize': 10, 'alignment': TA_RIGHT, 'leading': 10 } self.elements.append(txt) self.elements.append( Line(top=2.9 * cm, bottom=2.9 * cm, left=9.7 * cm, right=19 * cm, stroke_width=0.3)) txt = Label(text='Total:', top=3 * cm, left=0 * cm, width=13.4 * cm, height=0.5 * cm) txt.style = { 'fontName': REPORT_FONT_BOLD, 'fontSize': 11, 'alignment': TA_RIGHT, 'leading': 11 } self.elements.append(txt) txt = ObjectValue(attribute_name='format_valor_total', display_format='R$ %s', top=3 * cm, left=13.4 * cm, width=5.6 * cm, height=0.5 * cm) txt.style = { 'fontName': REPORT_FONT_BOLD, 'fontSize': 10, 'alignment': TA_RIGHT, 'leading': 10 } self.elements.append(txt) self.height = 3.6 * cm