Browse Source

unificado assinar lote

pull/7/head
Leonardo Tada 10 years ago
parent
commit
3c9e9223de
  1. 10
      pynfe/processamento/assinatura.py

10
pynfe/processamento/assinatura.py

@ -65,15 +65,13 @@ class AssinaturaA1(Assinatura):
except Exception as e: except Exception as e:
raise e raise e
def assinarNfse(self, xml, lote=False, retorna_string=True):
def assinarNfse(self, xml, retorna_string=True):
"Assina NFS-e"
try: try:
# define variaveis de acordo com autorizador # define variaveis de acordo com autorizador
if self.autorizador == 'ginfes' and not lote:
if self.autorizador == 'ginfes':
xpath = './/ns2:InfRps' xpath = './/ns2:InfRps'
tag = 'InfRps' tag = 'InfRps'
elif self.autorizador == 'ginfes' and lote:
xpath = './/ns1:LoteRps'
tag = 'LoteRps'
elif self.autorizador == 'betha': elif self.autorizador == 'betha':
xpath = './/ns1:InfDeclaracaoPrestacaoServico' xpath = './/ns1:InfDeclaracaoPrestacaoServico'
tag = 'InfDeclaracaoPrestacaoServico' tag = 'InfDeclaracaoPrestacaoServico'
@ -123,7 +121,9 @@ class AssinaturaA1(Assinatura):
raise e raise e
def assinarLote(self, xml, retorna_string=True): def assinarLote(self, xml, retorna_string=True):
"Assina nfse e lote"
try: try:
xml = self.assinarNfse(xml, retorna_string=False)
xpath = './/ns1:LoteRps' xpath = './/ns1:LoteRps'
tag = 'LoteRps' tag = 'LoteRps'
# define namespaces, pega do proprio xml # define namespaces, pega do proprio xml

Loading…
Cancel
Save