Lo agrege al codigo de esta forma no se si lo hice bien
Código PHP:
Public Sub cancelaFactura(ByVal letra As String, ByVal usuario As String, ByVal sucursal As String, ByVal cEmpresa As String, ByVal nNumero As Integer)
Dim cUsuario As String
Dim cSucursal As String
Dim cLetra As String
Dim ms As MySuite.MySuiteCFD
Dim m_con As New SqlConnection
Dim m_com As SqlCommand
cUsuario = usuario
cSucursal = sucursal
cLetra = letra
cLetra = cLetra.Substring(0)
cLetra = cLetra.Replace(".XML", "")
' Dim sSerieFolio() = cLetra.Split("-")
' If sSerieFolio.Length = 1 Then
'Exit Sub
' End If
Dim s As String
Dim contiene As Boolean
contiene = cLetra.Contains("-")
If contiene = True Then
Dim sSerieFolio() = cLetra.Split("-")
If Not String.IsNullOrEmpty(sSerieFolio(0)) AndAlso Not String.IsNullOrEmpty(sSerieFolio(1)) Then
ms = New MySuite.MySuiteCFD("f7941c77-eb0a-4427-bec8-8e625e9cf27b", "MX", "CMP101004CV6", cUsuario, cSucursal)
s = ms.cancelaFactura(sSerieFolio(0), sSerieFolio(1))
' s = ms.cancelaFactura(sSerieFolio(0), sSerieFolio(1))
m_con = New SqlConnection
m_con.ConnectionString = Me.conn.ConnectionString
m_con.Open()
m_com = m_con.CreateCommand()
m_com.CommandText = "UPDATE c_albven SET libre_2 = @mensaje WHERE empresa = '" & cEmpresa & "' AND numero = " & nNumero & " AND letra = '" & cLetra & ""
m_com.Parameters.AddWithValue("mensaje", s)
m_com.ExecuteNonQuery()
m_con.Close()
End If
End If
End Sub