WSRC ejemplo emitir remito
rem remito cárnico
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)
bresultado = bresultado And fe.rcCargarPropiedad("viaje.cuitConductor", "20235709490", 0, 0)
bresultado = bresultado And fe.rcCargarPropiedad("viaje.cuitTransportista", "20235709490", 0, 0)
bresultado = bresultado And fe.rcCargarPropiedad("viaje.distanciaKm", "500.25", 0, 0)
bresultado = bresultado And fe.rcCargarPropiedad("viaje.fechaInicioViaje", "20181020", 0, 0)
bresultado = bresultado And fe.rcCargarPropiedad("viaje.vehiculo.dominioVehiculo", "ABC123", 0, 0)
bresultado = bresultado And fe.rcCargarPropiedad("viaje.vehiculo.dominioAcoplado", "ABC123", 0, 0)
fe.ArchivoXMLEnviado = "d:\rcemiir.xml"
fe.ArchivoXMLRecibido = "d:\rcemitirrecibo.xml"
If bresultado Then
bresultado = fe.rcEmitirRemito("codigo remito")
If fe.UltimoMensajeError = "" And fe.rcErrorDescripcion1 = "" Then
MsgBox("resultado " + fe.rcLeerPropiedad("rcemitirremito", "resultado", "", 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
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 = fe.rcCargarPropiedad("LIMPIAR", "", 0, 0)
bresultado = bresultado And fe.rcCargarPropiedad("viaje.distanciaKm", "500.25", 0, 0)
bresultado = bresultado And fe.rcCargarPropiedad("viaje.fechaInicioViaje", "20190509", 0, 0)
bresultado = bresultado And fe.rcCargarPropiedad("viaje.vehiculo.ferroviario.arrayIdLocomotora.itemcantidad", "3", 0, 0)
bresultado = bresultado And fe.rcCargarPropiedad("viaje.vehiculo.ferroviario.arrayIdLocomotora", "A", 0, 0)
bresultado = bresultado And fe.rcCargarPropiedad("viaje.vehiculo.ferroviario.arrayIdLocomotora", "B", 1, 0)
bresultado = bresultado And fe.rcCargarPropiedad("viaje.vehiculo.ferroviario.arrayIdLocomotora", "C", 2, 0)
bresultado = bresultado And fe.rcCargarPropiedad("viaje.vehiculo.ferroviario.arrayIdVagon.itemcantidad", "2", 0, 0)
bresultado = bresultado And fe.rcCargarPropiedad("viaje.vehiculo.ferroviario.arrayIdVagon", "A", 0, 0)
bresultado = bresultado And fe.rcCargarPropiedad("viaje.vehiculo.ferroviario.arrayIdVagon", "B", 1, 0)
REM o vehiculo ferroviario o automotor no ambos
REM bresultado = bresultado And fe.rcCargarPropiedad("viaje.vehiculo.automotor.arrayDominioAcoplado.itemcantidad", "3", 0, 0)
REM bresultado = bresultado And fe.rcCargarPropiedad("viaje.vehiculo.automotor.arrayDominioAcoplado", "A", 0, 0)
REM bresultado = bresultado And fe.rcCargarPropiedad("viaje.vehiculo.automotor.arrayDominioAcoplado", "B", 1, 0)
REM bresultado = bresultado And fe.rcCargarPropiedad("viaje.vehiculo.automotor.arrayDominioAcoplado", "C", 2, 0)
REM bresultado = bresultado And fe.rcCargarPropiedad("viaje.vehiculo.automotor.cuitconductor", "20235709490", 0, 0)
REM bresultado = bresultado And fe.rcCargarPropiedad("viaje.vehiculo.automotor.dominiovehiculo", "ABC949", 0, 0)
If bresultado Then
bresultado = fe.rcEmitirRemito("202357")
If fe.UltimoMensajeError = "" And fe.rcErrorDescripcion1 = "" Then
MsgBox("resultado " + fe.rcLeerPropiedad("rcEmitirRemito", "resultado", "", 0, 0))
MsgBox("codrem " + fe.rcLeerPropiedad("rcEmitirRemito", "remitooutput.codremito", "", 0, 0))
MsgBox("codigo " + fe.rcLeerPropiedad("rcEmitirRemito", "remitoOutput.datosAutAFIP.codautorizacion", "", 0, 0))
MsgBox("codigo " + fe.rcLeerPropiedad("rcEmitirRemito", "remitoOutput.datosAutAFIP.fechavencimiento", "", 0, 0))
MsgBox("imange " + fe.rcLeerPropiedad("rcEmitirRemito", "qr", "d:\remito.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 azucar
Dim fe As New WSAFIPFE.Factura
Dim bresultado As Boolean = True
Dim strticket As String = ""
Dim cnumero As String = ""
If fe.iniciar(0, "cuit emisor", "ruta archivo certificado.pfx", "") Then
fe.rcVersion = 2
fe.ArchivoXMLEnviado = "d:\raemitir.xml"
fe.ArchivoXMLRecibido = "d:\rcemitir.xml"
fe.ArchivoCertificadoPassword = ""
If fe.rcObtenerTicketAcceso() Then
bresultado = fe.rcCargarPropiedad("LIMPIAR", "", 0, 0)
bresultado = bresultado And fe.rcCargarPropiedad("emitirremito.codigoremito", "156556", 0, 0)
bresultado = bresultado And fe.rcCargarPropiedad("emitirremito.dominioAcoplado", "ABC123", 0, 0)
bresultado = bresultado And fe.rcCargarPropiedad("emitirremito.dominioVehiculo", "ABC123", 0, 0)
bresultado = bresultado And fe.rcCargarPropiedad("emitirremito.fechaInicioViaje", "20191128", 0, 0)
bresultado = bresultado And fe.rcCargarPropiedad("emitirremito.fechaInicioViajeNO", "F", 0, 0)
REM bresultado = bresultado And fe.rcCargarPropiedad("emitirremito.conductor.conductornacional.cuitconductor", "20123456780", 0, 0)
REM bresultado = bresultado And fe.rcCargarPropiedad("emitirremito.conductor.conductornacional.cuitconductorNO", "f", 0, 0)
bresultado = bresultado And fe.rcCargarPropiedad("emitirremito.conductor.conductorextranjero.apellidoConductor", "smith", 0, 0)
bresultado = bresultado And fe.rcCargarPropiedad("emitirremito.conductor.conductorextranjero.cedulaConductor", "1234567", 0, 0)
bresultado = bresultado And fe.rcCargarPropiedad("emitirremito.conductor.conductorextranjero.nombreConductor", "john", 0, 0)
If bresultado Then
bresultado = fe.rcEmitirRemito("sin uso")
If fe.UltimoMensajeError = "" And fe.rcErrorDescripcion1 = "" Then
MsgBox("resultado " + fe.rcLeerPropiedad("rcEmitirRemito", "resultado", "", 0, 0))
MsgBox("codrem " + fe.rcLeerPropiedad("rcEmitirRemito", "remitodatosautorizacion.codremito", "", 0, 0))
Else
MsgBox("error leer" + fe.UltimoMensajeError)
MsgBox("error leer 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