VERSION 5.00
Object = "{F0D2F211-CCB0-11D0-A316-00AA00688B10}#1.0#0"; "MSDATLST.OCX"
Object = "{BDC217C8-ED16-11CD-956C-0000C04E4C0A}#1.1#0"; "TABCTL32.OCX"
Begin VB.Form FConfigInv 
   BorderStyle     =   1  'Fixed Single
   Caption         =   "Configuración del Módulo de Inventarios (95.050.00)"
   ClientHeight    =   5910
   ClientLeft      =   45
   ClientTop       =   330
   ClientWidth     =   9405
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MDIChild        =   -1  'True
   ScaleHeight     =   5910
   ScaleWidth      =   9405
   Begin TabDlg.SSTab SSTab1 
      Height          =   5865
      Left            =   0
      TabIndex        =   0
      Top             =   30
      Width           =   9405
      _ExtentX        =   16589
      _ExtentY        =   10345
      _Version        =   393216
      Tabs            =   2
      TabsPerRow      =   2
      TabHeight       =   520
      TabCaption(0)   =   "Datos Generales"
      TabPicture(0)   =   "9505000.frx":0000
      Tab(0).ControlEnabled=   -1  'True
      Tab(0).Control(0)=   "Label6"
      Tab(0).Control(0).Enabled=   0   'False
      Tab(0).Control(1)=   "Line2"
      Tab(0).Control(1).Enabled=   0   'False
      Tab(0).Control(2)=   "Label7"
      Tab(0).Control(2).Enabled=   0   'False
      Tab(0).Control(3)=   "Label8"
      Tab(0).Control(3).Enabled=   0   'False
      Tab(0).Control(4)=   "Shape3"
      Tab(0).Control(4).Enabled=   0   'False
      Tab(0).Control(5)=   "Shape4"
      Tab(0).Control(5).Enabled=   0   'False
      Tab(0).Control(6)=   "Label16"
      Tab(0).Control(6).Enabled=   0   'False
      Tab(0).Control(7)=   "Line3"
      Tab(0).Control(7).Enabled=   0   'False
      Tab(0).Control(8)=   "Label17"
      Tab(0).Control(8).Enabled=   0   'False
      Tab(0).Control(9)=   "Line4"
      Tab(0).Control(9).Enabled=   0   'False
      Tab(0).Control(10)=   "Label18"
      Tab(0).Control(10).Enabled=   0   'False
      Tab(0).Control(11)=   "Label19"
      Tab(0).Control(11).Enabled=   0   'False
      Tab(0).Control(12)=   "Line5"
      Tab(0).Control(12).Enabled=   0   'False
      Tab(0).Control(13)=   "Label20"
      Tab(0).Control(13).Enabled=   0   'False
      Tab(0).Control(14)=   "Image1"
      Tab(0).Control(14).Enabled=   0   'False
      Tab(0).Control(15)=   "Line6"
      Tab(0).Control(15).Enabled=   0   'False
      Tab(0).Control(16)=   "Label21"
      Tab(0).Control(16).Enabled=   0   'False
      Tab(0).Control(17)=   "Line8"
      Tab(0).Control(17).Enabled=   0   'False
      Tab(0).Control(18)=   "dtcTipoDoc"
      Tab(0).Control(18).Enabled=   0   'False
      Tab(0).Control(19)=   "dtcTransfIng"
      Tab(0).Control(19).Enabled=   0   'False
      Tab(0).Control(20)=   "dtcTransfSal"
      Tab(0).Control(20).Enabled=   0   'False
      Tab(0).Control(21)=   "txtReporte"
      Tab(0).Control(21).Enabled=   0   'False
      Tab(0).Control(22)=   "cmdRutaRep"
      Tab(0).Control(22).Enabled=   0   'False
      Tab(0).Control(23)=   "txtProveedorEst"
      Tab(0).Control(23).Enabled=   0   'False
      Tab(0).Control(24)=   "DataCombo1"
      Tab(0).Control(24).Enabled=   0   'False
      Tab(0).ControlCount=   25
      TabCaption(1)   =   "Movimientos"
      TabPicture(1)   =   "9505000.frx":001C
      Tab(1).ControlEnabled=   0   'False
      Tab(1).Control(0)=   "dtcDesIng"
      Tab(1).Control(1)=   "dtcBonIng"
      Tab(1).Control(2)=   "dtcTomaInvIng"
      Tab(1).Control(3)=   "dtcCompCStIng"
      Tab(1).Control(4)=   "dtcCombIng"
      Tab(1).Control(5)=   "dtcInvIniIng"
      Tab(1).Control(6)=   "dtcDesSal"
      Tab(1).Control(7)=   "dtcTomaInvSal"
      Tab(1).Control(8)=   "dtcNotCredSal"
      Tab(1).Control(9)=   "Line9"
      Tab(1).Control(10)=   "Label22"
      Tab(1).Control(11)=   "Line7"
      Tab(1).Control(12)=   "Image2"
      Tab(1).Control(13)=   "Label15"
      Tab(1).Control(14)=   "Label14"
      Tab(1).Control(15)=   "Label13"
      Tab(1).Control(16)=   "Label12"
      Tab(1).Control(17)=   "Label11"
      Tab(1).Control(18)=   "Label10"
      Tab(1).Control(19)=   "Label9"
      Tab(1).Control(20)=   "Label2"
      Tab(1).Control(21)=   "Label1"
      Tab(1).Control(22)=   "Shape2"
      Tab(1).Control(23)=   "Shape1"
      Tab(1).Control(24)=   "Label5"
      Tab(1).Control(25)=   "Label4"
      Tab(1).Control(26)=   "Line1"
      Tab(1).Control(27)=   "Label3"
      Tab(1).ControlCount=   28
      Begin MSDataListLib.DataCombo DataCombo1 
         Height          =   315
         Left            =   4920
         TabIndex        =   38
         Top             =   3960
         Width           =   3855
         _ExtentX        =   6800
         _ExtentY        =   556
         _Version        =   393216
         Text            =   "DataCombo1"
      End
      Begin VB.TextBox txtProveedorEst 
         Height          =   315
         Left            =   540
         MaxLength       =   20
         TabIndex        =   37
         Top             =   2910
         Width           =   3855
      End
      Begin VB.CommandButton cmdRutaRep 
         Height          =   615
         Left            =   6360
         Picture         =   "9505000.frx":0038
         Style           =   1  'Graphical
         TabIndex        =   34
         Top             =   4860
         Visible         =   0   'False
         Width           =   675
      End
      Begin VB.TextBox txtReporte 
         Height          =   315
         Left            =   570
         TabIndex        =   32
         Top             =   5130
         Width           =   5715
      End
      Begin MSDataListLib.DataCombo dtcTransfSal 
         Height          =   315
         Left            =   4830
         TabIndex        =   1
         Top             =   1860
         Width           =   3975
         _ExtentX        =   7011
         _ExtentY        =   556
         _Version        =   393216
         Style           =   2
         Text            =   "DataCombo2"
      End
      Begin MSDataListLib.DataCombo dtcTransfIng 
         Height          =   315
         Left            =   540
         TabIndex        =   2
         Top             =   1860
         Width           =   3885
         _ExtentX        =   6853
         _ExtentY        =   556
         _Version        =   393216
         Style           =   2
         Text            =   "DataCombo1"
      End
      Begin MSDataListLib.DataCombo dtcDesIng 
         Height          =   315
         Left            =   -74490
         TabIndex        =   9
         Top             =   2040
         Width           =   3945
         _ExtentX        =   6959
         _ExtentY        =   556
         _Version        =   393216
         Style           =   2
         Text            =   "DataCombo3"
      End
      Begin MSDataListLib.DataCombo dtcBonIng 
         Height          =   315
         Left            =   -74490
         TabIndex        =   11
         Top             =   2670
         Width           =   3945
         _ExtentX        =   6959
         _ExtentY        =   556
         _Version        =   393216
         Style           =   2
         Text            =   "DataCombo3"
      End
      Begin MSDataListLib.DataCombo dtcTomaInvIng 
         Height          =   315
         Left            =   -74490
         TabIndex        =   13
         Top             =   3300
         Width           =   3945
         _ExtentX        =   6959
         _ExtentY        =   556
         _Version        =   393216
         Style           =   2
         Text            =   "DataCombo3"
      End
      Begin MSDataListLib.DataCombo dtcCompCStIng 
         Height          =   315
         Left            =   -74490
         TabIndex        =   15
         Top             =   3930
         Width           =   3945
         _ExtentX        =   6959
         _ExtentY        =   556
         _Version        =   393216
         Style           =   2
         Text            =   "DataCombo3"
      End
      Begin MSDataListLib.DataCombo dtcCombIng 
         Height          =   315
         Left            =   -74490
         TabIndex        =   17
         Top             =   4530
         Width           =   3945
         _ExtentX        =   6959
         _ExtentY        =   556
         _Version        =   393216
         Style           =   2
         Text            =   "DataCombo3"
      End
      Begin MSDataListLib.DataCombo dtcInvIniIng 
         Height          =   315
         Left            =   -74490
         TabIndex        =   19
         Top             =   5130
         Width           =   3945
         _ExtentX        =   6959
         _ExtentY        =   556
         _Version        =   393216
         Style           =   2
         Text            =   "DataCombo3"
      End
      Begin MSDataListLib.DataCombo dtcDesSal 
         Height          =   315
         Left            =   -70140
         TabIndex        =   21
         Top             =   2040
         Width           =   3945
         _ExtentX        =   6959
         _ExtentY        =   556
         _Version        =   393216
         Style           =   2
         Text            =   "DataCombo3"
      End
      Begin MSDataListLib.DataCombo dtcTomaInvSal 
         Height          =   315
         Left            =   -70140
         TabIndex        =   23
         Top             =   3300
         Width           =   3945
         _ExtentX        =   6959
         _ExtentY        =   556
         _Version        =   393216
         Style           =   2
         Text            =   "DataCombo3"
      End
      Begin MSDataListLib.DataCombo dtcNotCredSal 
         Height          =   315
         Left            =   -70140
         TabIndex        =   25
         Top             =   2670
         Width           =   3945
         _ExtentX        =   6959
         _ExtentY        =   556
         _Version        =   393216
         Style           =   2
         Text            =   "DataCombo3"
      End
      Begin MSDataListLib.DataCombo dtcTipoDoc 
         Height          =   315
         Left            =   570
         TabIndex        =   29
         Top             =   4020
         Width           =   3885
         _ExtentX        =   6853
         _ExtentY        =   556
         _Version        =   393216
         Style           =   2
         Text            =   "DataCombo1"
      End
      Begin VB.Line Line9 
         X1              =   -74730
         X2              =   -65910
         Y1              =   5640
         Y2              =   5640
      End
      Begin VB.Line Line8 
         X1              =   330
         X2              =   9120
         Y1              =   5640
         Y2              =   5640
      End
      Begin VB.Label Label22 
         Caption         =   "CONFIGURACIÓN DE MÓDULO DE INVENTARIOS"
         BeginProperty Font 
            Name            =   "MS Sans Serif"
            Size            =   9.75
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   225
         Left            =   -74280
         TabIndex        =   36
         Top             =   570
         Width           =   8055
      End
      Begin VB.Line Line7 
         X1              =   -74760
         X2              =   -65910
         Y1              =   900
         Y2              =   900
      End
      Begin VB.Image Image2 
         Height          =   480
         Left            =   -74850
         Picture         =   "9505000.frx":0342
         Top             =   390
         Width           =   480
      End
      Begin VB.Label Label21 
         Caption         =   "CONFIGURACIÓN DE MÓDULO DE INVENTARIOS"
         BeginProperty Font 
            Name            =   "MS Sans Serif"
            Size            =   9.75
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   225
         Left            =   720
         TabIndex        =   35
         Top             =   570
         Width           =   8055
      End
      Begin VB.Line Line6 
         X1              =   240
         X2              =   9090
         Y1              =   900
         Y2              =   900
      End
      Begin VB.Image Image1 
         Height          =   480
         Left            =   150
         Picture         =   "9505000.frx":064C
         Top             =   390
         Width           =   480
      End
      Begin VB.Label Label20 
         Caption         =   "Ruta :"
         Height          =   225
         Left            =   690
         TabIndex        =   33
         Top             =   4920
         Width           =   2235
      End
      Begin VB.Line Line5 
         X1              =   540
         X2              =   8910
         Y1              =   4800
         Y2              =   4800
      End
      Begin VB.Label Label19 
         Caption         =   "Reportes"
         BeginProperty Font 
            Name            =   "MS Sans Serif"
            Size            =   9.75
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   285
         Left            =   480
         TabIndex        =   31
         Top             =   4530
         Width           =   2745
      End
      Begin VB.Label Label18 
         Caption         =   "Ajuste en Toma de Inventario :"
         Height          =   315
         Left            =   660
         TabIndex        =   30
         Top             =   3780
         Width           =   2775
      End
      Begin VB.Line Line4 
         X1              =   480
         X2              =   8880
         Y1              =   3690
         Y2              =   3690
      End
      Begin VB.Label Label17 
         Caption         =   "Tipos de Documento"
         BeginProperty Font 
            Name            =   "MS Sans Serif"
            Size            =   9.75
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   285
         Left            =   420
         TabIndex        =   28
         Top             =   3420
         Width           =   2745
      End
      Begin VB.Line Line3 
         X1              =   480
         X2              =   8880
         Y1              =   2730
         Y2              =   2730
      End
      Begin VB.Label Label16 
         Caption         =   "Proveedor de Estación"
         BeginProperty Font 
            Name            =   "MS Sans Serif"
            Size            =   9.75
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   285
         Left            =   420
         TabIndex        =   27
         Top             =   2460
         Width           =   2745
      End
      Begin VB.Label Label15 
         Caption         =   "Nota de Crédito :"
         Height          =   255
         Left            =   -70140
         TabIndex        =   26
         Top             =   2430
         Width           =   2685
      End
      Begin VB.Label Label14 
         Caption         =   "Toma de Inventario :"
         Height          =   255
         Left            =   -70140
         TabIndex        =   24
         Top             =   3060
         Width           =   2685
      End
      Begin VB.Label Label13 
         Caption         =   "Desensamble :"
         Height          =   255
         Left            =   -70140
         TabIndex        =   22
         Top             =   1800
         Width           =   2685
      End
      Begin VB.Label Label12 
         Caption         =   "Inventario Inicial :"
         Height          =   255
         Left            =   -74490
         TabIndex        =   20
         Top             =   4890
         Width           =   2685
      End
      Begin VB.Label Label11 
         Caption         =   "Compras Combustible :"
         Height          =   255
         Left            =   -74490
         TabIndex        =   18
         Top             =   4290
         Width           =   2685
      End
      Begin VB.Label Label10 
         Caption         =   "Compras C-Store :"
         Height          =   255
         Left            =   -74490
         TabIndex        =   16
         Top             =   3690
         Width           =   2685
      End
      Begin VB.Label Label9 
         Caption         =   "Toma de Inventario :"
         Height          =   255
         Left            =   -74490
         TabIndex        =   14
         Top             =   3060
         Width           =   2685
      End
      Begin VB.Label Label2 
         Caption         =   "Bonificación :"
         Height          =   255
         Left            =   -74490
         TabIndex        =   12
         Top             =   2430
         Width           =   2685
      End
      Begin VB.Label Label1 
         Caption         =   "Desensamble :"
         Height          =   255
         Left            =   -74490
         TabIndex        =   10
         Top             =   1800
         Width           =   2685
      End
      Begin VB.Shape Shape2 
         Height          =   285
         Left            =   -70200
         Shape           =   4  'Rounded Rectangle
         Top             =   1410
         Width           =   4065
      End
      Begin VB.Shape Shape1 
         Height          =   285
         Left            =   -74550
         Shape           =   4  'Rounded Rectangle
         Top             =   1410
         Width           =   4035
      End
      Begin VB.Label Label5 
         Alignment       =   2  'Center
         Caption         =   "Ingresos"
         BeginProperty Font 
            Name            =   "MS Sans Serif"
            Size            =   8.25
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   195
         Left            =   -74430
         TabIndex        =   8
         Top             =   1440
         Width           =   3855
      End
      Begin VB.Label Label4 
         Alignment       =   2  'Center
         Caption         =   "Salidas"
         BeginProperty Font 
            Name            =   "MS Sans Serif"
            Size            =   8.25
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   195
         Left            =   -70080
         TabIndex        =   7
         Top             =   1440
         Width           =   3615
      End
      Begin VB.Line Line1 
         X1              =   -74550
         X2              =   -66120
         Y1              =   1320
         Y2              =   1320
      End
      Begin VB.Label Label3 
         Caption         =   "Tipos de Movimiento"
         BeginProperty Font 
            Name            =   "MS Sans Serif"
            Size            =   9.75
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   345
         Left            =   -74610
         TabIndex        =   6
         Top             =   1050
         Width           =   3345
      End
      Begin VB.Shape Shape4 
         Height          =   285
         Left            =   4800
         Shape           =   4  'Rounded Rectangle
         Top             =   1410
         Width           =   4065
      End
      Begin VB.Shape Shape3 
         Height          =   285
         Left            =   450
         Shape           =   4  'Rounded Rectangle
         Top             =   1410
         Width           =   4035
      End
      Begin VB.Label Label8 
         Alignment       =   2  'Center
         Caption         =   "Ingresos"
         BeginProperty Font 
            Name            =   "MS Sans Serif"
            Size            =   8.25
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   195
         Left            =   570
         TabIndex        =   5
         Top             =   1440
         Width           =   3855
      End
      Begin VB.Label Label7 
         Alignment       =   2  'Center
         Caption         =   "Salidas"
         BeginProperty Font 
            Name            =   "MS Sans Serif"
            Size            =   8.25
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   195
         Left            =   4920
         TabIndex        =   4
         Top             =   1440
         Width           =   3615
      End
      Begin VB.Line Line2 
         X1              =   450
         X2              =   8850
         Y1              =   1320
         Y2              =   1320
      End
      Begin VB.Label Label6 
         Caption         =   "Transferencias"
         BeginProperty Font 
            Name            =   "MS Sans Serif"
            Size            =   9.75
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   285
         Left            =   390
         TabIndex        =   3
         Top             =   1050
         Width           =   2745
      End
   End
