VERSION 1.0 CLASS
BEGIN
  MultiUse = -1  'True
  Persistable = 0  'NotPersistable
  DataBindingBehavior = 0  'vbNone
  DataSourceBehavior  = 0  'vbNone
  MTSTransactionMode  = 0  'NotAnMTSObject
END
Attribute VB_Name = "Cls_envios"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = True
Attribute VB_PredeclaredId = False
Attribute VB_Exposed = True
Option Explicit

Public Sub Transferir_Solomon(Optional VarAux As Variant)

    Dim cmd As ADODB.Command
    Dim con As ADODB.Connection
    Dim StrSql As String

    On Error GoTo TrataError
        
    StrSql = " AR_APLICARPAGOS_TRANFERPROC "
        
    Set cmd = New ADODB.Command
    cmd.CommandText = StrSql
      
      
    Set con = New ADODB.Connection
    con.Open "FILEDSN=conexionsies"
    cmd.ActiveConnection = con
       
    cmd.Execute
    
    GetObjectContext.SetComplete
        
    Exit Sub
    
TrataError:
       
Dim LStrMensajeError As String
Dim LVarNumeroError As Variant

     If Not cmd Is Nothing Then
        Set cmd = Nothing
     End If
     If Not con Is Nothing Then
        LStrMensajeError = con.Errors(con.Errors.Count - 2).Description
        LVarNumeroError = con.Errors(con.Errors.Count - 2).NativeError
        Set con = Nothing
     End If
     
     GetObjectContext.SetAbort
     
     Err.Raise LVarNumeroError, "lib_trasmision.Transferir_Solomon", LStrMensajeError
   
End Sub

Public Function tablas_envioscentral(ByVal Str_MODULOID, Optional VarAux As Variant) As ADODB.Recordset
    Dim StrSql As String
    Dim rs As ADODB.Recordset
    
    On Error GoTo TrataError
    

    StrSql = " sh_tablas_enviocentral  '" & Str_MODULOID & "'"
    
    Set rs = New ADODB.Recordset
    rs.CursorLocation = adUseClient
    rs.Open StrSql, "FILEDSN=conexionsies", adOpenUnspecified, adLockUnspecified, adCmdUnspecified
        
    Set tablas_envioscentral = rs
    
    GetObjectContext.SetComplete
        
    Exit Function
    
TrataError:
    If Not rs Is Nothing Then
        Set rs = Nothing
    End If
    
    GetObjectContext.SetAbort
    
    Err.Raise Err.Number, "lib_trasmision.cls_envios", Err.Description

End Function


Public Function tablas_enviosestacion(ByVal Str_MODULOID, Optional VarAux As Variant) As ADODB.Recordset
    Dim StrSql As String
    Dim rs As ADODB.Recordset
    
    On Error GoTo TrataError
    

    StrSql = " sh_tablas_enviosestacion  '" & Str_MODULOID & "'"
    
    Set rs = New ADODB.Recordset
    rs.CursorLocation = adUseClient
    rs.Open StrSql, "FILEDSN=conexionsies", adOpenUnspecified, adLockUnspecified, adCmdUnspecified
        
    Set tablas_enviosestacion = rs
    
    GetObjectContext.SetComplete
        
    Exit Function
    
TrataError:
    If Not rs Is Nothing Then
        Set rs = Nothing
    End If
    
    GetObjectContext.SetAbort
    
    Err.Raise Err.Number, "lib_trasmision.cls_envios", Err.Description

End Function

Public Function datos_tabla_maestra(ByVal Str_tabla As String, ByVal str_persite As Integer, _
                                    ByVal STR_SITEID As String, Optional VarAux As Variant) As ADODB.Recordset
    Dim StrSql As String
    Dim rs As ADODB.Recordset
    
    On Error GoTo TrataError
    

    StrSql = " sh_datos_tabla_maestra '" & Str_tabla & "'," & str_persite & ",'" + STR_SITEID + "'"
    
    Set rs = New ADODB.Recordset
    rs.CursorLocation = adUseClient
    rs.Open StrSql, "FILEDSN=conexionsies", adOpenUnspecified, adLockUnspecified, adCmdUnspecified
        
    Set datos_tabla_maestra = rs
    
    GetObjectContext.SetComplete
        
    Exit Function
    
TrataError:
    If Not rs Is Nothing Then
        Set rs = Nothing
    End If
    
    GetObjectContext.SetAbort
    
    Err.Raise Err.Number, "lib_trasmision.cls_envios", Err.Description

End Function

