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_PRECIOVENTA_ART"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = True
Attribute VB_PredeclaredId = False
Attribute VB_Exposed = True


Public Function EditarPrecioVenta(ByVal CodArticulo As String, ByVal nPrecioVenta As Double) As Boolean
'Autor: Jorge Illescas................permite editar el precio de venta de un producto desde el maestro ingreso
'de articulos.................................................................................................

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

On Error GoTo ErrorHandler
 
Set cmd = New ADODB.Command
cmd.CommandText = " IN_EditarPrecioVentaArt " & CodArticulo & "," & nPrecioVenta & ""

Set con = New ADODB.Connection
con.Open "FILEDSN=conexionsies"

Set cmd.ActiveConnection = con
cmd.Execute

'GetObjectContext.SetComplete
    EditarPrecioVenta = True
Exit Function
    
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
     EditarPrecioVenta = False
     Err.Raise LVarNumeroError, "DB_INV_MOVIMIENTOS.EditarPrecioVenta", LStrMensajeError

End Function

Public Function MostrarPrecioVenta(CodArticulo As String) As ADODB.Recordset
On Error GoTo ErrorHandler
   Dim strSql As String
   Dim rs As ADODB.Recordset
    
   On Error GoTo ErrorHandler
      
   strSql = "SELECT SLS_PRICE FROM IN_INVENTORYDAT WHERE INVTIDSKU = '" & CodArticulo & "'"
          
   Set rs = New ADODB.Recordset
   rs.CursorLocation = adUseClient
   rs.Open strSql, "FILEDSN=" & "conexionsies"
                    
   Set MostrarPrecioVenta = rs
   
   'GetObjectContext.SetComplete
   
   Exit Function
ErrorHandler:
   If Not rs Is Nothing Then
      Set rs = Nothing
   End If
   'GetObjectContext.SetAbort
   
   Err.Raise Err.Number, "DB_INV_MOVIMIENTOS.MostrarPrecioVenta", Err.Description

End Function


