Ejemplo n.º 1
0
def datos_afip(request, cuit):
    from pyafipws.wsaa import WSAA
    from pyafipws.ws_sr_padron import WSSrPadronA4
    empresa = empresa_actual(request)
    H**O = empresa.homologacion

    if H**O:
        WSDL = "https://wswhomo.afip.gov.ar/wsfev1/service.asmx?WSDL"
        WSAA_URL = "https://wsaahomo.afip.gov.ar/ws/services/LoginCms"
    else:
        WSDL = "https://servicios1.afip.gov.ar/wsfev1/service.asmx?WSDL"
        WSAA_URL = "https://wsaa.afip.gov.ar/ws/services/LoginCms"

    appserver_status = ''
    dbserver_status = ''
    authserver_status = ''
    #try:
    fecha = datetime.now().strftime("%Y%m%d")
    wsaa = WSAA()
    crt = empresa.fe_crt
    key = empresa.fe_key
    wsaa.Token, wsaa.Sign = _autenticar(request, crt=crt, key=key, cuit=cuit)
    #ta = wsaa.Autenticar("ws_sr_padron_a4",crt=crt,key=key,)

    padron = WSSrPadronA4()

    #padron.SetTicketAcceso(ta)
    padron.Cuit = empresa.cuit
    #padron.Conectar()

    ok = padron.Consultar(cuit)

    return padron
Ejemplo n.º 2
0
    def _get_ws(self, afip_ws):
        """
        Method to be inherited
        """
        ws = super(AfipwsConnection, self)._get_ws(afip_ws)
        if afip_ws == 'wsfe':
            from pyafipws.wsfev1 import WSFEv1
            ws = WSFEv1()
        elif afip_ws == "wsfex":
            from pyafipws.wsfexv1 import WSFEXv1
            ws = WSFEXv1()
        elif afip_ws == "wsmtxca":
            from pyafipws.wsmtx import WSMTXCA
            ws = WSMTXCA()
        elif afip_ws == "wscdc":
            from pyafipws.wscdc import WSCDC
            ws = WSCDC()
        elif afip_ws == "ws_sr_padron_a4":
            from pyafipws.ws_sr_padron import WSSrPadronA4
            ws = WSSrPadronA4()
            if self.type == 'production':
                ws.H**O = False
                ws.WSDL = "https://aws.afip.gov.ar/sr-padron/webservices/personaServiceA4?wsdl"
        elif afip_ws == "ws_sr_constancia_inscripcion":
            from pyafipws.ws_sr_padron import WSSrPadronA5
            ws = WSSrPadronA5()
            if self.type == 'production':
                ws.H**O = False
                ws.WSDL = "https://aws.afip.gov.ar/sr-padron/webservices/personaServiceA5?wsdl"

        return ws
Ejemplo n.º 3
0
 def _get_ws(self, afip_ws):
     """
     Method to be inherited
     """
     _logger.info('Getting ws %s from libraries ' % afip_ws)
     # por ahora el unico implementado es ws_sr_padron_a4
     ws = False
     if afip_ws == 'ws_sr_padron_a4':
         from pyafipws.ws_sr_padron import WSSrPadronA4
         ws = WSSrPadronA4()
     return ws