Public Function datos_tabla_trans(ByVal Str_tabla As String, ByVal STR_CAMPOFECHA As String, _
                                  ByVal FECHA As String, ByVal RLSED As Integer, _
                                  ByVal EnviodeCentral As Integer, ByVal IntporSite As Integer, _
                                  ByVal StrAlmacen As String, Optional VarAux As Variant) As ADODB.Recordset
    Dim StrSql As String
    Dim rs As ADODB.Recordset
    
    On Error GoTo TrataError
    

    StrSql = " sh_datos_tabla_trans '" & Str_tabla & "','" & STR_CAMPOFECHA & "','" & FECHA & "'," & RLSED & "," & _
                                         EnviodeCentral & "," & IntporSite & ",'" & StrAlmacen & "'"
    
    Set rs = New ADODB.Recordset
    rs.CursorLocation = adUseClient
    rs.Open StrSql, "FILEDSN=conexionsies", adOpenUnspecified, adLockUnspecified, adCmdUnspecified
        
    Set datos_tabla_trans = rs
    
    GetObjectContext.SetComplete
        
    Exit Function
    
TrataError:
    If Not rs Is Nothing Then
        Set rs = Nothing
    End If
    
    GetObjectContext.SetAbort
    
    Err.Raise Err.Number, "lib_trasmision.cls_envios", Err.Description

End Function

Public Function rutaenvio(Optional VarAux As Variant) As String
    Dim StrSql As String
    Dim rs As ADODB.Recordset
    
    On Error GoTo TrataError

    StrSql = " SELECT sendpath FROM SETUP  "
    
    Set rs = New ADODB.Recordset
    rs.CursorLocation = adUseClient
    rs.Open StrSql, "FILEDSN=conexionsies", adOpenUnspecified, adLockUnspecified, adCmdUnspecified
        
    rutaenvio = rs!sendpath
    
    GetObjectContext.SetComplete
        
    Exit Function
    
TrataError:
    If Not rs Is Nothing Then
        Set rs = Nothing
    End If
    
    GetObjectContext.SetAbort
    
    Err.Raise Err.Number, "lib_trasmision.general.rutatransferencia", Err.Description

End Function
Public Sub agrega_envios(ByVal Str_tabla As String, ByVal STR_SITEID As String, _
                              ByVal STR_FECHA As String, Optional VarAux As Variant)
    Dim StrSql As String
    Dim rs As ADODB.Recordset
    
    On Error GoTo TrataError
    
    StrSql = " sh_agregaenvios '" & Str_tabla & "','" + STR_SITEID + "','" + STR_FECHA + "'"
    
    Set rs = New ADODB.Recordset
    rs.CursorLocation = adUseClient
    rs.Open StrSql, "FILEDSN=conexionsies", adOpenUnspecified, adLockUnspecified, adCmdUnspecified
        
    
    GetObjectContext.SetComplete
        
    Exit Sub
    
TrataError:
    If Not rs Is Nothing Then
        Set rs = Nothing
    End If
    
    GetObjectContext.SetAbort
    
    Err.Raise Err.Number, "lib_trasmision.cls_envios", Err.Description

End Sub
Public Sub FLAGENVIOMAESTRA(ByVal Str_tabla As String, ByVal int_persite As Integer, _
                             ByVal STR_SITEID As String, ByVal str_idtabla As String, _
                             ByVal STR_FECHA As String, ByVal str_userid As String, _
                             ByVal str_filename As String, Optional VarAux As Variant)
    Dim StrSql As String
    Dim rs As ADODB.Recordset
    
    On Error GoTo TrataError
    
    StrSql = " SH_FLAGENVIOMAESTRA '" & Str_tabla & "'," & int_persite & ",'" & STR_SITEID & "','" & _
                                        str_idtabla & "','" & STR_FECHA & "','" & str_userid & "','" & str_filename & "'"
    
    Set rs = New ADODB.Recordset
    rs.CursorLocation = adUseClient
    rs.Open StrSql, "FILEDSN=conexionsies", adOpenUnspecified, adLockUnspecified, adCmdUnspecified
    
    GetObjectContext.SetComplete
        
    Exit Sub
    
TrataError:
    If Not rs Is Nothing Then
        Set rs = Nothing
    End If
    
    GetObjectContext.SetAbort
    
    Err.Raise Err.Number, "lib_trasmision.cls_envios", Err.Description

End Sub

Public Sub FLAGENVIOTRAN(ByVal Str_tabla As String, ByVal STR_SITEID As String, _
                            ByVal str_idtabla As String, ByVal STR_FECHA As String, _
                            ByVal str_userid As String, ByVal CAMPOFECHA As String, _
                            ByVal str_filename As String, Optional ByVal IntDeCentral As Integer = 0, Optional VarAux As Variant)
    Dim StrSql As String
    Dim rs As ADODB.Recordset
    
    On Error GoTo TrataError
    
    StrSql = " SH_FLAGENVIOTRAN '" & Str_tabla & "','" & STR_SITEID & "','" & _
                                str_idtabla & "','" & STR_FECHA & "','" & _
                                str_userid & "','" & CAMPOFECHA & "','" & str_filename & "'," & _
                                IntDeCentral
    
    Set rs = New ADODB.Recordset
    rs.CursorLocation = adUseClient
    rs.Open StrSql, "FILEDSN=conexionsies", adOpenUnspecified, adLockUnspecified, adCmdUnspecified
    
    GetObjectContext.SetComplete
        
    Exit Sub
    
