Skip to content

Commit

Permalink
ajuste busca de outros documentos no consulta cadastro
Browse files Browse the repository at this point in the history
  • Loading branch information
ricardolp committed Sep 24, 2024
1 parent 7a239bc commit b013472
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 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):
"""
Consulta de cadastro
:param modelo: Modelo da nota
:param cnpj: CNPJ da empresa
:param documento: Documento (CNPJ, CPF ou IE)
:tipo do documento: 1: CNPJ, 2: CPF, 3: IE
:return:
"""
# UF que utilizam a SVRS - Sefaz Virtual do RS:
Expand All @@ -265,7 +266,18 @@ 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

tipo_doc = None

if tipo == 1:
tipo_doc = 'CNPJ'
elif tipo == 2:
tipo_doc = 'CPF'
elif tipo == 3:
tipo_doc = 'IE'

etree.SubElement(info, tipo_doc).text = documento

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

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

0 comments on commit b013472

Please sign in to comment.