VERSION 5.00
Object = "{F0D2F211-CCB0-11D0-A316-00AA00688B10}#1.0#0"; "MSDATLST.OCX"
Object = "{CDE57A40-8B86-11D0-B3C6-00A0C90AEA82}#1.0#0"; "MSDATGRD.OCX"
Object = "{69F9D01E-F1DE-11D4-9536-002018603DA2}#7.0#0"; "MICONTROL.OCX"
Object = "{86CF1D34-0C5F-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCT2.OCX"
Begin VB.Form FIngresos 
   BorderStyle     =   1  'Fixed Single
   Caption         =   "Ingresos (10.010.00)"
   ClientHeight    =   6750
   ClientLeft      =   45
   ClientTop       =   330
   ClientWidth     =   10140
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MDIChild        =   -1  'True
   ScaleHeight     =   6750
   ScaleWidth      =   10140
   Begin VB.Frame Frame8 
      Appearance      =   0  'Flat
      BackColor       =   &H80000004&
      ForeColor       =   &H80000008&
      Height          =   1095
      Left            =   120
      TabIndex        =   39
      Top             =   4800
      Width           =   8655
      Begin MSDataListLib.DataCombo DataCombo1 
         Height          =   315
         Left            =   1080
         TabIndex        =   46
         Top             =   240
         Width           =   4095
         _ExtentX        =   7223
         _ExtentY        =   556
         _Version        =   393216
         Text            =   ""
      End
      Begin VB.CommandButton cmdBuscaArticulo 
         Height          =   375
         Left            =   5280
         Picture         =   "1001000.frx":0000
         Style           =   1  'Graphical
         TabIndex        =   40
         TabStop         =   0   'False
         Top             =   220
         Width           =   375
      End
      Begin MiControl.CtrlNumber txtprecio 
         Height          =   375
         Left            =   3840
         TabIndex        =   41
         Top             =   645
         Width           =   1320
         _ExtentX        =   2328
         _ExtentY        =   661
         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 txtunidades 
         Height          =   375
         Left            =   1080
         TabIndex        =   42
         Top             =   645
         Width           =   1095
         _ExtentX        =   1931
         _ExtentY        =   661
         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 lblArticulo 
         Caption         =   "Artículo"
         Height          =   255
         Left            =   240
         TabIndex        =   45
         Top             =   240
         Width           =   615
      End
      Begin VB.Label lblUnidades 
         Caption         =   "Unidades"
         Height          =   255
         Left            =   240
         TabIndex        =   44
         Top             =   645
         Width           =   855
      End
      Begin VB.Label lblper 
         Caption         =   "Costo"
         Height          =   255
         Left            =   3120
         TabIndex        =   43
         Top             =   645
         Width           =   615
      End
   End
   Begin VB.CommandButton Command4 
      Caption         =   "Grabar"
      Height          =   495
      Left            =   8880
      Picture         =   "1001000.frx":0532
      Style           =   1  'Graphical
      TabIndex        =   38
      Top             =   6000
      Width           =   1215
   End
   Begin VB.CommandButton Command3 
      Caption         =   "Actualizar"
      Height          =   495
      Left            =   8880
      Picture         =   "1001000.frx":0A64
      Style           =   1  'Graphical
      TabIndex        =   37
      Top             =   4080
      Width           =   855
   End
   Begin VB.CommandButton Command2 
      Caption         =   "Eliminar"
      Height          =   495
      Left            =   8880
      Picture         =   "1001000.frx":0F96
      Style           =   1  'Graphical
      TabIndex        =   36
      Top             =   3600
      Width           =   855
   End
   Begin VB.CommandButton dtcArticulos 
      Caption         =   "Nuevo"
      Height          =   495
      Left            =   8880
      Picture         =   "1001000.frx":1098
      Style           =   1  'Graphical
      TabIndex        =   35
      Top             =   3120
      Width           =   855
   End
   Begin VB.Frame fraValores 
      Appearance      =   0  'Flat
      BackColor       =   &H80000004&
      ForeColor       =   &H80000008&
      Height          =   735
      Left            =   120
      TabIndex        =   12
      Top             =   5880
      Width           =   8655
      Begin VB.Label lblVenta 
         Alignment       =   1  'Right Justify
         Appearance      =   0  'Flat
         BackColor       =   &H8000000B&
         BorderStyle     =   1  'Fixed Single
         Caption         =   "0"
         BeginProperty Font 
            Name            =   "MS Sans Serif"
            Size            =   9.75
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H80000008&
         Height          =   375
         Left            =   1320
         TabIndex        =   19
         Top             =   240
         Width           =   1455
      End
      Begin VB.Label lblSimbolo 
         Alignment       =   2  'Center
         AutoSize        =   -1  'True
         Caption         =   "S/."
         BeginProperty Font 
            Name            =   "MS Sans Serif"
            Size            =   9.75
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   240
         Left            =   6330
         TabIndex        =   18
         Top             =   285
         Width           =   315
      End
      Begin VB.Label lblTotal 
         Alignment       =   1  'Right Justify
         Appearance      =   0  'Flat
         BackColor       =   &H8000000B&
         BorderStyle     =   1  'Fixed Single
         Caption         =   "0"
         BeginProperty Font 
            Name            =   "MS Sans Serif"
            Size            =   9.75
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H80000008&
         Height          =   375
         Left            =   6720
         TabIndex        =   17
         Top             =   240
         Width           =   1455
      End
      Begin VB.Label lblTot 
         AutoSize        =   -1  'True
         Caption         =   "Total"
         BeginProperty Font 
            Name            =   "MS Sans Serif"
            Size            =   9.75
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   240
         Left            =   5640
         TabIndex        =   16
         Top             =   285
         Width           =   555
      End
      Begin VB.Label lblMIGV 
         Alignment       =   1  'Right Justify
         Appearance      =   0  'Flat
         BackColor       =   &H8000000B&
         BorderStyle     =   1  'Fixed Single
         Caption         =   "0"
         BeginProperty Font 
            Name            =   "MS Sans Serif"
            Size            =   9.75
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H80000008&
         Height          =   375
         Left            =   3840
         TabIndex        =   15
         Top             =   240
         Width           =   1455
      End
      Begin VB.Label lblIGV 
         AutoSize        =   -1  'True
         Caption         =   "I.G.V."
         BeginProperty Font 
            Name            =   "MS Sans Serif"
            Size            =   9.75
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   240
         Left            =   3120
         TabIndex        =   14
         Top             =   285
         Width           =   570
      End
      Begin VB.Label lblValorVenta 
         AutoSize        =   -1  'True
         Caption         =   "V. Venta"
         BeginProperty Font 
            Name            =   "MS Sans Serif"
            Size            =   9.75
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   240
         Left            =   240
         TabIndex        =   13
         Top             =   285
         Width           =   885
      End
   End
   Begin MSDataGridLib.DataGrid DBDetalle 
      Height          =   1575
      Left            =   120
      TabIndex        =   5
      Top             =   3120
      Width           =   8655
      _ExtentX        =   15266
      _ExtentY        =   2778
      _Version        =   393216
      HeadLines       =   1
      RowHeight       =   15
      BeginProperty HeadFont {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
      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
      ColumnCount     =   2
      BeginProperty Column00 
         DataField       =   ""
         Caption         =   ""
         BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
            Type            =   0
            Format          =   ""
            HaveTrueFalseNull=   0
            FirstDayOfWeek  =   0
            FirstWeekOfYear =   0
            LCID            =   10250
            SubFormatType   =   0
         EndProperty
      EndProperty
      BeginProperty Column01 
         DataField       =   ""
         Caption         =   ""
         BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
            Type            =   0
            Format          =   ""
            HaveTrueFalseNull=   0
            FirstDayOfWeek  =   0
            FirstWeekOfYear =   0
            LCID            =   10250
            SubFormatType   =   0
         EndProperty
      EndProperty
      SplitCount      =   1
      BeginProperty Split0 
         BeginProperty Column00 
         EndProperty
         BeginProperty Column01 
         EndProperty
      EndProperty
   End
   Begin VB.Frame fraDatos 
      Appearance      =   0  'Flat
      BackColor       =   &H80000004&
      Caption         =   "Datos Generales"
      ForeColor       =   &H80000008&
      Height          =   2895
      Left            =   120
      TabIndex        =   6
      Top             =   120
      Width           =   8655
      Begin VB.TextBox txtNumeroDoc 
         Height          =   285
         Left            =   6120
         MaxLength       =   10
         TabIndex        =   34
         Text            =   "0000000000"
         Top             =   720
         Width           =   1095
      End
      Begin VB.CommandButton cmdBusTipoIng 
         Height          =   375
         Left            =   4680
         MouseIcon       =   "1001000.frx":15CA
         MousePointer    =   99  'Custom
         Picture         =   "1001000.frx":171C
         Style           =   1  'Graphical
         TabIndex        =   33
         ToolTipText     =   "Buscar"
         Top             =   720
         Width           =   375
      End
      Begin MSDataListLib.DataCombo dtcTipoIngreso 
         Height          =   315
         Left            =   1440
         TabIndex        =   28
         Top             =   720
         Width           =   3135
         _ExtentX        =   5530
         _ExtentY        =   556
         _Version        =   393216
         Text            =   ""
      End
      Begin VB.Frame fraFlag 
         Height          =   1095
         Left            =   5400
         TabIndex        =   25
         Top             =   1680
         Width           =   2055
         Begin VB.CheckBox chkEmitido 
            Alignment       =   1  'Right Justify
            Caption         =   "Emitido        "
            Enabled         =   0   'False
            Height          =   195
            Left            =   120
            TabIndex        =   27
            Top             =   720
            Width           =   1335
         End
         Begin VB.CheckBox chkDesemsamble 
            Alignment       =   1  'Right Justify
            Caption         =   "Desemsamble"
            Enabled         =   0   'False
            Height          =   255
            Left            =   120
            TabIndex        =   26
            Top             =   240
            Width           =   1335
         End
      End
      Begin VB.CommandButton cmdBuscar 
         Height          =   375
         Left            =   2880
         MouseIcon       =   "1001000.frx":1C4E
         MousePointer    =   99  'Custom
         Picture         =   "1001000.frx":1DA0
         Style           =   1  'Graphical
         TabIndex        =   24
         ToolTipText     =   "Buscar"
         Top             =   300
         Width           =   375
      End
      Begin VB.CommandButton cmdBusTipoDoc 
         Height          =   375
         Left            =   4680
         MouseIcon       =   "1001000.frx":22D2
         MousePointer    =   99  'Custom
         Picture         =   "1001000.frx":2424
         Style           =   1  'Graphical
         TabIndex        =   2
         ToolTipText     =   "Buscar"
         Top             =   1980
         Width           =   375
      End
      Begin VB.CommandButton cmdBusProveedor 
         Height          =   375
         Left            =   4680
         MouseIcon       =   "1001000.frx":2956
         MousePointer    =   99  'Custom
         Picture         =   "1001000.frx":2AA8
         Style           =   1  'Graphical
         TabIndex        =   1
         ToolTipText     =   "Buscar"
         Top             =   1560
         Width           =   375
      End
      Begin VB.CommandButton cmdBusMoneda 
         Height          =   375
         Left            =   4680
         MouseIcon       =   "1001000.frx":2FDA
         MousePointer    =   99  'Custom
         Picture         =   "1001000.frx":312C
         Style           =   1  'Graphical
         TabIndex        =   3
         ToolTipText     =   "Buscar"
         Top             =   2400
         Width           =   375
      End
      Begin VB.CommandButton cmdBusAlmacen 
         Height          =   375
         Left            =   4680
         MouseIcon       =   "1001000.frx":365E
         MousePointer    =   99  'Custom
         Picture         =   "1001000.frx":37B0
         Style           =   1  'Graphical
         TabIndex        =   0
         ToolTipText     =   "Buscar"
         Top             =   1140
         Width           =   375
      End
      Begin MSComCtl2.DTPicker dtpFecha 
         Height          =   315
         Left            =   6120
         TabIndex        =   4
         Top             =   1200
         Width           =   1245
         _ExtentX        =   2196
         _ExtentY        =   556
         _Version        =   393216
         CustomFormat    =   "dd/MM/yyyy"
         Format          =   24641539
         CurrentDate     =   36480
      End
      Begin MSDataListLib.DataCombo dtcAlmacen 
         Height          =   315
         Left            =   1440
         TabIndex        =   29
         Top             =   1140
         Width           =   3135
         _ExtentX        =   5530
         _ExtentY        =   556
         _Version        =   393216
         Text            =   ""
      End
      Begin MSDataListLib.DataCombo dtcProveedor 
         Height          =   315
         Left            =   1440
         TabIndex        =   30
         Top             =   1560
         Width           =   3135
         _ExtentX        =   5530
         _ExtentY        =   556
         _Version        =   393216
         Text            =   ""
      End
      Begin MSDataListLib.DataCombo dtcTipoDoc 
         Height          =   315
         Left            =   1440
         TabIndex        =   31
         Top             =   1980
         Width           =   3135
         _ExtentX        =   5530
         _ExtentY        =   556
         _Version        =   393216
         Text            =   ""
      End
      Begin MSDataListLib.DataCombo dtcMoneda 
         Height          =   315
         Left            =   1440
         TabIndex        =   32
         Top             =   2400
         Width           =   3135
         _ExtentX        =   5530
         _ExtentY        =   556
         _Version        =   393216
         Text            =   ""
      End
      Begin VB.Label lblNroIngreso 
         Caption         =   "Nro. Ingreso"
         Height          =   255
         Left            =   240
         TabIndex        =   23
         Top             =   300
         Width           =   975
      End
      Begin VB.Label lblNumero 
         Alignment       =   1  'Right Justify
         BorderStyle     =   1  'Fixed Single
         Height          =   285
         Left            =   1440
         TabIndex        =   22
         Top             =   360
         Width           =   1335
      End
      Begin VB.Label lblTipoDoc 
         AutoSize        =   -1  'True
         Caption         =   "Tipo Doc."
         Height          =   195
         Left            =   240
         TabIndex        =   21
         Top             =   1980
         Width           =   705
      End
      Begin VB.Label Label5 
         AutoSize        =   -1  'True
         Caption         =   "Proveedor"
         Height          =   195
         Left            =   240
         TabIndex        =   20
         Top             =   1560
         Width           =   735
      End
      Begin VB.Label lblNroDoc 
         AutoSize        =   -1  'True
         Caption         =   "Nª Doc."
         Height          =   195
         Left            =   5400
         TabIndex        =   11
         Top             =   720
         Width           =   570
      End
      Begin VB.Label lblFecha 
         AutoSize        =   -1  'True
         Caption         =   "Fecha"
         Height          =   195
         Left            =   5400
         TabIndex        =   10
         Top             =   1200
         Width           =   450
      End
      Begin VB.Label lblMoneda 
         AutoSize        =   -1  'True
         Caption         =   "Moneda"
         Height          =   195
         Left            =   240
         TabIndex        =   9
         Top             =   2400
         Width           =   585
      End
      Begin VB.Label lblTipoIngreso 
         AutoSize        =   -1  'True
         Caption         =   "Tipo Ingreso"
         Height          =   195
         Left            =   240
         TabIndex        =   8
         Top             =   720
         Width           =   885
      End
      Begin VB.Label lblAlmacen 
         AutoSize        =   -1  'True
         Caption         =   "Almacen"
         Height          =   195
         Left            =   240
         TabIndex        =   7
         Top             =   1140
         Width           =   615
      End
   End
End
Attribute VB_Name = "FIngresos"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit

'************************************
' Variables que almacenan la ubicacion
' de los Items en los Datacombos cuando
' se cambia de Screen

Dim MstrTipoIng As String
Dim MstrAlmacen As String
Dim MstrProveedor As String
Dim MstrTipoDoc As String
Dim MstrMoneda As String

'*************************************
' Variables para las ayudas
Public GrecibeUbicacion As BookmarkEnum
Public GrecibeColumnaID As String

'*************************************
' Objetos para cargar las ayudas
Public objTipoIngreso As DB_INV_MANTENIMIENTOS.C_TIPOMOVIMIENTO
Public objAlmacen As DB_INV_MANTENIMIENTOS.C_ALMACEN
Public objProveedor As DB_INV_MANTENIMIENTOS.C_PROVEEDOR
Public objDocumento As DB_MA_MANTENIMIENTOS.C_DOCUMENTO
Public objMoneda As DB_MA_MANTENIMIENTOS.C_MONEDA
Public objArticulo As DB_INV_MOVIMIENTOS.C_MOVIMIENTOS
'***************************************************************


Private Sub cmdBusAlmacen_Click()
    'Lineas que llaman al Formulario de Búsqueda
    
    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
      
    FBusquedasInv.GObtenerRegistros objAlmacen.ListarAlmacenesAyuda, ArrayBusqueda, 2, 2
    FBusquedasInv.Show vbModal
    
    If GrecibeUbicacion <> 0 Then
        dtcAlmacen.BoundText = GrecibeColumnaID
    End If
End Sub

Private Sub cmdBuscaArticulo_Click()
    'Lineas que llaman al Formulario de Búsqueda
     
     Dim ArrayBusqueda(1 To 2, 1 To 3) As Variant
     ArrayBusqueda(1, 1) = "Invtidsku"
     ArrayBusqueda(1, 2) = "Código "
     ArrayBusqueda(1, 3) = 1000
     ArrayBusqueda(2, 1) = "Descr"
     ArrayBusqueda(2, 2) = "Descripción "
     ArrayBusqueda(2, 3) = 4000
       
     FBusquedasInv.GObtenerRegistros objArticulo.ListarArticulos, ArrayBusqueda, 2, 2
     FBusquedasInv.Show vbModal
     
     If GrecibeUbicacion <> 0 Then
         dtcArticulos.BoundText = GrecibeColumnaID
     End If

End Sub

Private Sub cmdBusMoneda_Click()
    'Lineas que llaman al Formulario de Búsqueda
     
     Dim ArrayBusqueda(1 To 2, 1 To 3) As Variant
     ArrayBusqueda(1, 1) = "CuryId"
     ArrayBusqueda(1, 2) = "Código "
     ArrayBusqueda(1, 3) = 1000
     ArrayBusqueda(2, 1) = "Descr"
     ArrayBusqueda(2, 2) = "Descripción "
     ArrayBusqueda(2, 3) = 4000
       
     FBusquedasInv.GObtenerRegistros objMoneda.ListarMonedas, ArrayBusqueda, 2, 2
     FBusquedasInv.Show vbModal
     
     If GrecibeUbicacion <> 0 Then
         dtcMoneda.BoundText = GrecibeColumnaID
     End If
End Sub

Private Sub cmdBusProveedor_Click()
    'Lineas que llaman al Formulario de Búsqueda
    
    Dim ArrayBusqueda(1 To 2, 1 To 3) As Variant
    ArrayBusqueda(1, 1) = "Vendidss"
    ArrayBusqueda(1, 2) = "Código "
    ArrayBusqueda(1, 3) = 1000
    ArrayBusqueda(2, 1) = "Descr"
    ArrayBusqueda(2, 2) = "Descripción "
    ArrayBusqueda(2, 3) = 4000
      
    FBusquedasInv.GObtenerRegistros objProveedor.ListarProveedoresAyuda, ArrayBusqueda, 2, 2
    FBusquedasInv.Show vbModal
    
    If GrecibeUbicacion <> 0 Then
        dtcProveedor.BoundText = GrecibeColumnaID
    End If
End Sub

Private Sub cmdBusTipoDoc_Click()
  'Lineas que llaman al Formulario de Búsqueda
  
    Dim ArrayBusqueda(1 To 2, 1 To 3) As Variant
    ArrayBusqueda(1, 1) = "DocTypeid"
    ArrayBusqueda(1, 2) = "Código "
    ArrayBusqueda(1, 3) = 1000
    ArrayBusqueda(2, 1) = "Descr"
    ArrayBusqueda(2, 2) = "Descripción "
    ArrayBusqueda(2, 3) = 4000
    
    FBusquedasInv.GObtenerRegistros objDocumento.ListarDocumentos, ArrayBusqueda, 2, 2
    FBusquedasInv.Show vbModal
  
    If GrecibeUbicacion <> 0 Then
        dtcTipoDoc.BoundText = GrecibeColumnaID
    End If
End Sub

Private Sub cmdBusTipoIng_Click()
  'Lineas que llaman al Formulario de Búsqueda
    Dim ArrayBusqueda(1 To 2, 1 To 3) As Variant
    ArrayBusqueda(1, 1) = "TypeDocid"
    ArrayBusqueda(1, 2) = "Código "
    ArrayBusqueda(1, 3) = 1000
    ArrayBusqueda(2, 1) = "descr"
    ArrayBusqueda(2, 2) = "Descripción "
    ArrayBusqueda(2, 3) = 4000
    
    FBusquedasInv.GObtenerRegistros objTipoIngreso.ListarPorTipoMovimiento("0"), ArrayBusqueda, 2, 2
    FBusquedasInv.Show vbModal
  
    If GrecibeUbicacion <> 0 Then
        dtcTipoIngreso.BoundText = GrecibeColumnaID
    End If
End Sub

Private Sub Form_Activate()
    Call MLlenaDataCombos
    Call MUbicaItemEnDataCombo
End Sub

Private Sub Form_Deactivate()
    MstrTipoIng = dtcTipoIngreso.BoundText
    MstrAlmacen = dtcAlmacen.BoundText
    MstrProveedor = dtcProveedor.BoundText
    MstrTipoDoc = dtcTipoDoc.BoundText
    MstrMoneda = dtcMoneda.BoundText
End Sub

Private Sub Form_Load()
    Call MInstanciaObjetos
End Sub

Private Sub Form_Unload(Cancel As Integer)
    Call MDestruyeObjetos
End Sub

' Procedimiento para cargar DataCombos
Public Sub GCargaDataCombo(objDataCombo As DataCombo, rsSource As Recordset, istrCampo1 As String, istrCampo2 As String)
If rsSource.RecordCount <> 0 Then
    Set objDataCombo.DataSource = rsSource
    objDataCombo.DataField = istrCampo2
    Set objDataCombo.RowSource = rsSource
    objDataCombo.ListField = istrCampo2
    objDataCombo.BoundColumn = istrCampo1
    objDataCombo.BoundText = rsSource.Fields(istrCampo2)
End If
End Sub

' Procedimiento de carga de los DataCombos del formulario
Private Sub MLlenaDataCombos()
    Call GCargaDataCombo(dtcTipoIngreso, objTipoIngreso.ListarPorTipoMovimiento("0"), "TypeDocId", "Descr")
    Call GCargaDataCombo(dtcAlmacen, objAlmacen.ListarAlmacenesAyuda, "SiteId", "Name")
    Call GCargaDataCombo(dtcProveedor, objProveedor.ListarProveedoresAyuda, "Vendidss", "Descr")
    Call GCargaDataCombo(dtcTipoDoc, objDocumento.ListarDocumentos, "DocTypeId", "Descr")
    Call GCargaDataCombo(dtcMoneda, objMoneda.ListarMonedas, "CuryId", "Descr")
    Call GCargaDataCombo(dtcArticulos, objArticulo.ListarArticulos, "invIdsku", "Descr")
End Sub

Private Sub MUbicaItemEnDataCombo()
On Error Resume Next
    dtcTipoIngreso.BoundText = MstrTipoIng
    dtcAlmacen.BoundText = MstrAlmacen
    dtcProveedor.BoundText = MstrProveedor
    dtcTipoDoc.BoundText = MstrTipoDoc
    dtcMoneda.BoundText = MstrMoneda
End Sub

Private Sub MInstanciaObjetos()
    Set objTipoIngreso = New DB_INV_MANTENIMIENTOS.C_TIPOMOVIMIENTO
    Set objAlmacen = New DB_INV_MANTENIMIENTOS.C_ALMACEN
    Set objProveedor = New DB_INV_MANTENIMIENTOS.C_PROVEEDOR
    Set objDocumento = New DB_MA_MANTENIMIENTOS.C_DOCUMENTO
    Set objMoneda = New DB_MA_MANTENIMIENTOS.C_MONEDA
    Set objArticulo = New DB_INV_MOVIMIENTOS.C_MOVIMIENTOS
End Sub

Private Sub MDestruyeObjetos()
    Set objTipoIngreso = Nothing
    Set objAlmacen = Nothing
    Set objProveedor = Nothing
    Set objDocumento = Nothing
    Set objMoneda = Nothing
    Set objArticulo = Nothing
End Sub

' funcion que valida el ingreso de caracteres numéricos
Private Function MValidaNumeros(KeyAscii As Integer) As Integer
    If (KeyAscii >= 48 And KeyAscii <= 57) Or KeyAscii = 13 Or KeyAscii = 8 Then
        MValidaNumeros = KeyAscii
    Else
        MValidaNumeros = 0
    End If
End Function


Private Sub txtNumeroDoc_KeyPress(KeyAscii As Integer)
   KeyAscii = MValidaNumeros(KeyAscii)
   If KeyAscii = 13 Then
        dtpFecha.SetFocus
   End If
End Sub

Private Sub MCargaGrid()

End Sub
