From 02c143110f7c79b659509788c701168ac849cd6d Mon Sep 17 00:00:00 2001 From: ahmed Date: Mon, 12 Nov 2018 14:22:36 -0200 Subject: [PATCH 1/5] ajustar tamanho de boleto no modo de carne, 2 boleto per pagina --- pyboleto/pdf.py | 1 + 1 file changed, 1 insertion(+) diff --git a/pyboleto/pdf.py b/pyboleto/pdf.py index 49e6cae..c3fa703 100644 --- a/pyboleto/pdf.py +++ b/pyboleto/pdf.py @@ -781,6 +781,7 @@ def drawBoletoCarneDuplo(self, boletoDados1, boletoDados2=None): y += d[1] + 6 * mm # self._drawHorizontalCorteLine(0, y, d[0]) y += 7 * mm + y = 308 if boletoDados2: self.drawBoletoCarne(boletoDados2, y) From 3dc74a1e07353711feb60925cf7f230073a0dd76 Mon Sep 17 00:00:00 2001 From: vitor Date: Thu, 10 Jan 2019 10:54:48 -0200 Subject: [PATCH 2/5] VitorTanno --- pyboleto/pdf.py | 26 ++++++++++---------------- 1 file changed, 10 insertions(+), 16 deletions(-) diff --git a/pyboleto/pdf.py b/pyboleto/pdf.py index c3fa703..4a5f347 100644 --- a/pyboleto/pdf.py +++ b/pyboleto/pdf.py @@ -452,7 +452,7 @@ def _drawReciboCaixa(self, boleto_dados, x, y): self.width - (45 * mm) + self.space, y + self.space, 'Código de baixa' ) - self.pdf_canvas.drawString(0, y + self.space, 'Sacador / Avalista') + self.pdf_canvas.drawString(0, y + self.space, 'Pagador / Avalista') y += self.height_line self.pdf_canvas.drawString(0, y + self.delta_title, 'Pagador') @@ -473,7 +473,7 @@ def _drawReciboCaixa(self, boleto_dados, x, y): # Linha vertical limitando todos os campos da direita self.pdf_canvas.setLineWidth(1) - self.__verticalLine(self.width - (45 * mm), y, 9.5 * self.height_line) + self.__verticalLine(self.width - (45 * mm), y, 9 * self.height_line) self.pdf_canvas.drawString( self.width - (45 * mm) + self.space, y + self.delta_title, @@ -585,9 +585,7 @@ def _drawReciboCaixa(self, boleto_dados, x, y): y + self.space, boleto_dados.quantidade ) - valor = '' - if boleto_dados.valor != '0.00': - valor = self._formataValorParaExibir(boleto_dados.valor) + valor = self._formataValorParaExibir(boleto_dados.valor) self.pdf_canvas.drawString( ((30 + 20 + 20 + 20 + 20) * mm) + self.space, y + self.space, @@ -678,20 +676,16 @@ def _drawReciboCaixa(self, boleto_dados, x, y): # Linha horizontal com primeiro campo Cedente y += self.height_line self.__horizontalLine(0, y, self.width) - self.pdf_canvas.drawString(0, y + self.delta_title + 10, - 'Beneficiário') + self.pdf_canvas.drawString(0, y + self.delta_title, 'Beneficiário') self.pdf_canvas.drawString( self.width - (45 * mm) + self.space, - y + self.delta_title + 10, - boleto_dados.label_cedente + y + self.delta_title, + 'Agência/Código Beneficiário' ) self.pdf_canvas.setFont('Helvetica', self.font_size_value) - beneficiario = u'{} - CPF/CNPJ: {}'.format( - boleto_dados.cedente, boleto_dados.cedente_documento) - self.pdf_canvas.drawString(0, y + self.space + 10, beneficiario) - self.pdf_canvas.drawString(0, y + self.space, - boleto_dados.cedente_endereco) + self.pdf_canvas.drawString(0, y + self.space, boleto_dados.cedente) + self.pdf_canvas.drawRightString( self.width - 2 * self.space, y + self.space, @@ -700,7 +694,7 @@ def _drawReciboCaixa(self, boleto_dados, x, y): self.pdf_canvas.setFont('Helvetica', self.font_size_title) # Linha horizontal com primeiro campo Local de Pagamento - y += self.height_line + 10 + y += self.height_line self.__horizontalLine(0, y, self.width) self.pdf_canvas.drawString( 0, @@ -781,7 +775,7 @@ def drawBoletoCarneDuplo(self, boletoDados1, boletoDados2=None): y += d[1] + 6 * mm # self._drawHorizontalCorteLine(0, y, d[0]) y += 7 * mm - y = 308 + y = 308 if boletoDados2: self.drawBoletoCarne(boletoDados2, y) From 0c27d09de2a1de3eec1b92bd0e2771d27c26d151 Mon Sep 17 00:00:00 2001 From: vitor Date: Tue, 20 Aug 2019 11:35:06 -0300 Subject: [PATCH 3/5] alteracoes no pyboleto para sempre imprimir o cpf ou cnpj do cliente em frente ao nome --- pyboleto/pdf.py | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/pyboleto/pdf.py b/pyboleto/pdf.py index 4a5f347..28333fb 100644 --- a/pyboleto/pdf.py +++ b/pyboleto/pdf.py @@ -99,7 +99,7 @@ def _draw_recibo_sacado_canhoto(self, boleto_dados, x, y): self.pdf_canvas.setFont('Helvetica-Bold', 6) self.pdf_canvas.drawRightString(self.width_canhoto, 0 * self.height_line + 3, - 'Recibo do Pagador') + 'Recibo do Sacado') # Titles self.pdf_canvas.setFont('Helvetica', 6) @@ -118,7 +118,7 @@ def _draw_recibo_sacado_canhoto(self, boleto_dados, x, y): self.pdf_canvas.drawString( self.space, (((linha_inicial + 1) * self.height_line)) + self.delta_title, - 'Agência/Código Beneficiário' + 'Agência/Código Cedente' ) self.pdf_canvas.drawString( self.width_canhoto - (35 * mm) + self.space, @@ -246,7 +246,7 @@ def _drawReciboSacado(self, boleto_dados, x, y): self.pdf_canvas.drawRightString( self.width, (linha_inicial + 3) * self.height_line + 3, - 'Recibo do Pagador' + 'Recibo do Sacado' ) # Titles @@ -262,17 +262,17 @@ def _drawReciboSacado(self, boleto_dados, x, y): self.pdf_canvas.drawString( 0, (((linha_inicial + 2) * self.height_line)) + self.delta_title, - 'Beneficiário' + 'Cedente' ) self.pdf_canvas.drawString( self.width - (30 * mm) - (35 * mm) - (40 * mm) + self.space, (((linha_inicial + 2) * self.height_line)) + self.delta_title, - 'Agência/Código Beneficiário' + 'Agência/Código Cedente' ) self.pdf_canvas.drawString( self.width - (30 * mm) - (35 * mm) + self.space, (((linha_inicial + 2) * self.height_line)) + self.delta_title, - 'CPF/CNPJ Beneficiário' + 'CPF/CNPJ Cedente' ) self.pdf_canvas.drawString( self.width - (30 * mm) + self.space, @@ -283,7 +283,7 @@ def _drawReciboSacado(self, boleto_dados, x, y): self.pdf_canvas.drawString( 0, (((linha_inicial + 1) * self.height_line)) + self.delta_title, - 'Pagador') + 'Sacado') self.pdf_canvas.drawString( self.width - (30 * mm) - (35 * mm) - (40 * mm) + self.space, (((linha_inicial + 1) * self.height_line)) + self.delta_title, @@ -301,7 +301,7 @@ def _drawReciboSacado(self, boleto_dados, x, y): self.pdf_canvas.drawString( 0, (((linha_inicial + 0) * self.height_line)) + self.delta_title, - 'Endereço Beneficiário' + 'Endereço Cedente' ) self.pdf_canvas.drawString( self.width - (30 * mm) + self.space, @@ -452,10 +452,10 @@ def _drawReciboCaixa(self, boleto_dados, x, y): self.width - (45 * mm) + self.space, y + self.space, 'Código de baixa' ) - self.pdf_canvas.drawString(0, y + self.space, 'Pagador / Avalista') + self.pdf_canvas.drawString(0, y + self.space, 'Sacador / Avalista') y += self.height_line - self.pdf_canvas.drawString(0, y + self.delta_title, 'Pagador') + self.pdf_canvas.drawString(0, y + self.delta_title, 'Sacado') sacado = boleto_dados.sacado # Linha grossa dividindo o Sacado @@ -676,16 +676,15 @@ def _drawReciboCaixa(self, boleto_dados, x, y): # Linha horizontal com primeiro campo Cedente y += self.height_line self.__horizontalLine(0, y, self.width) - self.pdf_canvas.drawString(0, y + self.delta_title, 'Beneficiário') + self.pdf_canvas.drawString(0, y + self.delta_title, 'Cedente') self.pdf_canvas.drawString( self.width - (45 * mm) + self.space, y + self.delta_title, - 'Agência/Código Beneficiário' + 'Agência/Código cedente' ) self.pdf_canvas.setFont('Helvetica', self.font_size_value) self.pdf_canvas.drawString(0, y + self.space, boleto_dados.cedente) - self.pdf_canvas.drawRightString( self.width - 2 * self.space, y + self.space, From 77c4c44abc9da7a5cc61a5b14bbf101f2d48d94b Mon Sep 17 00:00:00 2001 From: vitor Date: Wed, 11 Sep 2019 15:12:52 -0300 Subject: [PATCH 4/5] ajustes do nome do beneficiario com cpf cnpj no recibo do pagador --- pyboleto/pdf.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pyboleto/pdf.py b/pyboleto/pdf.py index 4a5f347..4e6a001 100644 --- a/pyboleto/pdf.py +++ b/pyboleto/pdf.py @@ -313,7 +313,7 @@ def _drawReciboSacado(self, boleto_dados, x, y): 0, (((linha_inicial + 0) * self.height_line - 3 * cm)) + self.delta_title, - 'Demonstrativo' + "Demonstrativo" ) # Values @@ -452,7 +452,7 @@ def _drawReciboCaixa(self, boleto_dados, x, y): self.width - (45 * mm) + self.space, y + self.space, 'Código de baixa' ) - self.pdf_canvas.drawString(0, y + self.space, 'Pagador / Avalista') + self.pdf_canvas.drawString(0, y + self.space, 'Pagador / Avalista madagascar') y += self.height_line self.pdf_canvas.drawString(0, y + self.delta_title, 'Pagador') @@ -684,7 +684,7 @@ def _drawReciboCaixa(self, boleto_dados, x, y): ) self.pdf_canvas.setFont('Helvetica', self.font_size_value) - self.pdf_canvas.drawString(0, y + self.space, boleto_dados.cedente) + self.pdf_canvas.drawString(0, y + self.space,boleto_dados.cedente + " - CPF/CNPJ: " + boleto_dados.cedente_documento) self.pdf_canvas.drawRightString( self.width - 2 * self.space, From c76b8305b27719c64d091580f51b675c8813290f Mon Sep 17 00:00:00 2001 From: vitor Date: Wed, 11 Sep 2019 15:49:03 -0300 Subject: [PATCH 5/5] commit corrigido sem mensagem de teste --- pyboleto/pdf.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyboleto/pdf.py b/pyboleto/pdf.py index d76fd4b..15719eb 100644 --- a/pyboleto/pdf.py +++ b/pyboleto/pdf.py @@ -458,7 +458,7 @@ def _drawReciboCaixa(self, boleto_dados, x, y): self.pdf_canvas.drawString(0, y + self.delta_title, 'Pagador') sacado = boleto_dados.sacado - # Linha grossa dividindo o Sacado + # Linha grossa dividindo o Sacado y += self.height_line self.pdf_canvas.setLineWidth(2) self.__horizontalLine(0, y, self.width)