VERSION 5.00
Object = "{F0D2F211-CCB0-11D0-A316-00AA00688B10}#1.0#0"; "MSDATLST.OCX"
Object = "{69F9D01E-F1DE-11D4-9536-002018603DA2}#7.0#0"; "ControlNumber.ocx"
Begin VB.Form FModificarStock 
   BorderStyle     =   1  'Fixed Single
   Caption         =   "Datos de Almacenes"
   ClientHeight    =   3195
   ClientLeft      =   5730
   ClientTop       =   6735
   ClientWidth     =   7110
   LinkTopic       =   "Form1"
   LockControls    =   -1  'True
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   3195
   ScaleWidth      =   7110
   Begin VB.TextBox txtcodsolinvent 
      Enabled         =   0   'False
      Height          =   285
      Left            =   2280
      MaxLength       =   20
      TabIndex        =   3
      Text            =   "CS001"
      Top             =   1440
      Width           =   2535
   End
   Begin VB.TextBox txtcodsolNoinvent 
      Enabled         =   0   'False
      Height          =   285
      Left            =   2280
      MaxLength       =   20
      TabIndex        =   2
      Text            =   "CS002"
      Top             =   1800
      Width           =   2535
   End
   Begin VB.CommandButton cmdsalir 
      Caption         =   "Cancelar"
      Height          =   800
      Left            =   5640
      Picture         =   "FModificarStock.frx":0000
      Style           =   1  'Graphical
      TabIndex        =   1
      Top             =   2160
      Width           =   1095
   End
   Begin VB.CommandButton cmdgrabar 
      Caption         =   "&Grabar"
      Height          =   800
      Left            =   4560
      Picture         =   "FModificarStock.frx":030A
      Style           =   1  'Graphical
      TabIndex        =   0
      Top             =   2160
      Width           =   1095
   End
   Begin MSDataListLib.DataCombo DtcTipoPrecio 
      Height          =   315
      Left            =   3600
      TabIndex        =   4
      Top             =   600
      Width           =   3135
      _ExtentX        =   5530
      _ExtentY        =   556
      _Version        =   393216
      Style           =   2
      Text            =   ""
   End
   Begin MiControl.CtrlNumber CTNprecioVent 
      Height          =   375
      Left            =   2280
      TabIndex        =   5
      Top             =   600
      Width           =   1215
      _ExtentX        =   2143
      _ExtentY        =   661
      BackColor       =   -2147483643
      BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "MS Sans Serif"
         Size            =   8.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
   End
   Begin MiControl.CtrlNumber CTNstkmax 
      Height          =   375
      Left            =   2280
      TabIndex        =   6
      Top             =   2160
      Width           =   1215
      _ExtentX        =   2143
      _ExtentY        =   661
      BackColor       =   -2147483643
      BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "MS Sans Serif"
         Size            =   8.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
   End
   Begin MiControl.CtrlNumber CTNstkmin 
      Height          =   375
      Left            =   2280
      TabIndex        =   7
      Top             =   2520
      Width           =   1215
      _ExtentX        =   2143
      _ExtentY        =   661
      BackColor       =   -2147483643
      BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "MS Sans Serif"
         Size            =   8.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
   End
   Begin VB.Label Label7 
      Caption         =   "Cd Solomon Inventariable"
      Height          =   255
      Left            =   120
      TabIndex        =   17
      Top             =   1440
      Width           =   2415
   End
   Begin VB.Label Label5 
      Caption         =   "Cd Solomon No Inventariable"
      Height          =   255
      Left            =   120
      TabIndex        =   16
      Top             =   1800
      Width           =   2535
   End
   Begin VB.Label lblmoneda 
      BorderStyle     =   1  'Fixed Single
      Height          =   255
      Left            =   2280
      TabIndex        =   15
      Top             =   1080
      Width           =   2175
   End
   Begin VB.Label Label6 
      Caption         =   "Moneda"
      Height          =   255
      Left            =   120
      TabIndex        =   14
      Top             =   1005
      Width           =   1215
   End
   Begin VB.Label Label4 
      Caption         =   "Precio "
      Height          =   255
      Left            =   120
      TabIndex        =   13
      Top             =   600
      Width           =   1215
   End
   Begin VB.Label lblalmacendscr 
      BorderStyle     =   1  'Fixed Single
      Height          =   255
      Left            =   3360
      TabIndex        =   12
      Top             =   240
      Width           =   3495
   End
   Begin VB.Label lblcodalmacen 
      BorderStyle     =   1  'Fixed Single
      Height          =   255
      Left            =   2280
      TabIndex        =   11
      Top             =   240
      Width           =   855
   End
   Begin VB.Label Label3 
      Caption         =   "Almacen"
      Height          =   375
      Left            =   120
      TabIndex        =   10
      Top             =   240
      Width           =   735
   End
   Begin VB.Label Label1 
      Caption         =   "Stock Minimo"
      Height          =   255
      Left            =   120
      TabIndex        =   9
      Top             =   2565
      Width           =   975
   End
   Begin VB.Label Label2 
      Caption         =   "Stock Máximo"
      Height          =   375
      Left            =   120
      TabIndex        =   8
      Top             =   2175
      Width           =   1335
   End