End
Attribute VB_Name = "FConfigInv"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
' STORED PROCEDURES : SP_UpProcIN_SETUP
' LIBRERIAS :  C_INVENTARIO EN DB_UT_MANTENIMIENTOS

Option Explicit
'REFERENCIAS COMPONENTES

Public pb_editar As Boolean
Public pb_agregar As Boolean
Public pb_primerregistro As Boolean
Public pb_ultimoregistro As Boolean
Public pbderecho_agregar As Boolean
Public pbderecho_consultar As Boolean
Public pbderecho_editar As Boolean
Public pbderecho_borrar As Boolean
Public pbderecho_imprimir As Boolean
Public pb_tiposcreen As String

Public rs_ConfigInv As ADODB.Recordset
Public GrecibeUbicacion As BookmarkEnum
Public GrecibeColumnaID As String

Dim mobj_cseguridad As DB_SE_MANTENIMIENTOS.c_seguridad
Dim mobj_TiposDocInv As DB_UT_MANTENIMIENTOS.C_INVENTARIOS

Private Sub Form_Activate()
Call gactualizaopcion(pbderecho_agregar, pbderecho_editar, pbderecho_borrar, pbderecho_imprimir)
'Call gactualizaopcion(True, True, True, True)
'Call gactualiza_barra(Me)
'Call gactualiza_barra(pb_editar, pb_primerregistro, pb_ultimoregistro)
'lineas nuevas
If pbderecho_consultar = False Then
    Unload Me
