Skip to content

Commit c693669

Browse files
authored
Merge pull request #377 from leogregianin/main
Adiciona no CI testes para a versão 3.13 do python
2 parents 2f744f3 + 8e08bd0 commit c693669

File tree

4 files changed

+20
-10
lines changed

4 files changed

+20
-10
lines changed

.github/workflows/ci.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@ jobs:
1111
"3.9",
1212
"3.10",
1313
"3.11",
14-
"3.12"
14+
"3.12",
15+
"3.13"
1516
]
1617
steps:
1718
- uses: actions/checkout@v2

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
## PyNFe
22

33
[![Active Development](https://img.shields.io/badge/Maintenance%20Level-Actively%20Developed-brightgreen.svg)](https://gist.github.com/cheerfulstoic/d107229326a01ff0f333a1d3476e068d)
4-
![status](https://img.shields.io/badge/status-stable-green.svg) ![https://github.com/TadaSoftware/PyNFe/actions](https://github.com/TadaSoftware/PyNFe/workflows/PyNFe%20CI/badge.svg?branch=main) ![pyversions](https://img.shields.io/badge/python-3.8%20%7C%203.9%20%7C%203.10%20%7C%203.11%20%7C%203.12-blue)
4+
![status](https://img.shields.io/badge/status-stable-green.svg) ![https://github.com/TadaSoftware/PyNFe/actions](https://github.com/TadaSoftware/PyNFe/actions/workflows/ci.yml/badge.svg) ![pyversions](https://img.shields.io/badge/python-3.8%20%7C%203.9%20%7C%203.10%20%7C%203.11%20%7C%203.12%20%7C%203.13-blue)
55
[![PyPI version](https://badge.fury.io/py/pynfe.svg)](https://badge.fury.io/py/pynfe)
66

77

88

9+
910
Biblioteca de interface com os webservices de Nota Fiscal Eletrônica (NF-e) e Nota Fiscal de Consumidor Eletrônica (NFC-e) da SEFAZ e Receita Federal do Brasil, Nota Fiscal de Serviço Eletrônica (NFS-e) para Prefeituras e Manifesto de Documentos Fiscais Eletrônicos (MDF-e).
1011

1112
- **NF-e** visa substituir as notas fiscais séries 1 e 1A.

pynfe/processamento/comunicacao.py

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -238,34 +238,42 @@ def consulta_distribuicao(
238238

239239
return self._post(url, xml)
240240

241-
def consulta_cadastro(self, modelo, documento, tipo='CNPJ'):
241+
def consulta_cadastro(self, modelo, documento, tipo='CNPJ', uf=None):
242242
"""
243243
Consulta de cadastro
244244
:param modelo: Modelo da nota
245245
:param documento: Documento (CNPJ, CPF ou IE)
246246
:tipo do documento: CNPJ, CPF, IE
247+
:param uf: UF
247248
:return:
248249
"""
249250
# UF que utilizam a SVRS - Sefaz Virtual do RS:
250-
# Para serviço de Consulta Cadastro: AC, RN, PB, SC
251-
lista_svrs = ["AC", "RN", "PB", "SC", "PA", "CE"]
251+
lista_svrs = ["AC", "AL", "AP", "CE",
252+
"DF", "ES", "PA", "PB",
253+
"PI", "RJ", "RN", "RO",
254+
"RR", "SC", "SE", "TO"]
255+
256+
# Se não informada UF nos parâmetros da função,
257+
# utiliza a UF do construtor
258+
if not uf:
259+
uf = self.uf
252260

253261
# RS implementa um método diferente na consulta de cadastro
254262
# usa o mesmo url para produção e homologação
255263
# não tem url para NFCE
256-
if self.uf.upper() == "RS":
264+
if uf.upper() == "RS":
257265
url = NFE["RS"]["CADASTRO"]
258-
elif self.uf.upper() in lista_svrs:
266+
elif uf.upper() in lista_svrs:
259267
url = NFE["SVRS"]["CADASTRO"]
260-
elif self.uf.upper() == "SVC-RS":
268+
elif uf.upper() == "SVC-RS":
261269
url = NFE["SVC-RS"]["CADASTRO"]
262270
else:
263271
url = self._get_url(modelo=modelo, consulta="CADASTRO")
264272

265273
raiz = etree.Element("ConsCad", versao="2.00", xmlns=NAMESPACE_NFE)
266274
info = etree.SubElement(raiz, "infCons")
267275
etree.SubElement(info, "xServ").text = "CONS-CAD"
268-
etree.SubElement(info, "UF").text = self.uf.upper()
276+
etree.SubElement(info, "UF").text = uf.upper()
269277

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

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
setuptools.setup(
88
name="PyNFe",
9-
version="0.5.0",
9+
version="0.5.1",
1010
author="TadaSoftware",
1111
author_email="[email protected]",
1212
description="Interface library with the Brazilian Electronic Invoice web services",

0 commit comments

Comments
 (0)