VERSION 1.0 CLASS
BEGIN
  MultiUse = -1  'True
  Persistable = 0  'NotPersistable
  DataBindingBehavior = 0  'vbNone
  DataSourceBehavior  = 0  'vbNone
  MTSTransactionMode  = 0  'NotAnMTSObject
END
Attribute VB_Name = "C_REIMPRE"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = True
Attribute VB_PredeclaredId = False
Attribute VB_Exposed = True
Public Function ObtenerDatosDetalle(ByVal strSITEID As String, ByVal dblNBRDOCUMENT As Double, ByVal IntRedondeo As Integer, Optional VarAux As Variant) As ADODB.Recordset
   Dim StrSql As String
   Dim rs As ADODB.Recordset
   Dim cmd As ADODB.Recordset
    
   On Error GoTo errhandler
   
   StrSql = " OP_MostrarDetalleVentas '" & strSITEID & "'," & dblNBRDOCUMENT & "," & IntRedondeo
                
   Set rs = New ADODB.Recordset
   rs.CursorLocation = adUseClient
   rs.Open StrSql, "FILEDSN=conexionsies", adOpenStatic
                
   Set ObtenerDatosDetalle = rs
      
   'GetObjectContext.SetComplete
   Exit Function
errhandler:
    If Not rs Is Nothing Then
        Set rs = Nothing
    End If

   'GetObjectContext.SetAbort
   Err.Raise Err.Number, "DB_UT_MANTENIMIENTOS.ObtenerDatosDetalle", Err.Description
End Function

Public Function ObtenerDatosCabecera(ByVal strSITEID As String, ByVal dblNBRDOCUMENT As Double, Optional VarAux As Variant) As ADODB.Recordset
   Dim StrSql As String
   Dim rs As ADODB.Recordset
   Dim cmd As ADODB.Recordset
    
   On Error GoTo errhandler
   
   StrSql = " OP_MostrarCabeceraVentas '" & strSITEID & "'," & dblNBRDOCUMENT
                
   Set rs = New ADODB.Recordset
   rs.CursorLocation = adUseClient
   rs.Open StrSql, "FILEDSN=conexionsies", adOpenStatic
                
   Set ObtenerDatosCabecera = rs
      
   'GetObjectContext.SetComplete
   Exit Function
errhandler:
    If Not rs Is Nothing Then
        Set rs = Nothing
    End If

   'GetObjectContext.SetAbort
   Err.Raise Err.Number, "DB_UT_MANTENIMIENTOS.ObtenerDatosCabecera", Err.Description
End Function

Public Function ListarTickets(ByVal strSITEID As String, ByVal dblNBRDOCUMENTINI As Double, ByVal dblNBRDOCUMENTFIN As Double, Optional VarAux As Variant) As ADODB.Recordset
   Dim StrSql As String
   Dim rs As ADODB.Recordset
   Dim cmd As ADODB.Recordset
    
   On Error GoTo errhandler
   
   StrSql = " OP_ListarTickets '" & strSITEID & "'," & dblNBRDOCUMENTINI & "," & dblNBRDOCUMENTFIN
                
   Set rs = New ADODB.Recordset
   rs.CursorLocation = adUseClient
   rs.Open StrSql, "FILEDSN=conexionsies", adOpenStatic
                
   Set ListarTickets = rs
      
   'GetObjectContext.SetComplete
   Exit Function
errhandler:
    If Not rs Is Nothing Then
        Set rs = Nothing
    End If

   'GetObjectContext.SetAbort
   Err.Raise Err.Number, "DB_UT_MANTENIMIENTOS.ListarTickets", Err.Description
End Function


Public Function obtenertarjetasventa(ByVal DOCTYPEID As String, ByVal NBRDOCUMENT As Double, ByVal SITEID As String, Optional VarAux As Variant) As ADODB.Recordset
Dim cmd As ADODB.Command
Dim con As ADODB.Connection
Dim rs As ADODB.Recordset
Dim StrSql As String

On Error GoTo ErrorHandler
    
    StrSql = " op_tarjetasventas_proc '" & DOCTYPEID & "'," & NBRDOCUMENT & ",'" & SITEID & "'"
    
    Set rs = New ADODB.Recordset
    rs.CursorLocation = adUseClient
    Set con = New ADODB.Connection
    con.ConnectionString = "FILEDSN=conexionsies"
    con.Open
    rs.Open StrSql, con, adOpenDynamic, adLockBatchOptimistic
    
    Set obtenertarjetasventa = rs
        
 'GetObjectContext.SetComplete
 
Exit Function

ErrorHandler:
Dim LStrMensajeError As String
Dim LVarNumeroError As Variant
    
     If Not rs Is Nothing Then
        Set rs = Nothing
     End If
     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, "DB_UT_MANTENIMIENTOS.obtenertarjetasventas", LStrMensajeError
End Function

Public Function obtenervalesventa(ByVal SITEID As String, ByVal NBRDOCUMENT As Double, Optional VarAux As Variant) As ADODB.Recordset
Dim cmd As ADODB.Command
Dim con As ADODB.Connection
Dim rs As ADODB.Recordset
Dim StrSql As String

On Error GoTo ErrorHandler
    
    StrSql = " OP_ListarVales_Proc " & NBRDOCUMENT & ",'" & SITEID & "'"
    
    Set rs = New ADODB.Recordset
    rs.CursorLocation = adUseClient
    Set con = New ADODB.Connection
    con.ConnectionString = "FILEDSN=conexionsies"
    con.Open
    rs.Open StrSql, con, adOpenDynamic, adLockBatchOptimistic
    
    Set obtenervalesventa = rs
        
 'GetObjectContext.SetComplete
 
Exit Function

ErrorHandler:
Dim LStrMensajeError As String
Dim LVarNumeroError As Variant
    
     If Not rs Is Nothing Then
        Set rs = Nothing
     End If
     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, "DB_UT_MANTENIMIENTOS.obtenervalesventa", LStrMensajeError
End Function



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, "DB_UT_MANTENIMIENTOS.C_REIMPRE.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, "DB_UT_MANTENIMIENTOS.C_REIMPRE.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, "DB_UT_MANTENIMIENTOS.C_REIMPRE.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, "DB_UT_MANTENIMIENTOS.C_REIMPRE.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, "DB_UT_MANTENIMIENTOS.C_REIMPRE.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, "DB_UT_MANTENIMIENTOS.C_REIMPRE.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, "DB_UT_MANTENIMIENTOS.C_REIMPRE.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, "DB_UT_MANTENIMIENTOS.C_REIMPRE.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, "DB_UT_MANTENIMIENTOS.C_REIMPRE.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, "DB_UT_MANTENIMIENTOS.C_REIMPRE.Auxiliar10", Err.Description
End Function



