Skip to content

Commit

Permalink
Merge pull request #1 from AndreMarcos/master
Browse files Browse the repository at this point in the history
[ADD] nfselib.barueri
  • Loading branch information
ygcarvalh authored Dec 8, 2023
2 parents 8f8cae1 + 6d423db commit 3a921ca
Show file tree
Hide file tree
Showing 19 changed files with 9,835 additions and 5 deletions.
1,371 changes: 1,371 additions & 0 deletions nfselib/barueri/ConsultarNFeRecebidaCompetencia.py

Large diffs are not rendered by default.

1,341 changes: 1,341 additions & 0 deletions nfselib/barueri/ConsultarNFeRecebidaNumero.py

Large diffs are not rendered by default.

1,391 changes: 1,391 additions & 0 deletions nfselib/barueri/ConsultarNFeRecebidaPeriodo.py

Large diffs are not rendered by default.

1,348 changes: 1,348 additions & 0 deletions nfselib/barueri/NFeLoteBaixarArquivo.py

Large diffs are not rendered by default.

1,415 changes: 1,415 additions & 0 deletions nfselib/barueri/NFeLoteEnviarArquivo.py

Large diffs are not rendered by default.

1,396 changes: 1,396 additions & 0 deletions nfselib/barueri/NFeLoteListarArquivo.py

Large diffs are not rendered by default.

1,347 changes: 1,347 additions & 0 deletions nfselib/barueri/NFeLoteStatusArquivo.py

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion nfselib/barueri/exportador.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# TODO: Enviar classes para erpbrasil.base


class CampoPosicional:
Expand Down
18 changes: 18 additions & 0 deletions nfselib/barueri/generatedsnamespaces.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
GenerateDSNamespaceDefs = {
"ConsultaNFeRecebidaCompetencia": 'xmlns="http://www.barueri.sp.gov.br/nfe" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:NS="http://www.barueri.sp.gov.br/nfe"',
"ConsultaNFeRecebidaNumero": 'xmlns="http://www.barueri.sp.gov.br/nfe" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:NS="http://www.barueri.sp.gov.br/nfe"',
"ConsultaNFeRecebidaPeriodo": 'xmlns="http://www.barueri.sp.gov.br/nfe" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:NS="http://www.barueri.sp.gov.br/nfe"',
"NFeLoteBaixarArquivo": 'xmlns="http://www.barueri.sp.gov.br/nfe" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:NS="http://www.barueri.sp.gov.br/nfe"',
"NFeLoteListarArquivos": 'xmlns="http://www.barueri.sp.gov.br/nfe" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:NS="http://www.barueri.sp.gov.br/nfe"',
"NFeLoteStatusArquivo": 'xmlns="http://www.barueri.sp.gov.br/nf" xmlns:p1=""',
"NFeLoteEnviarArquivo" : 'xmlns="http://www.barueri.sp.gov.br/nfe"'
}

GenerateDSNamespaceTypePrefixes = {
"InscricaoMunicipal": 'tipos',
"CPFCNPJContrib": 'tipos',
"NomeArquivoRPS": 'tipos',
"ArquivoRPSBase64": 'tipos',
"ApenasValidaArq": 'tipos',
"cabecalho": 'ns2'
}
8 changes: 4 additions & 4 deletions nfselib/barueri/rps.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ class RPS(Arquivo):
class RegistroTipo1(Registro):
campos = [
CampoPosicional("TipoRegistro", "1", True, "NUM", 1, 1, 1),
CampoPosicional("InscricaoContribuinte", None, True, "NUM", 14, 2, 15),
CampoPosicional("VersaoLayout", "PMB002", True, "NUM", 5, 16, 20),
CampoPosicional("IdentificacaoRemessaContribuinte", None, True, "NUM", 12, 21, 32),
CampoPosicional("CaracterFimLinha", "\r\n", True, "ALFA", 2, 33, 34),
CampoPosicional("InscricaoContribuinte", None, True, "ALFA", 7, 2, 8),
CampoPosicional("VersaoLayout", "PMB002", True, "NUM", 6, 9, 14),
CampoPosicional("IdentificacaoRemessaContribuinte", None, True, "NUM", 11, 15, 25),
CampoPosicional("CaracterFimLinha", "\r\n", True, "ALFA", 1, 26, 26),
]


