VERSION 5.00
Object = "{F0D2F211-CCB0-11D0-A316-00AA00688B10}#1.0#0"; "MSDATLST.OCX"
Object = "{86CF1D34-0C5F-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCT2.OCX"
Begin VB.Form FRegistroCtrlPD 
   BorderStyle     =   1  'Fixed Single
   Caption         =   "Registrar Control"
   ClientHeight    =   3525
   ClientLeft      =   45
   ClientTop       =   330
   ClientWidth     =   6855
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   ScaleHeight     =   3525
   ScaleWidth      =   6855
   StartUpPosition =   3  'Windows Default
   Begin VB.Frame Frame1 
      Height          =   3495
      Left            =   0
      TabIndex        =   0
      Top             =   0
      Width           =   6855
      Begin VB.CommandButton cmdgrabar 
         Caption         =   "&Grabar"
         Height          =   800
         Left            =   5520
         Picture         =   "FRegistroCtrlPD.frx":0000
         Style           =   1  'Graphical
         TabIndex        =   12
         Top             =   1440
         Width           =   1095
      End
      Begin VB.CommandButton cmdsalir 
         Caption         =   "Cancelar"
         Height          =   800
         Left            =   5520
         Picture         =   "FRegistroCtrlPD.frx":0532
         Style           =   1  'Graphical
         TabIndex        =   11
         Top             =   2280
         Width           =   1095
      End
      Begin VB.TextBox TxtObservacion 
         Height          =   975
         Left            =   120
         MultiLine       =   -1  'True
         ScrollBars      =   2  'Vertical
         TabIndex        =   9
         Top             =   2280
         Width           =   5175
      End
      Begin VB.Frame Frame2 
         Height          =   735
         Left            =   120
         TabIndex        =   6
         Top             =   1080
         Width           =   3615
         Begin VB.CheckBox ChkFisico 
            Caption         =   "Físico OK"
            Height          =   255
            Left            =   1560
            TabIndex        =   8
            Top             =   240
            Width           =   1215
         End
         Begin VB.CheckBox ChkBancos 
            Caption         =   "Bancos OK"
            Height          =   255
            Left            =   120
            TabIndex        =   7
            Top             =   240
            Width           =   1455
         End
      End
      Begin MSComCtl2.DTPicker DTPFechaProceso 
         Height          =   375
         Left            =   1680
         TabIndex        =   5
         Top             =   600
         Width           =   1455
         _ExtentX        =   2566
         _ExtentY        =   661
         _Version        =   393216
         Format          =   71368705
         CurrentDate     =   37921
      End
      Begin VB.CommandButton cmdBuscar 
         Height          =   375
         Left            =   5040
         Picture         =   "FRegistroCtrlPD.frx":083C
         Style           =   1  'Graphical
         TabIndex        =   2
         Top             =   240
         Width           =   375
      End
      Begin MSDataListLib.DataCombo DtcAlmacen 
         Height          =   315
         Left            =   1680
         TabIndex        =   3
         Top             =   240
         Width           =   3330
         _ExtentX        =   5874
         _ExtentY        =   556
         _Version        =   393216
         Style           =   2
         Text            =   ""
         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 Label3 
         Caption         =   "Comentario"
         Height          =   255
         Left            =   120
         TabIndex        =   10
         Top             =   2040
         Width           =   1815
      End
      Begin VB.Label Label2 
         Caption         =   "Fecha de Proceso"
         Height          =   255
         Left            =   240
         TabIndex        =   4
         Top             =   720
         Width           =   1575
      End
      Begin VB.Label Label1 
         Caption         =   "Almacen"
         Height          =   255
         Left            =   240
         TabIndex        =   1
         Top             =   280
         Width           =   1695
      End
   End
End
Attribute VB_Name = "FRegistroCtrlPD"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
'*******************************************************************************************************************
' Variables para las ayudas
Public GrecibeUbicacion As BookmarkEnum
Public GrecibeColumnaID As String
Public GrecibeColumnaOpcional As String 'columna para codigo de compra
Public GrecibeColumnaOpcional2 As String
Public GrecibeColumnaOpcional3 As String
Public GrecibeColumnaOpcional4 As String 'columna para costo