End If
End Sub
Public Sub primer_registro()
'Call Gprimer_registro(Me, rs_ConfigInv)
'Call asigna_campos
End Sub
Public Sub ultimo_registro()
'Call Gultimo_registro(Me, rs_ConfigInv)
'Call asigna_campos
End Sub
Public Sub registro_anterior()
'Call Gregistro_anterior(Me, rs_ConfigInv)
'Call asigna_campos
End Sub
Public Sub registro_siguiente()
'Call Gregistro_siguiente(Me, rs_ConfigInv)
'Call asigna_campos
End Sub
Private Sub Form_Initialize()
Call gHabilitarReg(Me, False)
End Sub
Private Sub Form_Load()
'seguridad
Set mobj_cseguridad = New DB_SE_MANTENIMIENTOS.c_seguridad
Set mobj_TiposDocInv = New DB_UT_MANTENIMIENTOS.C_INVENTARIOS
Set rs_ConfigInv = New ADODB.Recordset

Call gseguridad(Me)
If pbderecho_consultar Then
    Call CargarDatosCfg
    Call obtener_datos
    Call asigna_campos
    Call HabilitaControles(False)
    pb_primerregistro = True
Else
    'Unload Me
    MsgBox ("No tiene Derechos de Consultar en este formulario")
End If
 Me.Top = 100
 Me.Left = (Screen.Width - Me.Width) / 2