TrataError:
    If Not rs Is Nothing Then
        Set rs = Nothing
    End If
    
    GetObjectContext.SetAbort
    
    Err.Raise Err.Number, "lib_trasmision.cls_envios", Err.Description

End Sub


Public Function Auxiliar1(Optional ByVal VarAux1 As Variant, Optional ByVal VarAux2 As Variant) As Variant
    ' Funcion
    
    On Error GoTo errhandler
    
    
    
    GetObjectContext.SetComplete
    
    Exit Function
errhandler:
    GetObjectContext.SetAbort
    Err.Raise Err.Number, "lib_trasmision.Cls_envios.Auxiliar1", Err.Description
End Function

Public Function Auxiliar2(Optional ByVal VarAux1 As Variant, Optional ByVal VarAux2 As Variant) As Variant
    ' Funcion
    
    On Error GoTo errhandler
    
    
    
    GetObjectContext.SetComplete
    
    Exit Function
errhandler:
    GetObjectContext.SetAbort
    Err.Raise Err.Number, "lib_trasmision.Cls_envios.Auxiliar2", Err.Description
End Function

Public Function Auxiliar3(Optional ByVal VarAux1 As Variant, Optional ByVal VarAux2 As Variant) As Variant
    ' Funcion
    
    On Error GoTo errhandler
    
    
    
    GetObjectContext.SetComplete
    
    Exit Function
errhandler:
    GetObjectContext.SetAbort
    Err.Raise Err.Number, "lib_trasmision.Cls_envios.Auxiliar3", Err.Description
End Function

Public Function Auxiliar4(Optional ByVal VarAux1 As Variant, Optional ByVal VarAux2 As Variant) As Variant
    ' Funcion
    
    On Error GoTo errhandler
    
    
    
    GetObjectContext.SetComplete
    
    Exit Function
errhandler:
    GetObjectContext.SetAbort
    Err.Raise Err.Number, "lib_trasmision.Cls_envios.Auxiliar4", Err.Description
End Function

Public Function Auxiliar5(Optional ByVal VarAux1 As Variant, Optional ByVal VarAux2 As Variant) As Variant
    ' Funcion
    
    On Error GoTo errhandler
    
    
    
    GetObjectContext.SetComplete
    
    Exit Function
errhandler:
    GetObjectContext.SetAbort
    Err.Raise Err.Number, "lib_trasmision.Cls_envios.Auxiliar5", Err.Description
End Function


Public Function Auxiliar6(Optional ByVal VarAux1 As Variant, Optional ByVal VarAux2 As Variant) As Variant
    ' Funcion
    
    On Error GoTo errhandler
    
    
    
    GetObjectContext.SetComplete
    
    Exit Function
errhandler:
    GetObjectContext.SetAbort
    Err.Raise Err.Number, "lib_trasmision.Cls_envios.Auxiliar6", Err.Description
End Function

Public Function Auxiliar7(Optional ByVal VarAux1 As Variant, Optional ByVal VarAux2 As Variant) As Variant
    ' Funcion
    
    On Error GoTo errhandler
    
    
    
    GetObjectContext.SetComplete
    
    Exit Function
errhandler:
    GetObjectContext.SetAbort
    Err.Raise Err.Number, "lib_trasmision.Cls_envios.Auxiliar7", Err.Description
End Function

Public Function Auxiliar8(Optional ByVal VarAux1 As Variant, Optional ByVal VarAux2 As Variant) As Variant
    ' Funcion
    
    On Error GoTo errhandler
    
    
    
    GetObjectContext.SetComplete
    
    Exit Function
errhandler:
    GetObjectContext.SetAbort
    Err.Raise Err.Number, "lib_trasmision.Cls_envios.Auxiliar8", Err.Description
End Function

Public Function Auxiliar9(Optional ByVal VarAux1 As Variant, Optional ByVal VarAux2 As Variant) As Variant
    ' Funcion
    
    On Error GoTo errhandler
    
    
    
    GetObjectContext.SetComplete
    
    Exit Function
errhandler:
    GetObjectContext.SetAbort
    Err.Raise Err.Number, "lib_trasmision.Cls_envios.Auxiliar9", Err.Description
End Function

Public Function Auxiliar10(Optional ByVal VarAux1 As Variant, Optional ByVal VarAux2 As Variant) As Variant
    ' Funcion
    
    On Error GoTo errhandler
    
    
    
    GetObjectContext.SetComplete
    
    Exit Function
errhandler:
    GetObjectContext.SetAbort
    Err.Raise Err.Number, "lib_trasmision.Cls_envios.Auxiliar10", Err.Description
End Function

