Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adicionando funcionalidade de solicitação de baixa de registro #28

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
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
13 changes: 10 additions & 3 deletions cnab240/tipos.py
Original file line number Diff line number Diff line change
Expand Up @@ -218,9 +218,8 @@ def carregar_retorno(self, arquivo):
def lotes(self):
return self._lotes

def incluir_cobranca(self, header, **kwargs):
# 1 eh o codigo de cobranca
codigo_evento = 1
def incluir_evento(self, header, codigo_movimento, **kwargs):
codigo_evento = codigo_movimento
evento = Evento(self.banco, codigo_evento)

seg_p = self.banco.registros.SegmentoP(**kwargs)
Expand Down Expand Up @@ -253,6 +252,14 @@ def incluir_cobranca(self, header, **kwargs):
# Incrementar numero de registros no trailer do arquivo
self.trailer.totais_quantidade_registros += len(evento)

def incluir_cobranca(self, header, **kwargs):
# 1 = codigo de cobranca
self.incluir_evento(header, 1, **kwargs)

def incluir_baixa(self, header, **kwargs):
# 2 = codigo de solicitacao de baixa
self.incluir_evento(header, 2, **kwargs)

def encontrar_lote(self, codigo_servico):
for lote in self.lotes:
if lote.header.servico_servico == codigo_servico:
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

setup(
name='python-cnab',
version='0.1.19',
version='0.1.20',
author='Trustcode',
author_email='suporte@trustcode.com.br',
url='https://github.com/Trust-Code/python-cnab',
Expand Down