End Sub

Public Sub borrar_registro()
On Error GoTo errhandler
Exit Sub
errhandler:
    MsgBox MensajedeError(Err.Number, Err.Description), vbDefaultButton1 + vbCritical, "Advertencia"
End Sub

Public Sub grabar_registro()
On Error GoTo errhandler
    mobj_TiposDocInv.ActualizarInSetup ver_nulo(Me.dtcTransfIng.BoundText), ver_nulo(Me.dtcTransfSal.BoundText), _
    ver_nulo(Me.txtReporte.Text), ver_nulo(Me.dtcDesIng.BoundText), ver_nulo(Me.dtcDesSal.BoundText), _
    ver_nulo(Me.dtcNotCredSal.BoundText), ver_nulo(Me.dtcBonIng.BoundText), ver_nulo(Me.dtcTomaInvIng.BoundText), _
    ver_nulo(Me.dtcTomaInvSal.BoundText), ver_nulo(Me.dtcCompCStIng.BoundText), ver_nulo(Me.dtcCombIng.BoundText), _
    ver_nulo(Me.dtcInvIniIng.BoundText), ver_nulo(Me.dtcTipoDoc.BoundText), ver_nulo(Me.txtProveedorEst.Text)
   
    
Exit Sub
errhandler:
    MsgBox MensajedeError(Err.Number, Err.Description), vbDefaultButton1 + vbCritical, "Advertencia"
