Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 12 additions & 17 deletions pyboleto/pdf.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -452,13 +452,13 @@ 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')
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)
Expand All @@ -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,
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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 + " - CPF/CNPJ: " + boleto_dados.cedente_documento)

self.pdf_canvas.drawRightString(
self.width - 2 * self.space,
y + self.space,
Expand All @@ -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,
Expand Down Expand Up @@ -781,6 +775,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)

Expand Down