'*******************************************************************************************************************

Public MblnAgregarModificar As String

Private MobjAlmacen As DB_INV_MANTENIMIENTOS.C_ALMACEN
Private MobjProcesos As DB_UT_MANTENIMIENTOS.C_PROCESOS

Sub instanciarObjetos()
   
   Set MobjAlmacen = New DB_INV_MANTENIMIENTOS.C_ALMACEN
   Set MobjProcesos = New DB_UT_MANTENIMIENTOS.C_PROCESOS

End Sub

Sub DestruirObjetos()

   Set MobjAlmacen = Nothing
   Set MobjProcesos = Nothing
   
End Sub

Private Sub cmdBuscar_Click()

    Dim ArrayBusqueda(1 To 2, 1 To 3) As Variant
    ArrayBusqueda(1, 1) = "Siteid"
    ArrayBusqueda(1, 2) = "Código "
    ArrayBusqueda(1, 3) = 1000
    ArrayBusqueda(2, 1) = "Name"
    ArrayBusqueda(2, 2) = "Descripción "
    ArrayBusqueda(2, 3) = 4000
      
    FBusquedaUtModal.GObtenerRegistros MobjAlmacen.ListarAlmacenesPorStatus(1), ArrayBusqueda, 2, 2
    FBusquedaUtModal.Show vbModal
    
    If GrecibeUbicacion <> 0 Then
        DtcAlmacen.BoundText = GrecibeColumnaID
    End If


End Sub

Private Sub cmdgrabar_Click()
    
On Error GoTo errhandler

    Dim StrCadena As String
    Dim IntBancos As Integer
    Dim IntFisico As Integer
    
    If ChkBancos.Value = 1 Then
       IntBancos = 1
    Else
       IntBancos = 0
    End If
    
    If ChkFisico.Value = 1 Then
       IntFisico = 1
    Else
       IntFisico = 0
    End If
    
    
    If MblnAgregarModificar = "A" Then
    
      
       StrCadena = " OP_CTRLPDAYINSPROC '" & DtcAlmacen.BoundText & "','" & DTPFechaProceso.Value & "'," & _
                                             IntBancos & "," & IntFisico & ",'" & TxtObservacion.Text & "','" & GCUSERID & "'"
  
        If MsgBox("Seguro que desea Grabar el Registro", vbYesNo + vbQuestion, "Mensaje") = vbYes Then
           MobjProcesos.Auxiliar1 (StrCadena)
        Else
           Exit Sub
        End If
            
    Else
       If MblnAgregarModificar = "M" Then
          
          
          StrCadena = " OP_CTRLPDAYUPDPROC '" & DtcAlmacen.BoundText & "','" & DTPFechaProceso.Value & "'," & _
                                              IntBancos & "," & IntFisico & ",'" & TxtObservacion.Text & "','" & GCUSERID & "'"
                                              
          If MsgBox("Seguro que desea Actualizar el Registro", vbYesNo + vbQuestion, "Mensaje") = vbYes Then
             MobjProcesos.Auxiliar1 (StrCadena)
          Else
            Exit Sub
          End If
       End If
    End If
        
    Unload Me
        
Exit Sub
        
errhandler:
     MsgBox Err.Description, vbDefaultButton1 + vbExclamation, "Mensaje"
        
End Sub

Private Sub cmdSalir_Click()

  Unload Me
  
End Sub

Private Sub Form_Load()
  
  
  Me.Left = (Screen.Width - Me.Width) / 2
  Me.Top = (Screen.Height - Me.Height) / 2
  
  instanciarObjetos
  Call CargaDataCombo(DtcAlmacen, MobjAlmacen.ListarAlmacenesPorStatus(1), "SiteId", "Name")
  
  
End Sub

Private Sub Form_Unload(Cancel As Integer)

  DestruirObjetos
  
End Sub