End Sub

Public Sub actualizar_registro()
'llamar al procedimiento de carga
Call obtener_datos
Call asigna_campos
Call HabilitaControles(False)
'MsgBox ("Registros Actualizados")
End Sub

Public Sub agregar_registro()
'Call gagregar_registro(Me, txtuserid)
'dt_expiracion.Value = Date
End Sub

Public Sub modificar_registro()
If Not rs_ConfigInv.EOF Then
    Call HabilitaControles(True)
    Call gmodificar_registro(Me, Me.txtProveedorEst)
    Call obtener_datos
End If
End Sub

Public Sub descartar_registro()
    ' Revertir cambios
    'adodc1.Recordset.CancelUpdate
    Call gdescartar_registro(Me)
    Call obtener_datos
    Call asigna_campos
    Call HabilitaControles(False)
End Sub

Sub obtener_datos()
    'mobj_TiposDocInv.ListarTiposDocumentos
    'mobj_TiposDocInv.ListarTiposDocumentosInventario
    Static ING As Integer
    Static SAL As Integer
    
    ING = 1
    SAL = 0
    
    ' transferencias
    Call CargaDataCombo(Me.dtcTransfIng, mobj_TiposDocInv.ListarTiposDocumentosInventario(ING), "TypeDocID", "Descr")
    Call CargaDataCombo(Me.dtcTransfSal, mobj_TiposDocInv.ListarTiposDocumentosInventario(SAL), "TypeDocID", "Descr")
    
    ' tipo documento
    Call CargaDataCombo(Me.DataCombo1, mobj_TiposDocInv.Listartiposdocumentos, "DocTypeID", "Descr")
    ''Call CargaDataCombo(Me.DataCombo1, Listartiposdocumentos, "DocTypeID", "Descr")
    
    ' tipo movimiento
    Call CargaDataCombo(Me.dtcBonIng, mobj_TiposDocInv.ListarTiposDocumentosInventario(ING), "TypeDocID", "Descr")
    Call CargaDataCombo(Me.dtcCompCStIng, mobj_TiposDocInv.ListarTiposDocumentosInventario(ING), "TypeDocID", "Descr")
    Call CargaDataCombo(Me.dtcCombIng, mobj_TiposDocInv.ListarTiposDocumentosInventario(ING), "TypeDocID", "Descr")
    Call CargaDataCombo(Me.dtcDesIng, mobj_TiposDocInv.ListarTiposDocumentosInventario(ING), "TypeDocID", "Descr")
    Call CargaDataCombo(Me.dtcInvIniIng, mobj_TiposDocInv.ListarTiposDocumentosInventario(ING), "TypeDocID", "Descr")
    Call CargaDataCombo(Me.dtcTomaInvIng, mobj_TiposDocInv.ListarTiposDocumentosInventario(ING), "TypeDocID", "Descr")
    Call CargaDataCombo(Me.dtcDesSal, mobj_TiposDocInv.ListarTiposDocumentosInventario(SAL), "TypeDocID", "Descr")
    Call CargaDataCombo(Me.dtcNotCredSal, mobj_TiposDocInv.ListarTiposDocumentosInventario(SAL), "TypeDocID", "Descr")
    Call CargaDataCombo(Me.dtcTomaInvSal, mobj_TiposDocInv.ListarTiposDocumentosInventario(SAL), "TypeDocID", "Descr")
