Giter VIP home page Giter VIP logo

erpbrasil.edoc's Introduction

Website

This website is built using Docusaurus 2, a modern static website generator.

Installation

yarn install

Local Development

yarn start

This command starts a local development server and open up a browser window. Most changes are reflected live without having to restart the server.

Build

yarn build

This command generates static content into the build directory and can be served using any static contents hosting service.

Deployment

GIT_USER=<Your GitHub username> USE_SSH=true yarn deploy

If you are using GitHub pages for hosting, this command is a convenient way to build the website and push to the gh-pages branch.

erpbrasil.edoc's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

erpbrasil.edoc's Issues

Ao consultar a situação das NFS Paulistana gera este erro.

Screenshot from 2021-06-25 11-59-03

Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/odoo/http.py", line 656, in _handle_exception
return super(JsonRequest, self)._handle_exception(exception)
File "/usr/lib/python3/dist-packages/odoo/http.py", line 314, in _handle_exception
raise pycompat.reraise(type(exception), exception, sys.exc_info()[2])
File "/usr/lib/python3/dist-packages/odoo/tools/pycompat.py", line 87, in reraise
raise value
File "/usr/lib/python3/dist-packages/odoo/http.py", line 698, in dispatch
result = self._call_function(**self.params)
File "/usr/lib/python3/dist-packages/odoo/http.py", line 346, in _call_function
return checked_call(self.db, *args, **kwargs)
File "/usr/lib/python3/dist-packages/odoo/service/model.py", line 98, in wrapper
return f(dbname, *args, **kwargs)
File "/usr/lib/python3/dist-packages/odoo/http.py", line 339, in checked_call
result = self.endpoint(*a, **kw)
File "/usr/lib/python3/dist-packages/odoo/http.py", line 941, in call
return self.method(*args, **kw)
File "/usr/lib/python3/dist-packages/odoo/http.py", line 519, in response_wrap
response = f(*args, **kw)
File "/usr/lib/python3/dist-packages/odoo/addons/web/controllers/main.py", line 967, in call_button
action = self._call_kw(model, method, args, {})
File "/usr/lib/python3/dist-packages/odoo/addons/web/controllers/main.py", line 955, in _call_kw
return call_kw(request.env[model], method, args, kwargs)
File "/usr/lib/python3/dist-packages/odoo/api.py", line 759, in call_kw
return _call_kw_multi(method, model, args, kwargs)
File "/usr/lib/python3/dist-packages/odoo/api.py", line 746, in _call_kw_multi
result = method(recs, *args, **kwargs)
File "/usr/lib/python3/dist-packages/odoo/l10n-brazil/l10n_br_fiscal/wizards/document_status_wizard.py", line 24, in doit
return wizard.get_document_status()
File "/usr/lib/python3/dist-packages/odoo/l10n-brazil/l10n_br_fiscal/wizards/document_status_wizard.py", line 15, in get_document_status
"document_status": self.document_id._document_status(),
File "/usr/lib/python3/dist-packages/odoo/l10n-brazil/l10n_br_nfse_paulistana/models/document.py", line 362, in _document_status
consulta = processador.analisa_retorno_consulta(processo)
File "/usr/local/lib/python3.7/dist-packages/erpbrasil/edoc/provedores/paulistana.py", line 141, in analisa_retorno_consulta
retorno.find('.//CodigoVerificacao').text
AttributeError: 'NoneType' object has no attribute 'text'

Corrigir WARNING

Para arrumar depois:

2023-08-11 13:47:21,034 1 WARNING devel py.warnings: /usr/local/lib/python3.8/site-packages/erpbrasil/edoc/nfe.py:1035: FutureWarning: The behavior of this method will change in future versions. Use specific 'len(elem)' or 'elem is not None' test instead.
if nfe and protocolos:

Valor da tag digVal mal formatado

Ao analisar os XMLs das NF-es gerados percebi que existe um problema na tag digVal dentro de protNFe/infProt que o valor da tag esta com b'.....':

image

Não parece que seja um problema do nfelib porque o campo DigestValue dentro da tag Signature/SignedInfo/Reference/ tem o mesmo valor e esta sendo gerado corretamente:

image

Eu não investiguei muito, mas parece que o erro esta aqui: _generateds_to_string_etree, mais precisamente nesta linha https://github.com/erpbrasil/erpbrasil.edoc/blob/master/src/erpbrasil/edoc/edoc.py#L44 que pela documentação, parece que esta faltando o parametro encoding:

image

Erro ao validar NF-e

Durante a execução da função abaixo, a variável match se mantem com valor None, não sendo possível emitir a NFe.

def analisar_retorno_raw(operacao, raiz, xml, retorno, classe):
    retorno.raise_for_status()
    match = re.search('<soap:Body>(.*?)</soap:Body>',
                      retorno.text.replace('\n', ''))
    if match:
        xml_resposta = match.group(1)
        resultado = etree.tostring(etree.fromstring(xml_resposta)[0])
        classe.Validate_simpletypes_ = False
        resposta = classe.parseString(resultado, silence=True)
        return RetornoSoap(operacao, raiz, xml, retorno, resposta)

O método search utiliza como parâmetro pattern o valor '<soap:Body>(.*?)</soap:Body>'
Porém a variável retorno possui o seguinte conteúdo:

'<?xml version=\'1.0\' encoding=\'UTF-8\'?><S:Envelope xmlns:S="http://www.w3.org/2003/05/soap-envelope"><S:Body><nfeResultMsg xmlns="http://www.portalfiscal.inf.br/nfe/wsdl/NFeStatusServico4"><retConsStatServ xmlns="http://www.portalfiscal.inf.br/nfe" versao="4.00"><tpAmb>2</tpAmb><verAplic>W-3.0.27</verAplic><cStat>107</cStat><xMotivo>Servico em operacao</xMotivo><cUF>31</cUF><dhRecbto>2023-05-25T15:33:45-03:00</dhRecbto><dhRetorno>2023-05-25T15:33:45-03:00</dhRetorno></retConsStatServ></nfeResultMsg></S:Body></S:Envelope>'

Não existe a tag soap:Body porém existe <S:Body>

É algum erro na lib, ou seria algum do lado emissor da NFe?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.