WSRC consultar remito

REM igual para todos los remitos, usar rcversión para seleccionar servidor cárnico o harinero.

Dim fe As New WSAFIPFE.Factura

Dim bresultado As Boolean = True

If fe.iniciar(0, "cuit", "ruta y archivo al certificado AFIP *.pfx", "archivo de licencia no es necesario en modo prueba") Then

fe.ArchivoCertificadoPassword = "contraseña generada al crear *.pfx"

If fe.rcObtenerTicketAcceso() Then

bresultado = True

bresultado = fe.rcCargarPropiedad("LIMPIAR", "", 0, 0)

fe.ArchivoXMLEnviado = "d:\rcconsulta.xml"

fe.ArchivoXMLRecibido = "d:\rcrecibido.xml"

rem consultar un remito por tipo de comprobante, punto de emision, numero-

If bresultado Then

bresultado = fe.rcConsultarRemito("", "", "195", "1", "1234", "")

If fe.UltimoMensajeError = "" And fe.rcErrorDescripcion1 = "" Then

MsgBox("resultado " + fe.rcLeerPropiedad("rcConsultarRemito", "remito.datosemision.codAutorizacion", "", 0, 0))

MsgBox("resultado " + fe.rcLeerPropiedad("rcConsultarRemito", "remito.estado", "", 0, 0))

Else

MsgBox("error leer" + fe.UltimoMensajeError)

MsgBox("error del servidor " + fe.rcErrorDescripcion1)

End If

Else

MsgBox("fallo cargar propiedad " + fe.UltimoMensajeError)

End If

rem consultar un remito por código de remito (obtenido a generarlo junto con el numero)

If bresultado Then

bresultado = fe.rcConsultarRemito("123456", "", "", "", "", "")

If fe.UltimoMensajeError = "" And fe.rcErrorDescripcion1 = "" Then

MsgBox("resultado " + fe.rcLeerPropiedad("rcConsultarRemito", "remito.datosemision.codAutorizacion", "", 0, 0))

MsgBox("resultado " + fe.rcLeerPropiedad("rcConsultarRemito", "remito.estado", "", 0, 0))

MsgBox("qr " + fe.rcLeerPropiedad("rcConsultarRemito", "qr", "d:\imagen.jpg", 0, 0))

Else

MsgBox("error leer" + fe.UltimoMensajeError)

MsgBox("error del servidor " + fe.rcErrorDescripcion1)

End If

Else

MsgBox("fallo cargar propiedad " + fe.UltimoMensajeError)

End If

rem consultar un remito por identificador único usado al generar el remito, es obligatorio junto con el identificador aportar el tipo de comprobante y punto de emisión y el cuit emisor

If bresultado Then

bresultado = fe.rcConsultarRemito("", "123456", "tipodecomprobante", "puntodeemision", "", "cuit emisor")

If fe.UltimoMensajeError = "" And fe.rcErrorDescripcion1 = "" Then

MsgBox("resultado " + fe.rcLeerPropiedad("rcConsultarRemito", "remito.datosemision.codAutorizacion", "", 0, 0))

MsgBox("resultado " + fe.rcLeerPropiedad("rcConsultarRemito", "remito.estado", "", 0, 0))

MsgBox("qr " + fe.rcLeerPropiedad("rcConsultarRemito", "qr", "d:\imagen.jpg", 0, 0))

Else

MsgBox("error leer" + fe.UltimoMensajeError)

MsgBox("error del servidor " + fe.rcErrorDescripcion1)

End If

Else

MsgBox("fallo cargar propiedad " + fe.UltimoMensajeError)

End If

Else

MsgBox("fallo acceso " + fe.UltimoMensajeError)

End If

Else

MsgBox("fallo iniciar " + fe.UltimoMensajeError)

End If

rem remito harinero por simplicidad el orden de los filtros en los argumentos del rcConsultarremito respeta el orden del remito cárnico aunque en el PDF de remito harinero son diferentes

Dim fe As New WSAFIPFE.Factura

Dim bresultado As Boolean = True

If fe.iniciar(0, "cuit", "ruta y archivo al certificado AFIP *.pfx", "archivo de licencia no es necesario en modo prueba") Then

fe.rcversion = 1

fe.ArchivoCertificadoPassword = "contraseña generada al crear *.pfx"

If fe.rcObtenerTicketAcceso() Then

bresultado = True

bresultado = fe.rcCargarPropiedad("LIMPIAR", "", 0, 0)

fe.ArchivoXMLEnviado = "d:\rcconsulta.xml"

fe.ArchivoXMLRecibido = "d:\rcrecibido.xml"

rem consultar un remito por tipo de comprobante, punto de emision, numero y cuit emisor

If bresultado Then

bresultado = fe.rcConsultarRemito("", "", "195", "1", "1234", "cuit emisor")

If fe.UltimoMensajeError = "" And fe.rcErrorDescripcion1 = "" Then

MsgBox("resultado " + fe.rcLeerPropiedad("rcConsultarRemito", "remito.datosemision.codAutorizacion", "", 0, 0))

MsgBox("resultado " + fe.rcLeerPropiedad("rcConsultarRemito", "remito.estado", "", 0, 0))

Else

MsgBox("error leer" + fe.UltimoMensajeError)

MsgBox("error del servidor " + fe.rcErrorDescripcion1)

End If

Else

MsgBox("fallo cargar propiedad " + fe.UltimoMensajeError)

End If

rem consultar un remito por código de remito (obtenido a generarlo junto con el numero)

If bresultado Then

bresultado = fe.rcConsultarRemito("123456", "", "", "", "", "")

If fe.UltimoMensajeError = "" And fe.rcErrorDescripcion1 = "" Then

MsgBox("resultado " + fe.rcLeerPropiedad("rcConsultarRemito", "remito.datosemision.codAutorizacion", "", 0, 0))

MsgBox("resultado " + fe.rcLeerPropiedad("rcConsultarRemito", "remito.estado", "", 0, 0))

MsgBox("qr " + fe.rcLeerPropiedad("rcConsultarRemito", "qr", "d:\imagen.jpg", 0, 0))

Else

MsgBox("error leer" + fe.UltimoMensajeError)

MsgBox("error del servidor " + fe.rcErrorDescripcion1)

End If

Else

MsgBox("fallo cargar propiedad " + fe.UltimoMensajeError)

End If

rem consultar un remito por identificador único usado al generar el remito, es obligatorio junto con el identificador aportar el tipo de comprobante y punto de emisión.

If bresultado Then

bresultado = fe.rcConsultarRemito("", "123456", "tipodecomprobante", "puntodeemision", "", "")

If fe.UltimoMensajeError = "" And fe.rcErrorDescripcion1 = "" Then

MsgBox("resultado " + fe.rcLeerPropiedad("rcConsultarRemito", "remito.datosemision.codAutorizacion", "", 0, 0))

MsgBox("resultado " + fe.rcLeerPropiedad("rcConsultarRemito", "remito.estado", "", 0, 0))

MsgBox("qr " + fe.rcLeerPropiedad("rcConsultarRemito", "qr", "d:\imagen.jpg", 0, 0))

Else

MsgBox("error leer" + fe.UltimoMensajeError)

MsgBox("error del servidor " + fe.rcErrorDescripcion1)

End If

Else

MsgBox("fallo cargar propiedad " + fe.UltimoMensajeError)

End If

Else

MsgBox("fallo acceso " + fe.UltimoMensajeError)

End If

Else

MsgBox("fallo iniciar " + fe.UltimoMensajeError)

End If