End Sub

Sub salir_formulario()
' validar que no haya procesos pendientes
' si no hay problemas
'MDIFconfiguracion.Toolbar1.Buttons(18).Caption = "Salir"    ' boton salir
Unload Me
End Sub

Sub asigna_campos() ' falta decidir si va ha ser public o private
    ' transferencias
    'Call Me.HabilitaControles(True)
    Me.dtcTransfIng.BoundText = ver_nulo(rs_ConfigInv!INTYPETRANSFERIN)
    'Me.dtcTransfIng.BoundText = Trim(ver_nulo("ING.TRANSFERENCIA")) '
    Me.dtcTransfSal.BoundText = ver_nulo(rs_ConfigInv!INTYPETRANSFEROUT)
    
    ' proveedor estacion
    Me.txtProveedorEst.Text = ver_nulo(rs_ConfigInv!IDVENDORSS)
    
    ' tipo documento
    Me.dtcTipoDoc.BoundText = ver_nulo(rs_ConfigInv!DOCTYPEIDFIS)
    
    ' ruta reporte
    Me.txtReporte.Text = ver_nulo(rs_ConfigInv!REPORTPATH)
    
    ' movimientos
    Me.dtcBonIng.BoundText = ver_nulo(rs_ConfigInv!INTYPEBONUS)
    Me.dtcCombIng.BoundText = ver_nulo(rs_ConfigInv!INTYPETRBUYFUELS)
    Me.dtcCompCStIng.BoundText = ver_nulo(rs_ConfigInv!INTYPETRBUYSTORE)
    Me.dtcDesIng.BoundText = ver_nulo(rs_ConfigInv!INTYPEDESIN)
    Me.dtcInvIniIng.BoundText = ver_nulo(rs_ConfigInv!INTYPEQTYINI)
    Me.dtcTomaInvIng.BoundText = ver_nulo(rs_ConfigInv!INTYPEFISIN)
    Me.dtcDesSal.BoundText = ver_nulo(rs_ConfigInv!INTYPEDESOUT)
    Me.dtcNotCredSal.BoundText = ver_nulo(rs_ConfigInv!INTYPECREDMEM)
    Me.dtcTomaInvSal.BoundText = ver_nulo(rs_ConfigInv!INTYPEFISOUT)
