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

ajuste busca de outros documentos no consulta cadastro #363

Merged
merged 4 commits into from
Sep 25, 2024
Merged
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
10 changes: 7 additions & 3 deletions pynfe/processamento/comunicacao.py
Original file line number Diff line number Diff line change
Expand Up @@ -238,11 +238,12 @@ def consulta_distribuicao(

return self._post(url, xml)

def consulta_cadastro(self, modelo, cnpj):
def consulta_cadastro(self, modelo, documento, tipo='CNPJ'):
"""
Consulta de cadastro
:param modelo: Modelo da nota
:param cnpj: CNPJ da empresa
:param documento: Documento (CNPJ, CPF ou IE)
:tipo do documento: CNPJ, CPF, IE
:return:
"""
# UF que utilizam a SVRS - Sefaz Virtual do RS:
Expand All @@ -265,7 +266,10 @@ def consulta_cadastro(self, modelo, cnpj):
info = etree.SubElement(raiz, "infCons")
etree.SubElement(info, "xServ").text = "CONS-CAD"
etree.SubElement(info, "UF").text = self.uf.upper()
etree.SubElement(info, "CNPJ").text = cnpj

# Monta tipo de documento CNPJ, CPF ou IE
etree.SubElement(info, tipo.upper()).text = documento

# etree.SubElement(info, 'CPF').text = cpf

# Monta XML para envio da requisição
Expand Down
Loading