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_PUNTODEVENTA"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = True
Attribute VB_PredeclaredId = False
Attribute VB_Exposed = True
Public Function ListarPuntodeVentaAyuda(Optional VarAux As Variant) As ADODB.Recordset
   Dim StrSql As String
   Dim rs As ADODB.Recordset
    
   On Error GoTo ErrorHandler
      
   StrSql = " select SALESPOINT,DESCRBUSINESS " & _
            " from OP_SALESPOINTSETTING left join OP_BUSINESSTYPE " & _
            " on OP_SALESPOINTSETTING.BUSINESSTYPE=OP_BUSINESSTYPE.BUSINESSTYPE "
          
   Set rs = New ADODB.Recordset
   rs.CursorLocation = adUseClient
   rs.Open StrSql, "FILEDSN=conexionsies"
                    
   Set ListarPuntodeVentaAyuda = rs
   
   'GetObjectContext.SetComplete
   Exit Function
ErrorHandler:
   If Not rs Is Nothing Then
      Set rs = Nothing
   End If
   'GetObjectContext.SetAbort
   Err.Raise Err.Number, "DB_UT_MANTENIMIENTOS.ListarPuntodeVentaAyuda", Err.Description
    
End Function

Public Function ListarTiposNegocio(Optional VarAux As Variant) As ADODB.Recordset
   Dim StrSql As String
   Dim rs As ADODB.Recordset
    
   On Error GoTo ErrorHandler
      
   StrSql = " select BUSINESSTYPE,DESCRBUSINESS " & _
            " from OP_BUSINESSTYPE "
          
   Set rs = New ADODB.Recordset
   rs.CursorLocation = adUseClient
   rs.Open StrSql, "FILEDSN=conexionsies"
                    
   Set ListarTiposNegocio = rs
   
   'GetObjectContext.SetComplete
   Exit Function
ErrorHandler:
   If Not rs Is Nothing Then
      Set rs = Nothing
   End If
   'GetObjectContext.SetAbort
   Err.Raise Err.Number, "DB_UT_MANTENIMIENTOS.ListarTiposNegocio", Err.Description
    
End Function

Public Function ListarTiposImpresoras(Optional VarAux As Variant) As ADODB.Recordset
   Dim StrSql As String
   Dim rs As ADODB.Recordset
    
   On Error GoTo ErrorHandler
      
   StrSql = " select PRINTERTYPEID,DESCRPRINTER " & _
            " from OP_PRINTERTYPE "
          
   Set rs = New ADODB.Recordset
   rs.CursorLocation = adUseClient
   rs.Open StrSql, "FILEDSN=conexionsies"
                    
   Set ListarTiposImpresoras = rs
   
   'GetObjectContext.SetComplete
   Exit Function
ErrorHandler:
   If Not rs Is Nothing Then
      Set rs = Nothing
   End If
   'GetObjectContext.SetAbort
   Err.Raise Err.Number, "DB_UT_MANTENIMIENTOS.ListarTiposImpresoras", Err.Description
    
End Function

Public Function ObtenerConfiguracion(Optional VarAux As Variant) As ADODB.Recordset
   Dim StrSql As String
   Dim rs As ADODB.Recordset
    
   On Error GoTo ErrorHandler
      
   StrSql = "select * from OP_SALESPOINTSETTING "
          
   Set rs = New ADODB.Recordset
   rs.CursorLocation = adUseClient
   rs.Open StrSql, "FILEDSN=conexionsies"
                    
   Set ObtenerConfiguracion = rs
   
   'GetObjectContext.SetComplete
   Exit Function
ErrorHandler:
   If Not rs Is Nothing Then
      Set rs = Nothing
   End If
   'GetObjectContext.SetAbort
   Err.Raise Err.Number, "DB_UT_MANTENIMIENTOS.ObtenerConfiguracion", Err.Description
    
End Function

Public Function ObtenerConfiguracionPtoVta(ByVal StrTerminal As String, Optional VarAux As Variant) As ADODB.Recordset
   Dim StrSql As String
   Dim rs As ADODB.Recordset
    
   On Error GoTo ErrorHandler
      
   StrSql = "select * from OP_SALESPOINTSETTING where TERMINALNAME='" & StrTerminal & "'"
          
   Set rs = New ADODB.Recordset
   rs.CursorLocation = adUseClient
   rs.Open StrSql, "FILEDSN=conexionsies"
                    
   Set ObtenerConfiguracionPtoVta = rs
   
   'GetObjectContext.SetComplete
   Exit Function
ErrorHandler:
   If Not rs Is Nothing Then
      Set rs = Nothing
   End If
   'GetObjectContext.SetAbort
   Err.Raise Err.Number, "DB_UT_MANTENIMIENTOS.ObtenerConfiguracionPtoVta", Err.Description
    
End Function