End
Attribute VB_Name = "FModificarStock"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Public GDblIdentificador As Double
Public GstrcodArticulo As String
Public GDblstkmax As Double
Public GDblstkmin As Double
Public GDblprecioventa As Double
Public GstrMoneda As String
Public GstrTipoPrecio As String
Public GstrCodInventariable As String
Public GstrCodNoInventariable As String

Private MrsListadoTipoPrecio As ADODB.Recordset
Private MobjArticulo As DB_INV_ARTICULO.C_ARTICULO
Private MobjTipodePrecio As DB_INV_MANTENIMIENTOS.C_TIPOPRECIO

Private Sub cmdgrabar_Click()
 If Trim(DtcTipoPrecio.BoundText) <> Empty Then
    MobjArticulo.ActualizarTempInventoryDat GDblIdentificador, GstrcodArticulo, Trim(lblcodalmacen.Caption), _
                 CTNstkmin.Text, CTNstkmax.Text, DtcTipoPrecio.BoundText, CTNprecioVent.Text, txtcodsolinvent.Text, _
                 txtcodsolNoinvent.Text
    Unload Me
 Else
    MsgBox "Debe ingresar un tipo de precio", vbDefaultButton1 + vbExclamation, "Mensaje"
 End If
 
End Sub

Private Sub cmdSalir_Click()
  Unload Me
End Sub

Private Sub DtcTipoPrecio_Click(Area As Integer)
    If DtcTipoPrecio.BoundText <> Empty Then
       lblmoneda.Caption = MobjTipodePrecio.ListarPorTiposPrecioID(DtcTipoPrecio.BoundText)!desccurr
    End If
End Sub

Private Sub Form_Activate()
   CTNstkmax.Text = GFormatodeNumero(GDblstkmax, GintDecStock)
   CTNstkmin.Text = GFormatodeNumero(GDblstkmin, GintDecStock)
   CTNprecioVent.Text = GFormatodeNumero(GDblprecioventa, GintDecPrecio)
   DtcTipoPrecio.BoundText = GstrTipoPrecio
   lblmoneda.Caption = GstrMoneda
   
   'Mi Mercado (modificado para mostrar cod. solomon po defecto)
   If nuevoReg = True Then 'Nuevo registro de articulo
      txtcodsolinvent.Text = "CS001"
      txtcodsolNoinvent.Text = "CS002"
   End If
   If editReg = True Then  'Modificando registro de articulo
      txtcodsolinvent.Text = GstrCodInventariable
      txtcodsolNoinvent.Text = GstrCodNoInventariable
   End If
End Sub

Private Sub Form_Load()
  
  Me.Top = 3500
  Me.Left = 4500
  
  CTNprecioVent.Enteros = 4
  CTNprecioVent.Decimales = GintDecPrecio
  CTNprecioVent.ValorPorDefecto
  CTNstkmin.Enteros = 7
  CTNstkmin.Decimales = GintDecStock
  CTNstkmin.ValorPorDefecto
  CTNstkmax.Enteros = 7
  CTNstkmax.Decimales = GintDecStock
  CTNstkmax.ValorPorDefecto
  
  Set MobjArticulo = New DB_INV_ARTICULO.C_ARTICULO
  
  'Obtener los registros para la Moneda
  Set MobjTipodePrecio = New DB_INV_MANTENIMIENTOS.C_TIPOPRECIO
  Set MrsListadoTipoPrecio = MobjTipodePrecio.ListarTiposPrecios
  
  Set DtcTipoPrecio.DataSource = MrsListadoTipoPrecio
  DtcTipoPrecio.DataField = "descr"
  Set DtcTipoPrecio.RowSource = MrsListadoTipoPrecio
  DtcTipoPrecio.ListField = "descr"
  DtcTipoPrecio.BoundColumn = "PRECLVID"
   
 
End Sub

Private Sub Form_Unload(Cancel As Integer)
   Set MrsListadoTipoPrecio = Nothing
   Set MobjArticulo = Nothing
   Set MobjTipodePrecio = Nothing
End Sub


Private Sub txtcodsolinvent_KeyPress(KeyAscii As Integer)
  KeyAscii = GBloqueaCaracter(KeyAscii)
End Sub

Private Sub txtcodsolNoinvent_KeyPress(KeyAscii As Integer)
  KeyAscii = GBloqueaCaracter(KeyAscii)
End Sub
