committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
27 changed files with 1134 additions and 288 deletions
-
99README.md
-
85pytrustnfe/Servidores.py
-
32pytrustnfe/nfe/__init__.py
-
28pytrustnfe/nfe/danfce.py
-
19pytrustnfe/nfe/danfe.py
-
3pytrustnfe/nfe/templates/NFeDistribuicaoDFe.xml
-
40pytrustnfe/nfe/templates/NfeAutorizacao.xml
-
81pytrustnfe/nfse/aparecida/__init__.py
-
91pytrustnfe/nfse/aparecida/templates/Rps.xml
-
15pytrustnfe/nfse/aparecida/templates/cancelarNfse.xml
-
7pytrustnfe/nfse/aparecida/templates/consultarLoteRps.xml
-
13pytrustnfe/nfse/aparecida/templates/recepcionarLoteRps.xml
-
70pytrustnfe/nfse/imperial/__init__.py
-
17pytrustnfe/nfse/imperial/templates/CANCELANOTAELETRONICA.xml
-
9pytrustnfe/nfse/imperial/templates/CONSULTANOTASPROTOCOLO.xml
-
9pytrustnfe/nfse/imperial/templates/CONSULTAPROTOCOLO.xml
-
14pytrustnfe/nfse/imperial/templates/CancelarNota.xml
-
43pytrustnfe/nfse/imperial/templates/GerarNota.xml
-
81pytrustnfe/nfse/imperial/templates/PROCESSARPS.xml
-
5pytrustnfe/nfse/imperial/templates/SoapRequest.xml
-
2pytrustnfe/nfse/simpliss/__init__.py
-
6pytrustnfe/urls.py
-
297pytrustnfe/xml/schemas/distDFeInt_v1.01.xsd
-
273pytrustnfe/xml/schemas/leiauteNFe_v4.00.xsd
-
5pytrustnfe/xml/validate.py
-
4setup.py
-
2tests/test_servidores.py
@ -0,0 +1,81 @@ |
|||||
|
# © 2019 Danimar Ribeiro, Trustcode |
||||
|
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). |
||||
|
|
||||
|
import os |
||||
|
from requests import Session |
||||
|
from zeep import Client |
||||
|
from zeep.transports import Transport |
||||
|
from requests.packages.urllib3 import disable_warnings |
||||
|
|
||||
|
from pytrustnfe.xml import render_xml, sanitize_response |
||||
|
from pytrustnfe.certificado import extract_cert_and_key_from_pfx, save_cert_key |
||||
|
from pytrustnfe.nfe.assinatura import Assinatura |
||||
|
|
||||
|
|
||||
|
def _render(certificado, method, **kwargs): |
||||
|
path = os.path.join(os.path.dirname(__file__), 'templates') |
||||
|
xml_send = render_xml(path, '%s.xml' % method, True, **kwargs) |
||||
|
|
||||
|
reference = '' |
||||
|
signer = Assinatura(certificado.pfx, certificado.password) |
||||
|
xml_send = signer.assina_xml(xml_send, reference) |
||||
|
return xml_send |
||||
|
|
||||
|
|
||||
|
def _send(certificado, method, **kwargs): |
||||
|
base_url = '' |
||||
|
if kwargs['ambiente'] == 'producao': |
||||
|
base_url = 'https://aparecida.siltecnologia.com.br/tbw/services/Abrasf10?wsdl' |
||||
|
else: |
||||
|
base_url = 'https://aparecida.siltecnologia.com.br/tbwhomologacao/services/Abrasf10?wsdl' |
||||
|
|
||||
|
cert, key = extract_cert_and_key_from_pfx( |
||||
|
certificado.pfx, certificado.password) |
||||
|
cert, key = save_cert_key(cert, key) |
||||
|
|
||||
|
disable_warnings() |
||||
|
session = Session() |
||||
|
session.cert = (cert, key) |
||||
|
session.verify = False |
||||
|
transport = Transport(session=session) |
||||
|
|
||||
|
client = Client(base_url, transport=transport) |
||||
|
|
||||
|
xml_send = kwargs['xml'] |
||||
|
response = client.service[method](xml_send) |
||||
|
response, obj = sanitize_response(response) |
||||
|
return { |
||||
|
'sent_xml': xml_send, |
||||
|
'received_xml': response, |
||||
|
'object': obj |
||||
|
} |
||||
|
|
||||
|
|
||||
|
def xml_recepcionar_lote_rps(certificado, **kwargs): |
||||
|
return _render(certificado, 'recepcionarLoteRps', **kwargs) |
||||
|
|
||||
|
|
||||
|
def recepcionar_lote_rps(certificado, **kwargs): |
||||
|
if "xml" not in kwargs: |
||||
|
kwargs['xml'] = xml_recepcionar_lote_rps(certificado, **kwargs) |
||||
|
return _send(certificado, 'recepcionarLoteRps', **kwargs) |
||||
|
|
||||
|
|
||||
|
def xml_consultar_lote_rps(certificado, **kwargs): |
||||
|
return _render(certificado, 'consultarLoteRps', **kwargs) |
||||
|
|
||||
|
|
||||
|
def consultar_lote_rps(certificado, **kwargs): |
||||
|
if "xml" not in kwargs: |
||||
|
kwargs['xml'] = xml_consultar_lote_rps(certificado, **kwargs) |
||||
|
return _send(certificado, 'consultarLoteRps', **kwargs) |
||||
|
|
||||
|
|
||||
|
def xml_cancelar_nfse(certificado, **kwargs): |
||||
|
return _render(certificado, 'cancelarNfse', **kwargs) |
||||
|
|
||||
|
|
||||
|
def cancelar_nfse(certificado, **kwargs): |
||||
|
if "xml" not in kwargs: |
||||
|
kwargs['xml'] = xml_cancelar_nfse(certificado, **kwargs) |
||||
|
return _send(certificado, 'cancelarNfse', **kwargs) |
||||
@ -0,0 +1,91 @@ |
|||||
|
<Rps> |
||||
|
<InfRps Id="rps{{ rps.numero }}"> |
||||
|
<IdentificacaoRps> |
||||
|
<Numero>{{ rps.numero }}</Numero> |
||||
|
<Serie>{{ rps.serie }}</Serie> |
||||
|
<Tipo>{{ rps.tipo_rps }}</Tipo> |
||||
|
</IdentificacaoRps> |
||||
|
<DataEmissao>{{ rps.data_emissao }}</DataEmissao> |
||||
|
<NaturezaOperacao>{{ rps.natureza_operacao }}</NaturezaOperacao> |
||||
|
<RegimeEspecialTributacao>{{ rps.regime_tributacao }}</RegimeEspecialTributacao> |
||||
|
<OptanteSimplesNacional>{{ rps.optante_simples }}</OptanteSimplesNacional> |
||||
|
<IncentivadorCultural>{{ rps.incentivador_cultural }}</IncentivadorCultural> |
||||
|
<Status>{{ rps.status }}</Status> |
||||
|
<RpsSubstituido> |
||||
|
<Numero>{{ rps.numero_substituido }}</Numero> |
||||
|
<Serie>{{ rps.serie_substituido }}</Serie> |
||||
|
<Tipo>{{ rps.tipo_substituido }}</Tipo> |
||||
|
</RpsSubstituido> |
||||
|
<Servico> |
||||
|
<Valores> |
||||
|
<ValorServicos>{{ rps.valor_servico }}</ValorServicos> |
||||
|
<ValorDeducoes>{{ rps.valor_deducao }}</ValorDeducoes> |
||||
|
<ValorPis>{{ rps.valor_pis }}</ValorPis> |
||||
|
<ValorCofins>{{ rps.valor_cofins }}</ValorCofins> |
||||
|
<ValorInss>{{ rps.valor_inss }}</ValorInss> |
||||
|
<ValorIr>{{ rps.valor_ir }}</ValorIr> |
||||
|
<ValorCsll>{{ rps.valor_csll }}</ValorCsll> |
||||
|
<IssRetido>{{ rps.iss_retido }}</IssRetido> |
||||
|
<ValorIss>{{ rps.valor_iss }}</ValorIss> |
||||
|
<ValorIssRetido>{{ rps.valor_iss_retido }}</ValorIssRetido> |
||||
|
<OutrasRetencoes>{{ rps.outras_retencoes }}</OutrasRetencoes> |
||||
|
<BaseCalculo>{{ rps.base_calculo }}</BaseCalculo> |
||||
|
<Aliquota>{{ rps.aliquota_issqn }}</Aliquota> |
||||
|
<ValorLiquidoNfse>{{ rps.valor_liquido_nfse }}</ValorLiquidoNfse> |
||||
|
<DescontoIncondicionado>{{ rps.desconto_incondicionado }}</DescontoIncondicionado> |
||||
|
<DescontoCondicionado>{{ rps.desconto_condicionado }}</DescontoCondicionado> |
||||
|
</Valores> |
||||
|
<ItemListaServico>{{ rps.codigo_servico }}</ItemListaServico> |
||||
|
<CodigoCnae>{{ rps.cnae_servico }}</CodigoCnae> |
||||
|
<CodigoTributacaoMunicipio>{{ rps.codigo_tributacao_municipio }}</CodigoTributacaoMunicipio> |
||||
|
<Discriminacao>{{ rps.descricao }}</Discriminacao> |
||||
|
<CodigoMunicipio>{{ rps.codigo_municipio }}</CodigoMunicipio> |
||||
|
</Servico> |
||||
|
<Prestador> |
||||
|
<Cnpj>{{ rps.prestador.cnpj }}</Cnpj> |
||||
|
<InscricaoMunicipal>{{ rps.prestador.inscricao_municipal }}</InscricaoMunicipal> |
||||
|
</Prestador> |
||||
|
<Tomador> |
||||
|
<IdentificacaoTomador> |
||||
|
<CpfCnpj> |
||||
|
{% if rps.tomador.cnpj_cpf|length == 14 %} |
||||
|
<Cnpj>{{ rps.tomador.cnpj_cpf }}</Cnpj> |
||||
|
{% endif %} |
||||
|
{% if rps.tomador.cnpj_cpf|length == 11 %} |
||||
|
<Cpf>{{ rps.tomador.cnpj_cpf }}</Cpf> |
||||
|
{% endif %} |
||||
|
</CpfCnpj> |
||||
|
<InscricaoMunicipal>{{ rps.tomador.inscricao_municipal }}</InscricaoMunicipal> |
||||
|
</IdentificacaoTomador> |
||||
|
<RazaoSocial>{{ rps.tomador.razao_social }}</RazaoSocial> |
||||
|
<Endereco> |
||||
|
<Endereco>{{ rps.tomador.logradouro }}</Endereco> |
||||
|
<Numero>{{ rps.tomador.numero }}</Numero> |
||||
|
<Complemento>{{ rps.tomador.complemento }}</Complemento> |
||||
|
<Bairro>{{ rps.tomador.bairro }}</Bairro> |
||||
|
<CodigoMunicipio>{{ rps.tomador.cidade }}</CodigoMunicipio> |
||||
|
<Uf>{{ rps.tomador.uf }}</Uf> |
||||
|
<Cep>{{ rps.tomador.cep }}</Cep> |
||||
|
</Endereco> |
||||
|
<Contato> |
||||
|
<Telefone>{{ rps.tomador.telefone }}</Telefone> |
||||
|
<Email>{{ rps.tomador.email }}</Email> |
||||
|
</Contato> |
||||
|
</Tomador> |
||||
|
{% if rps.intermediario is defined -%} |
||||
|
<IntermediarioServico> |
||||
|
<RazaoSocial>{{ rps.intermediario.razao_social }}</RazaoSocial> |
||||
|
<CpfCnpj> |
||||
|
<Cnpj>{{ rps.intermediario.cnpj }}</Cnpj> |
||||
|
</CpfCnpj> |
||||
|
<InscricaoMunicipal>{{ rps.intermediario.inscricao_municipal }}</InscricaoMunicipal> |
||||
|
</IntermediarioServico> |
||||
|
{% endif %} |
||||
|
{% if rps.construcao_civil is defined -%} |
||||
|
<ContrucaoCivil> |
||||
|
<CodigoObra>{{ rps.construcao_civil.codigo_obra }}</CodigoObra> |
||||
|
<Art>{{ rps.construcao_civil.art }}</Art> |
||||
|
</ContrucaoCivil> |
||||
|
{% endif %} |
||||
|
</InfRps> |
||||
|
</Rps> |
||||
@ -0,0 +1,15 @@ |
|||||
|
<CancelarNfseEnvio xmlns="http://nfse.abrasf.org.br"> |
||||
|
<Pedido> |
||||
|
<InfPedidoCancelamento Id="1"> |
||||
|
<IdentificacaoNfse> |
||||
|
<Numero>{{ cancelamento.numero_nfse }}</Numero> |
||||
|
<CpfCnpj> |
||||
|
<Cnpj>{{ cancelamento.cnpj_prestador }}</Cnpj> |
||||
|
</CpfCnpj> |
||||
|
<InscricaoMunicipal>{{ cancelamento.inscricao_municipal }}</InscricaoMunicipal> |
||||
|
<CodigoMunicipio>{{ cancelamento.cidade }}</CodigoMunicipio> |
||||
|
</IdentificacaoNfse> |
||||
|
<CodigoCancelamento>{{ cancelamento.codigo_cancelamento }}</CodigoCancelamento> |
||||
|
</InfPedidoCancelamento> |
||||
|
</Pedido> |
||||
|
</CancelarNfseEnvio> |
||||
@ -0,0 +1,7 @@ |
|||||
|
<ConsultarLoteRpsEnvio xmlns="http://nfse.abrasf.org.br"> |
||||
|
<Prestador> |
||||
|
<Cnpj>{{ consulta.cnpj_prestador }}</Cnpj> |
||||
|
<InscricaoMunicipal>{{ consulta.inscricao_municipal }}</InscricaoMunicipal> |
||||
|
</Prestador> |
||||
|
<Protocolo>{{ consulta.protocolo }}</Protocolo> |
||||
|
</ConsultarLoteRpsEnvio> |
||||
@ -0,0 +1,13 @@ |
|||||
|
<EnviarLoteRpsEnvio> |
||||
|
<LoteRps Id="lote{{ nfse.numero_lote }}"> |
||||
|
<NumeroLote>{{ nfse.numero_lote }}</NumeroLote> |
||||
|
<Cnpj>{{ nfse.cnpj_prestador }}</Cnpj> |
||||
|
<InscricaoMunicipal>{{ nfse.inscricao_municipal }}</InscricaoMunicipal> |
||||
|
<QuantidadeRps>{{ nfse.lista_rps|length }}</QuantidadeRps> |
||||
|
<ListaRps> |
||||
|
{% for rps in nfse.lista_rps -%} |
||||
|
{% include 'Rps.xml' %} |
||||
|
{% endfor %} |
||||
|
</ListaRps> |
||||
|
</LoteRps> |
||||
|
</EnviarLoteRpsEnvio> |
||||
@ -1,17 +0,0 @@ |
|||||
<ws_nfe.CANCELANOTAELETRONICA xmlns="NFe"> |
|
||||
<Sdt_cancelanfe> |
|
||||
<Login> |
|
||||
<CodigoUsuario>{{ cancelamento.codigo_usuario }}</CodigoUsuario> |
|
||||
<CodigoContribuinte>{{ cancelamento.codigo_contribuinte }}</CodigoContribuinte> |
|
||||
</Login> |
|
||||
<Nota> |
|
||||
<SerieNota>{{ cancelamento.serie_nota }}</SerieNota> |
|
||||
<NumeroNota>{{ cancelamento.numero_nota }}</NumeroNota> |
|
||||
<SerieRPS>{{ cancelamento.serie_rps }}</SerieRPS> |
|
||||
<NumeroRps>{{ cancelamento.numero_rps }}</NumeroRps> |
|
||||
<ValorNota>{{ cancelamento.valor }}</ValorNota> |
|
||||
<MotivoCancelamento>{{ cancelamento.motivo }}</MotivoCancelamento> |
|
||||
<PodeCancelarGuia>{{ cancelamento.cancelar_guia }}</PodeCancelarGuia> |
|
||||
</Nota> |
|
||||
</Sdt_cancelanfe> |
|
||||
</ws_nfe.CANCELANOTAELETRONICA> |
|
||||
@ -1,9 +0,0 @@ |
|||||
<ws_nfe.CONSULTANOTASPROTOCOLO xmlns="NFe"> |
|
||||
<Sdt_consultanotasprotocoloin> |
|
||||
<Protocolo>{{ consulta.protocolo }}</Protocolo> |
|
||||
<Login> |
|
||||
<CodigoUsuario>{{ consulta.codigo_usuario }}</CodigoUsuario> |
|
||||
<CodigoContribuinte>{{ consulta.codigo_contribuinte }}</CodigoContribuinte> |
|
||||
</Login> |
|
||||
</Sdt_consultanotasprotocoloin> |
|
||||
</ws_nfe.CONSULTANOTASPROTOCOLO> |
|
||||
@ -1,9 +0,0 @@ |
|||||
<ws_nfe.CONSULTAPROTOCOLO xmlns="NFe"> |
|
||||
<Sdt_consultaprotocoloin> |
|
||||
<Protocolo>{{ consulta.protocolo }}</Protocolo> |
|
||||
<Login> |
|
||||
<CodigoUsuario>{{ consulta.codigo_usuario }}</CodigoUsuario> |
|
||||
<CodigoContribuinte>{{ consulta.codigo_contribuinte }}</CodigoContribuinte> |
|
||||
</Login> |
|
||||
</Sdt_consultaprotocoloin> |
|
||||
</ws_nfe.CONSULTAPROTOCOLO> |
|
||||
@ -0,0 +1,14 @@ |
|||||
|
<Envelope xmlns="http://schemas.xmlsoap.org/soap/envelope/"> |
||||
|
<Body> |
||||
|
<CancelarNota xmlns="urn:sigiss_ws"> |
||||
|
<DadosCancelaNota> |
||||
|
<ccm>{{ cancelamento.ccm }}</ccm> |
||||
|
<cnpj>{{ cancelamento.cnpj }}</cnpj> |
||||
|
<senha>{{ cancelamento.senha }}</senha> |
||||
|
<nota>{{ cancelamento.nota }}</nota> |
||||
|
<motivo>{{ cancelamento.motivo }}</motivo> |
||||
|
<email>{{ cancelamento.email }}</email> |
||||
|
</DadosCancelaNota> |
||||
|
</CancelarNota> |
||||
|
</Body> |
||||
|
</Envelope> |
||||
@ -0,0 +1,43 @@ |
|||||
|
<Envelope xmlns="http://schemas.xmlsoap.org/soap/envelope/"> |
||||
|
<Body> |
||||
|
<GerarNota xmlns="urn:sigiss_ws"> |
||||
|
<DescricaoRps> |
||||
|
<ccm>{{ nfse.ccm }}</ccm> |
||||
|
<cnpj>{{ nfse.cnpj }}</cnpj> |
||||
|
<senha>{{ nfse.senha }}</senha> |
||||
|
<crc>{{ nfse.crc }}</crc> |
||||
|
<crc_estado>{{ nfse.crc_estado }}</crc_estado> |
||||
|
<aliquota_simples>{{ nfse.aliquota_simples }}</aliquota_simples> |
||||
|
<id_sis_legado>{{ nfse.id_sis_legado }}</id_sis_legado> |
||||
|
<servico>{{ nfse.servico }}</servico> |
||||
|
<situacao>{{ nfse.situacao }}</situacao> |
||||
|
<valor>{{ nfse.valor }}</valor> |
||||
|
<base>{{ nfse.base }}</base> |
||||
|
<descricaoNF>{{ nfse.descricaoNF }}</descricaoNF> |
||||
|
<tomador_tipo>{{ nfse.tomador_tipo }}</tomador_tipo> |
||||
|
<tomador_cnpj>{{ nfse.tomador_cnpj }}</tomador_cnpj> |
||||
|
<tomador_email>{{ nfse.tomador_email }}</tomador_email> |
||||
|
<tomador_ie>{{ nfse.tomador_ie }}</tomador_ie> |
||||
|
<tomador_razao>{{ nfse.tomador_razao }}</tomador_razao> |
||||
|
<tomador_fantasia>{{ nfse.tomador_fantasia }}</tomador_fantasia> |
||||
|
<tomador_endereco>{{ nfse.tomador_endereco }}</tomador_endereco> |
||||
|
<tomador_numero>{{ nfse.tomador_endereco }}</tomador_numero> |
||||
|
<tomador_complemento>{{ nfse.tomador_complemento }}</tomador_complemento> |
||||
|
<tomador_bairro>{{ nfse.tomador_bairro }}</tomador_bairro> |
||||
|
<tomador_CEP>{{ nfse.tomador_CEP }}</tomador_CEP> |
||||
|
<tomador_cod_cidade>{{ nfse.tomador_cod_cidade }}</tomador_cod_cidade> |
||||
|
<tomador_fone>{{ nfse.tomador_fone }}</tomador_fone> |
||||
|
<tomador_ramal>{{ nfse.tomador_ramal }}</tomador_ramal> |
||||
|
<tomador_fax>{{ nfse.tomador_fax }}</tomador_fax> |
||||
|
<outro_municipio>{{ nfse.outro_municipio }}</outro_municipio> |
||||
|
<cod_outro_municipio>{{ nfse.cod_outro_municipio }}</cod_outro_municipio> |
||||
|
<retencao_iss>{{ nfse.retencao_iss }}</retencao_iss> |
||||
|
<pis>{{ nfse.pis }}</pis> |
||||
|
<cofins>{{ nfse.cofins }}</cofins> |
||||
|
<inss>{{ nfse.inss }}</inss> |
||||
|
<irrf>{{ nfse.irrf }}</irrf> |
||||
|
<csll>{{ nfse.csll }}</csll> |
||||
|
</DescricaoRps> |
||||
|
</GerarNota> |
||||
|
</Body> |
||||
|
</Envelope> |
||||
@ -1,81 +0,0 @@ |
|||||
<ws_nfe.PROCESSARPS xmlns="NFe"> |
|
||||
<Sdt_processarpsin> |
|
||||
<Login> |
|
||||
<CodigoUsuario>{{ nfse.codigo_usuario }}</CodigoUsuario> |
|
||||
<CodigoContribuinte>{{ nfse.codigo_contribuinte }}</CodigoContribuinte> |
|
||||
</Login> |
|
||||
<SDTRPS> |
|
||||
<Ano>{{ nfse.ano }}</Ano> |
|
||||
<Mes>{{ nfse.mes }}</Mes> |
|
||||
<CPFCNPJ>{{ nfse.cnpj_prestador }}</CPFCNPJ> |
|
||||
<DTIni>{{ nfse.data_emissao }}</DTIni> |
|
||||
<DTFin>{{ nfse.data_emissao }}</DTFin> |
|
||||
<TipoTrib>{{ nfse.tipo_tributacao }}</TipoTrib> |
|
||||
<DtAdeSN>{{ nfse.data_adesao_simples }}</DtAdeSN> |
|
||||
<AlqIssSN_IP>{{ nfse.aliquota_simples_isencao|comma }}</AlqIssSN_IP> |
|
||||
<Versao>2.00</Versao> |
|
||||
{% for rps in nfse.lista_rps -%} |
|
||||
<Reg20> |
|
||||
<!-- Optional --> |
|
||||
<Reg20Item> |
|
||||
<TipoNFS>{{ rps.tipo_nfse }}</TipoNFS> |
|
||||
<NumRps>{{ rps.numero }}</NumRps> |
|
||||
<SerRps>{{ rps.serie }}</SerRps> |
|
||||
<DtEmi>{{ rps.data_emissao }}</DtEmi> |
|
||||
<RetFonte>{{ rps.iss_retido }}</RetFonte> |
|
||||
<CodSrv>{{ rps.codigo_servico }}</CodSrv> |
|
||||
<DiscrSrv>{{ rps.descricao}}</DiscrSrv> |
|
||||
<VlNFS>{{ rps.valor_liquido_nfse|comma }}</VlNFS> |
|
||||
<VlDed>{{ rps.valor_deducao|comma }}</VlDed> |
|
||||
<DiscrDed>{{ rps.discriminacao_deducao }}</DiscrDed> |
|
||||
<VlBasCalc>{{ rps.base_calculo|comma }}</VlBasCalc> |
|
||||
<AlqIss>{{ rps.aliquota_issqn|comma }}</AlqIss> |
|
||||
<VlIss>{{ rps.valor_iss|comma }}</VlIss> |
|
||||
<VlIssRet>{{ rps.valor_iss_retido|comma }}</VlIssRet> |
|
||||
<CpfCnpTom>{{ rps.tomador.cnpj_cpf }}</CpfCnpTom> |
|
||||
<RazSocTom>{{ rps.tomador.razao_social }}</RazSocTom> |
|
||||
<TipoLogtom>{{ rps.tomador.tipo_logradouro }}</TipoLogtom> |
|
||||
<LogTom>{{ rps.tomador.logradouro }}</LogTom> |
|
||||
<NumEndTom>{{ rps.tomador.numero }}</NumEndTom> |
|
||||
<ComplEndTom>{{ rps.tomador.complemento }}</ComplEndTom> |
|
||||
<BairroTom>{{ rps.tomador.bairro }}</BairroTom> |
|
||||
<MunTom>{{ rps.tomador.municipio }}</MunTom> |
|
||||
<SiglaUFTom>{{ rps.tomador.uf }}</SiglaUFTom> |
|
||||
<CepTom>{{ rps.tomador.cep }}</CepTom> |
|
||||
<Telefone>{{ rps.tomador.telefone }}</Telefone> |
|
||||
<InscricaoMunicipal>{{ rps.tomador.inscricao_municipal }}</InscricaoMunicipal> |
|
||||
{% if rps.local_prestacao == 'prestador' %} |
|
||||
<TipoLogLocPre>{{ rps.prestador.tipo_logradouro }}</TipoLogLocPre> |
|
||||
<LogLocPre>{{ rps.prestador.logradouro }}</LogLocPre> |
|
||||
<NumEndLocPre>{{ rps.prestador.numero }}</NumEndLocPre> |
|
||||
<ComplEndLocPre>{{ rps.prestador.complemento }}</ComplEndLocPre> |
|
||||
<BairroLocPre>{{ rps.prestador.bairro }}</BairroLocPre> |
|
||||
<MunLocPre>{{ rps.prestador.municipio }}</MunLocPre> |
|
||||
<SiglaUFLocpre>{{ rps.prestador.uf }}</SiglaUFLocpre> |
|
||||
<CepLocPre>{{ rps.prestador.cep }}</CepLocPre> |
|
||||
{% endif %} |
|
||||
<Email1>{{ rps.tomador.email }}</Email1> |
|
||||
{% for imposto in rps.impostos -%} |
|
||||
<Reg30> |
|
||||
<Reg30Item> |
|
||||
<TributoSigla>{{ imposto.sigla }}</TributoSigla> |
|
||||
<TributoAliquota>{{ imposto.aliquota|comma }}</TributoAliquota> |
|
||||
<TributoValor>{{ imposto.valor|comma }}</TributoValor> |
|
||||
</Reg30Item> |
|
||||
</Reg30> |
|
||||
{% endfor %} |
|
||||
</Reg20Item> |
|
||||
</Reg20> |
|
||||
{% endfor %} |
|
||||
<Reg90> |
|
||||
<QtdRegNormal>{{ nfse.lista_rps|length }}</QtdRegNormal> |
|
||||
<ValorNFS>{{ nfse.lista_rps|sum(attribute='valor_liquido_nfse')|comma }}</ValorNFS> |
|
||||
<ValorISS>{{ nfse.lista_rps|sum(attribute='valor_iss')|comma }}</ValorISS> |
|
||||
<ValorDed>{{ nfse.lista_rps|sum(attribute='valor_deducao')|comma }}</ValorDed> |
|
||||
<ValorIssRetTom>{{ nfse.lista_rps|sum(attribute='valor_iss_retido')|comma }}</ValorIssRetTom> |
|
||||
<QtdReg30>{{ nfse.quantidade_impostos }}</QtdReg30> |
|
||||
<ValorTributos>{{ nfse.valor_tributos|comma }}</ValorTributos> |
|
||||
</Reg90> |
|
||||
</SDTRPS> |
|
||||
</Sdt_processarpsin> |
|
||||
</ws_nfe.PROCESSARPS> |
|
||||
@ -1,5 +0,0 @@ |
|||||
<Envelope xmlns="http://schemas.xmlsoap.org/soap/envelope/"> |
|
||||
<Body> |
|
||||
{{ soap_body }} |
|
||||
</Body> |
|
||||
</Envelope> |
|
||||
@ -0,0 +1,297 @@ |
|||||
|
<?xml version="1.0" encoding="utf-8"?> |
||||
|
<xs:schema xmlns:ds="http://www.w3.org/2000/09/xmldsig#" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns="http://www.portalfiscal.inf.br/nfe" targetNamespace="http://www.portalfiscal.inf.br/nfe" elementFormDefault="qualified" attributeFormDefault="unqualified"> |
||||
|
<xs:simpleType name="TNSU"> |
||||
|
<xs:annotation> |
||||
|
<xs:documentation>Tipo número sequencial único</xs:documentation> |
||||
|
</xs:annotation> |
||||
|
<xs:restriction base="xs:token"> |
||||
|
<xs:pattern value="[0-9]{15}"/> |
||||
|
</xs:restriction> |
||||
|
</xs:simpleType> |
||||
|
<xs:simpleType name="TQNSU"> |
||||
|
<xs:annotation> |
||||
|
<xs:documentation>Tipo quantidade de NSU</xs:documentation> |
||||
|
</xs:annotation> |
||||
|
<xs:restriction base="xs:unsignedShort"> |
||||
|
<xs:minInclusive value="1"/> |
||||
|
<xs:maxInclusive value="50"/> |
||||
|
</xs:restriction> |
||||
|
</xs:simpleType> |
||||
|
<xs:simpleType name="TVerDistDFe"> |
||||
|
<xs:annotation> |
||||
|
<xs:documentation>Tipo Versão dos leiautes do Web Service NFeDistribuicaoDFe</xs:documentation> |
||||
|
</xs:annotation> |
||||
|
<xs:restriction base="xs:string"> |
||||
|
<xs:whiteSpace value="preserve"/> |
||||
|
<xs:enumeration value="1.01"/> |
||||
|
</xs:restriction> |
||||
|
</xs:simpleType> |
||||
|
<xs:simpleType name="TAmb"> |
||||
|
<xs:annotation> |
||||
|
<xs:documentation>Tipo Ambiente</xs:documentation> |
||||
|
</xs:annotation> |
||||
|
<xs:restriction base="xs:string"> |
||||
|
<xs:whiteSpace value="preserve"/> |
||||
|
<xs:enumeration value="1"/> |
||||
|
<xs:enumeration value="2"/> |
||||
|
</xs:restriction> |
||||
|
</xs:simpleType> |
||||
|
<xs:simpleType name="TCodUfIBGE"> |
||||
|
<xs:annotation> |
||||
|
<xs:documentation>Tipo Código da UF da tabela do IBGE</xs:documentation> |
||||
|
</xs:annotation> |
||||
|
<xs:restriction base="xs:string"> |
||||
|
<xs:whiteSpace value="preserve"/> |
||||
|
<xs:enumeration value="11"/> |
||||
|
<xs:enumeration value="12"/> |
||||
|
<xs:enumeration value="13"/> |
||||
|
<xs:enumeration value="14"/> |
||||
|
<xs:enumeration value="15"/> |
||||
|
<xs:enumeration value="16"/> |
||||
|
<xs:enumeration value="17"/> |
||||
|
<xs:enumeration value="21"/> |
||||
|
<xs:enumeration value="22"/> |
||||
|
<xs:enumeration value="23"/> |
||||
|
<xs:enumeration value="24"/> |
||||
|
<xs:enumeration value="25"/> |
||||
|
<xs:enumeration value="26"/> |
||||
|
<xs:enumeration value="27"/> |
||||
|
<xs:enumeration value="28"/> |
||||
|
<xs:enumeration value="29"/> |
||||
|
<xs:enumeration value="31"/> |
||||
|
<xs:enumeration value="32"/> |
||||
|
<xs:enumeration value="33"/> |
||||
|
<xs:enumeration value="35"/> |
||||
|
<xs:enumeration value="41"/> |
||||
|
<xs:enumeration value="42"/> |
||||
|
<xs:enumeration value="43"/> |
||||
|
<xs:enumeration value="50"/> |
||||
|
<xs:enumeration value="51"/> |
||||
|
<xs:enumeration value="52"/> |
||||
|
<xs:enumeration value="53"/> |
||||
|
</xs:restriction> |
||||
|
</xs:simpleType> |
||||
|
<xs:simpleType name="TCOrgaoIBGE"> |
||||
|
<xs:annotation> |
||||
|
<xs:documentation>Tipo Código de orgão (UF da tabela do IBGE + 90 RFB)</xs:documentation> |
||||
|
</xs:annotation> |
||||
|
<xs:restriction base="xs:string"> |
||||
|
<xs:whiteSpace value="preserve"/> |
||||
|
<xs:enumeration value="11"/> |
||||
|
<xs:enumeration value="12"/> |
||||
|
<xs:enumeration value="13"/> |
||||
|
<xs:enumeration value="14"/> |
||||
|
<xs:enumeration value="15"/> |
||||
|
<xs:enumeration value="16"/> |
||||
|
<xs:enumeration value="17"/> |
||||
|
<xs:enumeration value="21"/> |
||||
|
<xs:enumeration value="22"/> |
||||
|
<xs:enumeration value="23"/> |
||||
|
<xs:enumeration value="24"/> |
||||
|
<xs:enumeration value="25"/> |
||||
|
<xs:enumeration value="26"/> |
||||
|
<xs:enumeration value="27"/> |
||||
|
<xs:enumeration value="28"/> |
||||
|
<xs:enumeration value="29"/> |
||||
|
<xs:enumeration value="31"/> |
||||
|
<xs:enumeration value="32"/> |
||||
|
<xs:enumeration value="33"/> |
||||
|
<xs:enumeration value="35"/> |
||||
|
<xs:enumeration value="41"/> |
||||
|
<xs:enumeration value="42"/> |
||||
|
<xs:enumeration value="43"/> |
||||
|
<xs:enumeration value="50"/> |
||||
|
<xs:enumeration value="51"/> |
||||
|
<xs:enumeration value="52"/> |
||||
|
<xs:enumeration value="53"/> |
||||
|
<xs:enumeration value="90"/> |
||||
|
<xs:enumeration value="91"/> |
||||
|
<xs:enumeration value="92"/> |
||||
|
</xs:restriction> |
||||
|
</xs:simpleType> |
||||
|
<xs:simpleType name="TCnpj"> |
||||
|
<xs:annotation> |
||||
|
<xs:documentation>Tipo Número do CNPJ</xs:documentation> |
||||
|
</xs:annotation> |
||||
|
<xs:restriction base="xs:string"> |
||||
|
<xs:whiteSpace value="preserve"/> |
||||
|
<xs:maxLength value="14"/> |
||||
|
<xs:pattern value="[0-9]{14}"/> |
||||
|
</xs:restriction> |
||||
|
</xs:simpleType> |
||||
|
<xs:simpleType name="TCpf"> |
||||
|
<xs:annotation> |
||||
|
<xs:documentation>Tipo Número do CPF</xs:documentation> |
||||
|
</xs:annotation> |
||||
|
<xs:restriction base="xs:string"> |
||||
|
<xs:whiteSpace value="preserve"/> |
||||
|
<xs:maxLength value="11"/> |
||||
|
<xs:pattern value="[0-9]{11}"/> |
||||
|
</xs:restriction> |
||||
|
</xs:simpleType> |
||||
|
<xs:simpleType name="TVerAplic"> |
||||
|
<xs:annotation> |
||||
|
<xs:documentation>Tipo Versão do Aplicativo</xs:documentation> |
||||
|
</xs:annotation> |
||||
|
<xs:restriction base="TString"> |
||||
|
<xs:minLength value="1"/> |
||||
|
<xs:maxLength value="20"/> |
||||
|
</xs:restriction> |
||||
|
</xs:simpleType> |
||||
|
<xs:simpleType name="TStat"> |
||||
|
<xs:annotation> |
||||
|
<xs:documentation>Tipo Código da Mensagem enviada</xs:documentation> |
||||
|
</xs:annotation> |
||||
|
<xs:restriction base="xs:string"> |
||||
|
<xs:whiteSpace value="preserve"/> |
||||
|
<xs:maxLength value="3"/> |
||||
|
<xs:pattern value="[0-9]{3}"/> |
||||
|
</xs:restriction> |
||||
|
</xs:simpleType> |
||||
|
<xs:simpleType name="TMotivo"> |
||||
|
<xs:annotation> |
||||
|
<xs:documentation>Tipo Motivo</xs:documentation> |
||||
|
</xs:annotation> |
||||
|
<xs:restriction base="TString"> |
||||
|
<xs:maxLength value="255"/> |
||||
|
<xs:minLength value="1"/> |
||||
|
</xs:restriction> |
||||
|
</xs:simpleType> |
||||
|
<xs:simpleType name="TString"> |
||||
|
<xs:annotation> |
||||
|
<xs:documentation> Tipo string genérico</xs:documentation> |
||||
|
</xs:annotation> |
||||
|
<xs:restriction base="xs:string"> |
||||
|
<xs:whiteSpace value="preserve"/> |
||||
|
<xs:pattern value="[!-ÿ]{1}[ -ÿ]{0,}[!-ÿ]{1}|[!-ÿ]{1}"/> |
||||
|
</xs:restriction> |
||||
|
</xs:simpleType> |
||||
|
<xs:simpleType name="TChNFe"> |
||||
|
<xs:annotation> |
||||
|
<xs:documentation>Tipo Chave da Nota Fiscal Eletrônica</xs:documentation> |
||||
|
</xs:annotation> |
||||
|
<xs:restriction base="xs:string"> |
||||
|
<xs:whiteSpace value="preserve"/> |
||||
|
<xs:maxLength value="44"/> |
||||
|
<xs:pattern value="[0-9]{44}"/> |
||||
|
</xs:restriction> |
||||
|
</xs:simpleType> |
||||
|
<xs:simpleType name="TProt"> |
||||
|
<xs:annotation> |
||||
|
<xs:documentation>Tipo Número do Protocolo de Status</xs:documentation> |
||||
|
</xs:annotation> |
||||
|
<xs:restriction base="xs:string"> |
||||
|
<xs:whiteSpace value="preserve"/> |
||||
|
<xs:maxLength value="15"/> |
||||
|
<xs:pattern value="[0-9]{15}"/> |
||||
|
</xs:restriction> |
||||
|
</xs:simpleType> |
||||
|
<xs:simpleType name="TDateTimeUTC"> |
||||
|
<xs:annotation> |
||||
|
<xs:documentation>Data e Hora, formato UTC (AAAA-MM-DDThh:mm:ssTZD, onde TZD = +hh:mm ou -hh:mm)</xs:documentation> |
||||
|
</xs:annotation> |
||||
|
<xs:restriction base="xs:string"> |
||||
|
<xs:whiteSpace value="preserve"/> |
||||
|
<xs:pattern value="(((20(([02468][048])|([13579][26]))-02-29))|(20[0-9][0-9])-((((0[1-9])|(1[0-2]))-((0[1-9])|(1\d)|(2[0-8])))|((((0[13578])|(1[02]))-31)|(((0[1,3-9])|(1[0-2]))-(29|30)))))T(20|21|22|23|[0-1]\d):[0-5]\d:[0-5]\d([\-,\+](0[0-9]|10|11):00|([\+](12):00))"/> |
||||
|
</xs:restriction> |
||||
|
</xs:simpleType> |
||||
|
<xs:simpleType name="TIe"> |
||||
|
<xs:annotation> |
||||
|
<xs:documentation>Tipo Inscrição Estadual do Emitente // alterado EM 24/10/08 para aceitar ISENTO</xs:documentation> |
||||
|
</xs:annotation> |
||||
|
<xs:restriction base="xs:string"> |
||||
|
<xs:whiteSpace value="preserve"/> |
||||
|
<xs:maxLength value="14"/> |
||||
|
<xs:pattern value="[0-9]{2,14}|ISENTO"/> |
||||
|
</xs:restriction> |
||||
|
</xs:simpleType> |
||||
|
<xs:simpleType name="TDec_1302"> |
||||
|
<xs:annotation> |
||||
|
<xs:documentation>Tipo Decimal com 15 dígitos, sendo 13 de corpo e 2 decimais</xs:documentation> |
||||
|
</xs:annotation> |
||||
|
<xs:restriction base="xs:string"> |
||||
|
<xs:whiteSpace value="preserve"/> |
||||
|
<xs:pattern value="0|0\.[0-9]{2}|[1-9]{1}[0-9]{0,12}(\.[0-9]{2})?"/> |
||||
|
</xs:restriction> |
||||
|
</xs:simpleType> |
||||
|
<xs:element name="distDFeInt"> |
||||
|
<xs:annotation> |
||||
|
<xs:documentation>Schema de pedido de distribuição de DF-e de interesse</xs:documentation> |
||||
|
</xs:annotation> |
||||
|
<xs:complexType> |
||||
|
<xs:sequence> |
||||
|
<xs:element name="tpAmb" type="TAmb"> |
||||
|
<xs:annotation> |
||||
|
<xs:documentation> |
||||
|
Identificação do Ambiente: |
||||
|
1 - Produção |
||||
|
2 - Homologação |
||||
|
</xs:documentation> |
||||
|
</xs:annotation> |
||||
|
</xs:element> |
||||
|
<xs:element name="cUFAutor" type="TCodUfIBGE" minOccurs="0"> |
||||
|
<xs:annotation> |
||||
|
<xs:documentation>Código da UF do Autor</xs:documentation> |
||||
|
</xs:annotation> |
||||
|
</xs:element> |
||||
|
<xs:choice> |
||||
|
<xs:element name="CNPJ" type="TCnpj"> |
||||
|
<xs:annotation> |
||||
|
<xs:documentation>CNPJ do interessado no DF-e</xs:documentation> |
||||
|
</xs:annotation> |
||||
|
</xs:element> |
||||
|
<xs:element name="CPF" type="TCpf"> |
||||
|
<xs:annotation> |
||||
|
<xs:documentation>CPF do interessado no DF-e</xs:documentation> |
||||
|
</xs:annotation> |
||||
|
</xs:element> |
||||
|
</xs:choice> |
||||
|
<xs:choice> |
||||
|
<xs:element name="distNSU"> |
||||
|
<xs:annotation> |
||||
|
<xs:documentation>Grupo para distribuir DF-e de interesse</xs:documentation> |
||||
|
</xs:annotation> |
||||
|
<xs:complexType> |
||||
|
<xs:sequence> |
||||
|
<xs:element name="ultNSU" type="TNSU"> |
||||
|
<xs:annotation> |
||||
|
<xs:documentation>Último NSU recebido pelo ator. Caso seja informado com zero, ou com um NSU muito antigo, a consulta retornará unicamente as informações resumidas e documentos fiscais eletrônicos que tenham sido recepcionados pelo Ambiente Nacional nos últimos 3 meses.</xs:documentation> |
||||
|
</xs:annotation> |
||||
|
</xs:element> |
||||
|
</xs:sequence> |
||||
|
</xs:complexType> |
||||
|
</xs:element> |
||||
|
<xs:element name="consNSU"> |
||||
|
<xs:annotation> |
||||
|
<xs:documentation>Grupo para consultar um DF-e a partir de um NSU específico</xs:documentation> |
||||
|
</xs:annotation> |
||||
|
<xs:complexType> |
||||
|
<xs:sequence> |
||||
|
<xs:element name="NSU" type="TNSU"> |
||||
|
<xs:annotation> |
||||
|
<xs:documentation>Número Sequencial Único. Geralmente esta consulta será utilizada quando identificado pelo interessado um NSU faltante. O Web Service retornará o documento ou informará que o NSU não existe no Ambiente Nacional. Assim, esta consulta fechará a lacuna do NSU identificado como faltante.</xs:documentation> |
||||
|
</xs:annotation> |
||||
|
</xs:element> |
||||
|
</xs:sequence> |
||||
|
</xs:complexType> |
||||
|
</xs:element> |
||||
|
<xs:element name="consChNFe"> |
||||
|
<xs:annotation> |
||||
|
<xs:documentation>Grupo para consultar uma NF-e a partir da chave de acesso</xs:documentation> |
||||
|
</xs:annotation> |
||||
|
<xs:complexType> |
||||
|
<xs:sequence> |
||||
|
<xs:element name="chNFe" type="TChNFe"> |
||||
|
<xs:annotation> |
||||
|
<xs:documentation>Chave de acesso da NF-e a ser consultada</xs:documentation> |
||||
|
</xs:annotation> |
||||
|
</xs:element> |
||||
|
</xs:sequence> |
||||
|
</xs:complexType> |
||||
|
</xs:element> |
||||
|
</xs:choice> |
||||
|
</xs:sequence> |
||||
|
<xs:attribute name="versao" type="TVerDistDFe" use="required"/> |
||||
|
</xs:complexType> |
||||
|
</xs:element> |
||||
|
</xs:schema> |
||||
Write
Preview
Loading…
Cancel
Save
Reference in new issue