Public Function ObtenerTipoPtoVta(ByVal StrPuntodeVenta As String, Optional VarAux As Variant) As ADODB.Recordset
   Dim StrSql As String
   Dim rs As ADODB.Recordset
    
   On Error GoTo ErrorHandler
      
   StrSql = " Select SALESPOINT,OP_BUSINESSTYPE.BUSINESSTYPE as tiponegocio,DESCRBUSINESS " & _
            " from OP_SALESPOINTSETTING left join OP_BUSINESSTYPE " & _
            " on OP_SALESPOINTSETTING.BUSINESSTYPE=OP_BUSINESSTYPE.BUSINESSTYPE " & _
            " Where OP_SALESPOINTSETTING.SALESPOINT='" & StrPuntodeVenta & "'"
            
   Set rs = New ADODB.Recordset
   rs.CursorLocation = adUseClient
   rs.Open StrSql, "FILEDSN=conexionsies"
                    
   Set ObtenerTipoPtoVta = rs
   
   'GetObjectContext.SetComplete
   Exit Function
ErrorHandler:
   If Not rs Is Nothing Then
      Set rs = Nothing
   End If
   'GetObjectContext.SetAbort
   Err.Raise Err.Number, "DB_UT_MANTENIMIENTOS.ObtenerTipoPtoVta", Err.Description
End Function

Public Sub ActivarDesactivarPtovta(ByVal IntActivaDesactiva As Integer, ByVal StrPuntodeVenta As String, Optional VarAux As Variant)
    Dim cmd As ADODB.Command
    Dim con As ADODB.Connection
    Dim StrSql As String
 
 On Error GoTo ErrorHandler
    
    StrSql = " OP_ACTIVADESACTIVAPTOVTA " & IntActivaDesactiva & ",'" & StrPuntodeVenta & "'"

    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

ErrorHandler:
 
 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, "DB_UT_MANTENIMIENTOS.C_PUNTODEVENTA.ActivarDesactivarPtovta", LStrMensajeError
   
End Sub


Public Sub ActualizarPtovta(ByVal StrSALESPOINT As String, ByVal strTERMINALNAME As String, ByVal datENDDATEACT As Date, _
                            ByVal strSERIALNUMBER As String, ByVal bytSTKTICKFAC As Byte, ByVal bytSTKTICKBOL As Byte, _
                            ByVal strCURYID As String, ByVal bytSTKLOADSALE As Byte, ByVal bytSTKPRINTERFAC As Byte, _
                            ByVal bytSTKPRINTEDBOL As Byte, ByVal strTYPEDISPFAC As String, ByVal strDISPFAC As String, _
                            ByVal strTYPEDISPBOL As String, ByVal strDISPBOL As String, ByVal strTYPEDISPNC As String, _
                            ByVal strDISPNC As String, ByVal strTYPEDISPND As String, ByVal strDISPND As String, _
                            ByVal strTYPEDISORDER As String, ByVal strDISPORDER As String, ByVal strTYPEDISPTICKFAC As String, _
                            ByVal strDISPTICKFAC As String, ByVal dblNBRTICKFAC As Double, ByVal strTYPEDISPTICKBOL As String, _
                            ByVal strDISPTICKBOL As String, ByVal dblNBRTICKBOL As Double, ByVal strDISPDISPLAY As String, _
                            ByVal bytSTKJUMPAUTOMAT As Byte, ByVal intQTYJUMPAUTOMAT As Integer, ByVal bytSTKHOTKEYS As Byte, _
                            ByVal bytSTKDELETEDOC As Byte, ByVal strBUSINESSTYPE As String, ByVal strSITEID As String, _
                            ByVal bytSTKTOFORCEZ As Byte, ByVal strPRINTERTYPEID As String, Optional VarAux As Variant)
                            
    Dim cmd As ADODB.Command
    Dim con As ADODB.Connection
    Dim StrSql As String
 
 On Error GoTo ErrorHandler
    
    StrSql = " OP_SALESPOINTSETTINGUpdProc '" & StrSALESPOINT & "','" & strTERMINALNAME & "','" & Format(datENDDATEACT, "YYYY/DD/MM") & "','" & _
                                            strSERIALNUMBER & "'," & bytSTKTICKFAC & "," & bytSTKTICKBOL & ",'" & _
                                            strCURYID & "'," & bytSTKLOADSALE & "," & bytSTKPRINTERFAC & "," & _
                                            bytSTKPRINTEDBOL & ",'" & strTYPEDISPFAC & "','" & strDISPFAC & "','" & _
                                            strTYPEDISPBOL & "','" & strDISPBOL & "','" & strTYPEDISPNC & "','" & _
                                            strDISPNC & "','" & strTYPEDISPND & "','" & strDISPND & "','" & _
                                            strTYPEDISORDER & "','" & strDISPORDER & "','" & strTYPEDISPTICKFAC & "','" & _
                                            strDISPTICKFAC & "'," & dblNBRTICKFAC & ",'" & strTYPEDISPTICKBOL & "','" & _
                                            strDISPTICKBOL & "'," & dblNBRTICKBOL & ",'" & strDISPDISPLAY & "'," & _
                                            bytSTKJUMPAUTOMAT & "," & intQTYJUMPAUTOMAT & "," & bytSTKHOTKEYS & "," & _
                                            bytSTKDELETEDOC & ",'" & strBUSINESSTYPE & "','" & strSITEID & "'," & _
                                            bytSTKTOFORCEZ & ",'" & strPRINTERTYPEID & "'"


    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

