def on_menu_consultas_getCAE_click(self, event): self.verifica_ws() options = [ v for k, v in sorted([(k, v) for k, v in list(self.tipos.items())]) ] result = gui.single_choice( options, "Tipo de comprobante", "Consulta Comprobante", ) if not result: return tipocbte = [k for k, v in list(self.tipos.items()) if v == result][0] result = gui.prompt("Punto de venta", "Consulta Comprobante", '2') if not result: return ptovta = result result = gui.prompt("Nº de comprobante", "Consulta Comprobante", '2') if not result: return nrocbte = result try: if self.webservice == "wsfe": cae = 'no soportado' elif self.webservice == "wsfev1": cae = "%s (wsfev1)" % self.ws.CompConsultar( tipocbte, ptovta, nrocbte) self.log('CAE: %s' % self.ws.CAE) self.log('FechaCbte: %s' % self.ws.FechaCbte) self.log('PuntoVenta: %s' % self.ws.PuntoVenta) self.log('CbteNro: %s' % self.ws.CbteNro) self.log('ImpTotal: %s' % self.ws.ImpTotal) self.log('ImpNeto: %s' % self.ws.ImpNeto) self.log('ImptoLiq: %s' % self.ws.ImptoLiq) self.log('EmisionTipo: %s' % self.ws.EmisionTipo) elif self.webservice == "wsfexv1": cae = "%s (wsfexv1)" % self.ws.GetCMP(tipocbte, ptovta, nrocbte) self.log('CAE: %s' % self.ws.CAE) self.log('FechaCbte: %s' % self.ws.FechaCbte) self.log('PuntoVenta: %s' % self.ws.PuntoVenta) self.log('CbteNro: %s' % self.ws.CbteNro) self.log('ImpTotal: %s' % self.ws.ImpTotal) gui.alert( "CAE: %s\n" "Tipo: %s (%s)\nPunto de Venta: %s\nNumero: %s\nFecha: %s" % (cae, self.tipos[tipocbte], tipocbte, ptovta, nrocbte, self.ws.FechaCbte), 'Consulta Comprobante') except SoapFault as e: self.log(self.client.xml_request) self.log(self.client.xml_response) self.error(e.faultcode, e.faultstring.encode("ascii", "ignore")) except Exception as e: self.error('Excepción', str(str(e), "latin1", "ignore"))
def on_menu_consultas_lastCBTE_click(self, event): ##self.verifica_ws() options = [ v for k, v in sorted([(k, v) for k, v in list(self.tipos.items())]) ] result = gui.single_choice( options, "Tipo de comprobante", "Consulta Último Nro. Comprobante", ) if not result: return tipocbte = [k for k, v in list(self.tipos.items()) if v == result][0] result = gui.prompt("Punto de venta", "Consulta Último Nro. Comprobante", '2') if not result: return ptovta = result try: if self.webservice == "wsfev1": ultcmp = "%s (wsfev1)" % self.ws.CompUltimoAutorizado( tipocbte, ptovta) elif self.webservice == "wsfexv1": ultcmp = "%s (wsfexv1)" % self.ws.GetLastCMP(tipocbte, ptovta) gui.alert( "Último comprobante: %s\n" "Tipo: %s (%s)\nPunto de Venta: %s" % (ultcmp, self.tipos[tipocbte], tipocbte, ptovta), 'Consulta Último Nro. Comprobante') except SoapFault as e: self.log(self.client.xml_request) self.log(self.client.xml_response) self.error(e.faultcode, e.faultstring.encode("ascii", "ignore")) except Exception as e: self.error('Excepción', str(str(e), "latin1", "ignore"))
def save_entropy(): gui.prompt("Security", "Do you want to encrypt your key?", save_entropy_encrypted, save_entropy_plain)