REM regresoOrigenCPEAutomotor instalador 99 o superior
Dim fe As New WSAFIPFE.Factura
Dim bresultado As Boolean = True
If fe.iniciar(0, "cuit", "certificado pfx tramitado en AFIP", "") Then
fe.cpeverrsion = 0
REM ATENCION, ejecutar este método necesario para que la interfaz capture el trafico hacia y desde el servidor antes que el sistema operativo.
REM servidor WS CPE usa un formato incompatible y debe ser transformado para operar normalmente.
If fe.registrarTrafico(True) Then
Else
MsgBox("error capturar trafico " + fe.UltimoMensajeError)
End If
fe.cpeversion = 0
fe.ArchivoXMLEnviado = "d:\aenvio.xml"
fe.ArchivoXMLRecibido = "d:\arecibo.xml"
fe.ArchivoCertificadoPassword = ""
If fe.cpeObtenerTicketAcceso() Then
bResultado = bResultado And fe.cpeCargarPropiedad("LIMPIAR", "", 0, 0)
bResultado = bResultado And fe.cpeCargarPropiedad("RegresoAOrigenAutomotor.cartaPorte.nroOrden", "1", 0, 0)
bResultado = bResultado And fe.cpeCargarPropiedad("RegresoAOrigenAutomotor.cartaPorte.sucursal ", "1", 0, 0)
bResultado = bResultado And fe.cpeCargarPropiedad("RegresoAOrigenAutomotor.cartaPorte.tipoCPE", "74", 0, 0)
bResultado = bResultado And fe.cpeCargarPropiedad("RegresoAOrigenAutomotor.destinatario.cuit", "2011111112", 0, 0)
bResultado = bResultado And fe.cpeCargarPropiedad("RegresoAOrigenAutomotor.transporte.codigoturno", "01", 0, 0)
bResultado = bResultado And fe.cpeCargarPropiedad("RegresoAOrigenAutomotor.transporte.fechaHoraPartida", "202108261250", 0, 0)
bResultado = bResultado And fe.cpeCargarPropiedad("RegresoAOrigenAutomotor.transporte.kmRecorrer", "500", 0, 0)
If bresultado Then
bresultado = fe.cpeRegresarAOrigen()
If fe.UltimoMensajeError = "" And fe.cpeErrorDescripcion1 = "" Then
MsgBox("nro " + fe.cpeLeerPropiedad("cartaporte", "cabecera.nroCTG", "", 0, 0))
MsgBox("estado " + fe.cpeLeerPropiedad("cartaporte", "cabecera.estado", "", 0, 0))
MsgBox("PDF " + fe.cpeLeerPropiedad("cartaporte", "PDF", "d:\comprobante.pdf", 0, 0))
Else
MsgBox("error leer" + fe.UltimoMensajeError)
MsgBox("error ller servidor " + fe.cpeErrorDescripcion1)
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