Expand Down
25 changes: 25 additions & 0 deletions schemas/barueri/ConsultaNFeRecebidaCompetencia.v1.xsd
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<?xml version="1.0" encoding="utf-8"?>
<xs:schema targetNamespace="http://www.barueri.sp.gov.br/nfe" xmlns="http://www.barueri.sp.gov.br/nfe" xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" >
<xs:element name="NFeRecebidaCompetencia">
<xs:complexType>
<xs:sequence>
<xs:element name="CPFCNPJTomador" type="xs:string" />
<xs:element name="Competencia" type="xs:string">
<xs:annotation>
<xs:documentation>Mês de Competência que Nota refere-se (AAAAMM).</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="CPFCNPJPrestador" type="xs:string" minOccurs="0" maxOccurs="1">
<xs:annotation>
<xs:documentation>CNPJ/CPF do Prestador do Serviço, ou seja, aquele que emitiu a nota ao Tomador</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="Pagina" type="xs:unsignedShort">
<xs:annotation>
<xs:documentation>Número da pagina que deseja consulta, caso a pesquisa excede o número de registros permitido o resultado é disponibilizado em páginas</xs:documentation>
</xs:annotation>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
20 changes: 20 additions & 0 deletions schemas/barueri/ConsultaNFeRecebidaNumero.v1.xsd
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<?xml version="1.0" encoding="utf-8"?>
<xs:schema targetNamespace="http://www.barueri.sp.gov.br/nfe" xmlns="http://www.barueri.sp.gov.br/nfe" xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" >
<xs:element name="NFeRecebidaNumero">
<xs:complexType>
<xs:sequence>
<xs:element name="CPFCNPJTomador" type="xs:string" />
<xs:element name="CPFCNPJPrestador" type="xs:string">
<xs:annotation>
<xs:documentation>CNPJ/CPF do Prestador do Serviço, ou seja, aquele que emitiu a nota ao Tomador</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="NumeroNota" type="xs:long">
<xs:annotation>
<xs:documentation>Numero da nota foi emitida para o tomador.</xs:documentation>
</xs:annotation>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
30 changes: 30 additions & 0 deletions schemas/barueri/ConsultaNFeRecebidaPeriodo.v1.xsd
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<?xml version="1.0" encoding="utf-8"?>
<xs:schema targetNamespace="http://www.barueri.sp.gov.br/nfe" xmlns="http://www.barueri.sp.gov.br/nfe" xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" >
<xs:element name="NFeRecebidaPeriodo">
<xs:complexType>
<xs:sequence>
<xs:element name="CPFCNPJTomador" type="xs:string" />
<xs:element name="DataInicial" type="xs:date">
<xs:annotation>
<xs:documentation>Intervalo inical de data em que a nota foi emitida para o tomador (AAAA-MM-DD).</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="DataFinal" type="xs:date">
<xs:annotation>
<xs:documentation>Data Final em que a nota foi emitida para o tomador (AAAA-MM-DD).</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="CPFCNPJPrestador" type="xs:string" minOccurs="0" maxOccurs="1">
<xs:annotation>
<xs:documentation>CNPJ/CPF do Prestador do Serviço, ou seja, aquele que emitiu a nota ao Tomador</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="Pagina" type="xs:unsignedShort">
<xs:annotation>
<xs:documentation>Número da pagina que deseja consulta, caso a pesquisa excede o número de registros permitido o resultado é disponibilizado em páginas</xs:documentation>
</xs:annotation>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
24 changes: 24 additions & 0 deletions schemas/barueri/NFeLoteBaixarArquivo.v1.xsd
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<?xml version="1.0" encoding="utf-8"?>
<xs:schema targetNamespace="http://www.barueri.sp.gov.br/nfe" xmlns="http://www.barueri.sp.gov.br/nfe" xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">
<xs:element name="NFeLoteBaixarArquivo">
<xs:complexType>
<xs:sequence>
<xs:element name="InscricaoMunicipal" type="xs:string">
<xs:annotation>
<xs:documentation>Numero da inscrição municipal do contribuinte na Prefeitura de Barueri.</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="CPFCNPJContrib" type="xs:string">
<xs:annotation>
<xs:documentation>CNPJ/CPF do contribuinte</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="NomeArqRetorno" type="xs:string">
<xs:annotation>
<xs:documentation>Nome do Arquivo de retorno que deseja baixar. Para obter a relação de arquivos a serem baixado utilize o método NFeLoteListarArquivos</xs:documentation>
</xs:annotation>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
34 changes: 34 additions & 0 deletions schemas/barueri/NFeLoteEnviarArquivo.v1.xsd
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<?xml version="1.0" encoding="utf-8"?>
<xs:schema targetNamespace="http://www.barueri.sp.gov.br/nfe" xmlns="http://www.barueri.sp.gov.br/nfe" xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">
<xs:element name="NFeLoteEnviarArquivo">
<xs:complexType>
<xs:sequence>
<xs:element name="InscricaoMunicipal" type="xs:string">
<xs:annotation>
<xs:documentation>Numero da inscrição municipal do contribuinte na Prefeitura de Barueri.</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="CPFCNPJContrib" type="xs:string">
<xs:annotation>
<xs:documentation>CNPJ/CPF do contribuinte</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="NomeArquivoRPS" type="xs:string">
<xs:annotation>
<xs:documentation>Nome do Arquivo do contribuinte que está sendo enviado para processamento</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="ApenasValidaArq" type="xs:boolean">
<xs:annotation>
<xs:documentation>Flag para indicar se o arquivo deve gerar NFe. Caso deseje apenas validar o arquivo informar true, valor padrão é false</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="ArquivoRPSBase64" type="xs:base64Binary">
<xs:annotation>
<xs:documentation>Conteúdo do Arquivo do contribuinte em Base64</xs:documentation>
</xs:annotation>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
44 changes: 44 additions & 0 deletions schemas/barueri/NFeLoteListarArquivos.v1.xsd
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
<?xml version="1.0" encoding="utf-8"?>
<xs:schema targetNamespace="http://www.barueri.sp.gov.br/nfe" xmlns="http://www.barueri.sp.gov.br/nfe" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:NS="http://www.barueri.sp.gov.br/nfe" elementFormDefault="qualified">
<xs:element name="NFeLoteListarArquivos">
<xs:complexType>
<xs:sequence>
<xs:element name="InscricaoMunicipal" type="xs:string">
<xs:annotation>
<xs:documentation>Numero da inscrição municipal do contribuinte na Prefeitura de Barueri.</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="CPFCNPJContrib" type="xs:string">
<xs:annotation>
<xs:documentation>CNPJ/CPF do Prestador do contribuinte</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="DataEnvioArq" type="xs:date">
<xs:annotation>
<xs:documentation>Data de envio dos arquivos de remessa ao sistema NFe (AAAA-MM-DD).</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="SituacaoArq" type="tsSitucaoArquivoRPS">
<xs:annotation>
<xs:documentation>Indicar a situação dos arquivos</xs:documentation>
</xs:annotation>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:simpleType name="tsSitucaoArquivoRPS">
<xs:restriction base="xs:string">
<xs:enumeration value="TODAS" />
<!-- Aguardando -->
<xs:enumeration value="-2" />
<!-- Processando -->
<xs:enumeration value="-1" />
<!-- Validado -->
<xs:enumeration value="0" />
<!-- Importado -->
<xs:enumeration value="1" />
<!-- Erros -->
<xs:enumeration value="2" />
</xs:restriction>
</xs:simpleType>
</xs:schema>
24 changes: 24 additions & 0 deletions schemas/barueri/NFeLoteStatusArquivo.v1.xsd
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<?xml version="1.0" encoding="utf-8"?>
<xs:schema targetNamespace="http://www.barueri.sp.gov.br/nfe" xmlns="http://www.barueri.sp.gov.br/nfe" xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">
<xs:element name="NFeLoteStatusArquivo">
<xs:complexType>
<xs:sequence>
<xs:element name="InscricaoMunicipal" type="xs:string">
<xs:annotation>
<xs:documentation>Numero da inscrição municipal do contribuinte na Prefeitura de Barueri.</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="CPFCNPJContrib" type="xs:string">
<xs:annotation>
<xs:documentation>CNPJ/CPF do contribuinte</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="ProtocoloRemessa" type="xs:string">
<xs:annotation>
<xs:documentation>Código do protocolo de Remessa retornado pelo método NFeLoteEnviarArquivo.</xs:documentation>
</xs:annotation>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
1 change: 1 addition & 0 deletions scripts/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Nesta pasta colocamos os scripts utilizados para fazer o download e geração da biblioteca.
2 changes: 2 additions & 0 deletions scripts/generate.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
pip install generateDS
generateDS -o nfselib/barueri schemas/

0 comments on commit 3a921ca

Please sign in to comment.