La función TimbrarCFD() Parte 6
Publicado: Dom Mar 25, 2012 6:11 pm
Vamos a timbrar el XML creado
Para eso necesitamos el archivo ini con la conexión al PAC de Ecodex
Agregamos la función TimbrarCFD(Application.StartupPath & "\TimbradoEcodex.ini")
Así es como debe quedar
Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click
GeneraCFD(Application.StartupPath & "\FacturaEcodex.ini", "a0123456789")
If GetError().ToString.Length > 0 Then
MsgBox(GetError() & " " & GetErrorExt(), vbInformation, "Aviso")
Else
TimbrarCFD(Application.StartupPath & "\TimbradoEcodex.ini")
If GetError().ToString.Length > 0 Then
MsgBox(GetError() & " " & GetErrorExt(), vbInformation, "Aviso")
Else
MsgBox("Se ha timbrado el XML", vbInformation, "Aviso")
End If
End If
End Sub
Declaramos la función TimbrarCFD()
<Runtime.InteropServices.DllImport("CFDLib.dll", Charset:=Runtime.InteropServices.CharSet.Ansi, SetLastError:=True, ExactSpelling:=True, Entrypoint:="TimbrarCFD")> _
Public Shared Function TimbrarCFD(ByVal nxml As String) As String
End Function
Ya solo falta Compilar y listo !.
Tendrás el XML timbrado.
Para eso necesitamos el archivo ini con la conexión al PAC de Ecodex
Agregamos la función TimbrarCFD(Application.StartupPath & "\TimbradoEcodex.ini")
Así es como debe quedar
Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click
GeneraCFD(Application.StartupPath & "\FacturaEcodex.ini", "a0123456789")
If GetError().ToString.Length > 0 Then
MsgBox(GetError() & " " & GetErrorExt(), vbInformation, "Aviso")
Else
TimbrarCFD(Application.StartupPath & "\TimbradoEcodex.ini")
If GetError().ToString.Length > 0 Then
MsgBox(GetError() & " " & GetErrorExt(), vbInformation, "Aviso")
Else
MsgBox("Se ha timbrado el XML", vbInformation, "Aviso")
End If
End If
End Sub
Declaramos la función TimbrarCFD()
<Runtime.InteropServices.DllImport("CFDLib.dll", Charset:=Runtime.InteropServices.CharSet.Ansi, SetLastError:=True, ExactSpelling:=True, Entrypoint:="TimbrarCFD")> _
Public Shared Function TimbrarCFD(ByVal nxml As String) As String
End Function
Ya solo falta Compilar y listo !.
Tendrás el XML timbrado.