End Sub

Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
If pb_editar Then
    If MsgBox("Desea Cancelar los Cambios", vbYesNo, "Esta Modificando un registro") = vbNo Then
        Cancel = True
    Else
        Call gdesactiva_barra
    End If
Else
    Call gdesactiva_barra
End If
End Sub

Private Sub Form_Unload(Cancel As Integer)
Set mobj_cseguridad = Nothing
End Sub

Public Sub imprimir()
End Sub

Sub CargarDatosCfg()
    If rs_ConfigInv.State = 1 Then rs_ConfigInv.Close
    Set rs_ConfigInv = mobj_TiposDocInv.CargarInSetup
End Sub

Sub HabilitaControles(BlnValor As Boolean)
    Me.dtcTransfIng.Enabled = BlnValor
    Me.dtcTransfSal.Enabled = BlnValor
    
    Me.txtProveedorEst.Enabled = BlnValor
    
    Me.dtcTipoDoc.Enabled = BlnValor
    
    Me.txtReporte.Enabled = BlnValor
    
    Me.dtcBonIng.Enabled = BlnValor
    Me.dtcCombIng.Enabled = BlnValor
    Me.dtcCompCStIng.Enabled = BlnValor
    Me.dtcDesIng.Enabled = BlnValor
    Me.dtcDesSal.Enabled = BlnValor
    Me.dtcInvIniIng.Enabled = BlnValor
    Me.dtcNotCredSal.Enabled = BlnValor
    Me.dtcTomaInvIng.Enabled = BlnValor
    Me.dtcTomaInvSal.Enabled = BlnValor
End Sub

Sub CargaDataCombo(objDataCombo As DataCombo, rsSource As ADODB.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

Function ver_nulo(StrCadena As String) As String
On Error GoTo errhandler
    If IsNull(StrCadena) Then
        ver_nulo = Empty
    Else
        ver_nulo = StrCadena
    End If
errhandler:
End Function