ErrorHandler:
 
 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, "DB_UT_MANTENIMIENTOS.C_PUNTODEVENTA.ActualizarPtovta", LStrMensajeError
   
End Sub


Public Sub AgregarPtovta(ByVal StrSALESPOINT As String, ByVal strTERMINALNAME As String, ByVal datENDDATEACT As Date, _
                            ByVal strSERIALNUMBER As String, ByVal bytSTKTICKFAC As Byte, ByVal bytSTKTICKBOL As Byte, _
                            ByVal strCURYID As String, ByVal bytSTKLOADSALE As Byte, ByVal bytSTKPRINTERFAC As Byte, _
                            ByVal bytSTKPRINTEDBOL As Byte, ByVal strTYPEDISPFAC As String, ByVal strDISPFAC As String, _
                            ByVal strTYPEDISPBOL As String, ByVal strDISPBOL As String, ByVal strTYPEDISPNC As String, _
                            ByVal strDISPNC As String, ByVal strTYPEDISPND As String, ByVal strDISPND As String, _
                            ByVal strTYPEDISORDER As String, ByVal strDISPORDER As String, ByVal strTYPEDISPTICKFAC As String, _
                            ByVal strDISPTICKFAC As String, ByVal dblNBRTICKFAC As Double, ByVal strTYPEDISPTICKBOL As String, _
                            ByVal strDISPTICKBOL As String, ByVal dblNBRTICKBOL As Double, ByVal strDISPDISPLAY As String, _
                            ByVal bytSTKJUMPAUTOMAT As Byte, ByVal intQTYJUMPAUTOMAT As Integer, ByVal bytSTKHOTKEYS As Byte, _
                            ByVal bytSTKDELETEDOC As Byte, ByVal strBUSINESSTYPE As String, ByVal strSITEID As String, _
                            ByVal bytSTKTOFORCEZ As Byte, ByVal strPRINTERTYPEID As String, Optional VarAux As Variant)
                            
    Dim cmd As ADODB.Command
    Dim con As ADODB.Connection
    Dim StrSql As String
 
 On Error GoTo ErrorHandler
    
    StrSql = " OP_SALESPOINTSETTINGInsProc '" & StrSALESPOINT & "','" & strTERMINALNAME & "','" & Format(datENDDATEACT, "YYYY/DD/MM") & "','" & _
                                            strSERIALNUMBER & "'," & bytSTKTICKFAC & "," & bytSTKTICKBOL & ",'" & _
                                            strCURYID & "'," & bytSTKLOADSALE & "," & bytSTKPRINTERFAC & "," & _
                                            bytSTKPRINTEDBOL & ",'" & strTYPEDISPFAC & "','" & strDISPFAC & "','" & _
                                            strTYPEDISPBOL & "','" & strDISPBOL & "','" & strTYPEDISPNC & "','" & _
                                            strDISPNC & "','" & strTYPEDISPND & "','" & strDISPND & "','" & _
                                            strTYPEDISORDER & "','" & strDISPORDER & "','" & strTYPEDISPTICKFAC & "','" & _
                                            strDISPTICKFAC & "'," & dblNBRTICKFAC & ",'" & strTYPEDISPTICKBOL & "','" & _
                                            strDISPTICKBOL & "'," & dblNBRTICKBOL & ",'" & strDISPDISPLAY & "'," & _
                                            bytSTKJUMPAUTOMAT & "," & intQTYJUMPAUTOMAT & "," & bytSTKHOTKEYS & "," & _
                                            bytSTKDELETEDOC & ",'" & strBUSINESSTYPE & "','" & strSITEID & "'," & _
                                            bytSTKTOFORCEZ & ",'" & strPRINTERTYPEID & "'"


    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

ErrorHandler:
 
 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, "DB_UT_MANTENIMIENTOS.C_PUNTODEVENTA.AgregarPtovta", LStrMensajeError
   
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, "DB_UT_MANTENIMIENTOS.C_PUNTODEVENTA.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_PUNTODEVENTA.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_PUNTODEVENTA.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_PUNTODEVENTA.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_PUNTODEVENTA.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_PUNTODEVENTA.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_PUNTODEVENTA.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_PUNTODEVENTA.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_PUNTODEVENTA.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_PUNTODEVENTA.Auxiliar10", Err.Description
End Function




