VERSION 5.00
Object = "{F0D2F211-CCB0-11D0-A316-00AA00688B10}#1.0#0"; "MSDATLST.OCX"
Object = "{69F9D01E-F1DE-11D4-9536-002018603DA2}#7.0#0"; "MiControl.ocx"
Object = "{BDC217C8-ED16-11CD-956C-0000C04E4C0A}#1.1#0"; "TABCTL32.OCX"
Begin VB.Form FConfigModVentas 
   BorderStyle     =   1  'Fixed Single
   Caption         =   "Configuración del Módulo de Ventas (95.040.00)"
   ClientHeight    =   5340
   ClientLeft      =   45
   ClientTop       =   330
   ClientWidth     =   10995
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MDIChild        =   -1  'True
   ScaleHeight     =   5340
   ScaleWidth      =   10995
   Begin TabDlg.SSTab SSTab1 
      Height          =   5325
      Left            =   45
      TabIndex        =   19
      Top             =   0
      Width           =   10950
      _ExtentX        =   19315
      _ExtentY        =   9393
      _Version        =   393216
      Tabs            =   2
      TabsPerRow      =   2
      TabHeight       =   520
      TabCaption(0)   =   "Códigos Configurados"
      TabPicture(0)   =   "9504000.frx":0000
      Tab(0).ControlEnabled=   -1  'True
      Tab(0).Control(0)=   "lblCatFuel"
      Tab(0).Control(0).Enabled=   0   'False
      Tab(0).Control(1)=   "lblCodCat"
      Tab(0).Control(1).Enabled=   0   'False
      Tab(0).Control(2)=   "lblMedida"
      Tab(0).Control(2).Enabled=   0   'False
      Tab(0).Control(3)=   "lblUnitmed"
      Tab(0).Control(3).Enabled=   0   'False
      Tab(0).Control(4)=   "Label1"
      Tab(0).Control(4).Enabled=   0   'False
      Tab(0).Control(5)=   "Label2"
      Tab(0).Control(5).Enabled=   0   'False
      Tab(0).Control(6)=   "Label3"
      Tab(0).Control(6).Enabled=   0   'False
      Tab(0).Control(7)=   "Label4"
      Tab(0).Control(7).Enabled=   0   'False
      Tab(0).Control(8)=   "lblCod1"
      Tab(0).Control(8).Enabled=   0   'False
      Tab(0).Control(9)=   "lblCod2"
      Tab(0).Control(9).Enabled=   0   'False
      Tab(0).Control(10)=   "lblCod3"
      Tab(0).Control(10).Enabled=   0   'False
      Tab(0).Control(11)=   "lblCod4"
      Tab(0).Control(11).Enabled=   0   'False
      Tab(0).Control(12)=   "Label6"
      Tab(0).Control(12).Enabled=   0   'False
      Tab(0).Control(13)=   "Label7"
      Tab(0).Control(13).Enabled=   0   'False
      Tab(0).Control(14)=   "Label8"
      Tab(0).Control(14).Enabled=   0   'False
      Tab(0).Control(15)=   "Label9"
      Tab(0).Control(15).Enabled=   0   'False
      Tab(0).Control(16)=   "lblDoc1"
      Tab(0).Control(16).Enabled=   0   'False
      Tab(0).Control(17)=   "lblDoc2"
      Tab(0).Control(17).Enabled=   0   'False
      Tab(0).Control(18)=   "lblDoc3"
      Tab(0).Control(18).Enabled=   0   'False
      Tab(0).Control(19)=   "lblDoc4"
      Tab(0).Control(19).Enabled=   0   'False
      Tab(0).Control(20)=   "lblDoc5"
      Tab(0).Control(20).Enabled=   0   'False
      Tab(0).Control(21)=   "Label10"
      Tab(0).Control(21).Enabled=   0   'False
      Tab(0).Control(22)=   "lblCod5"
      Tab(0).Control(22).Enabled=   0   'False
      Tab(0).Control(23)=   "Label5"
      Tab(0).Control(23).Enabled=   0   'False
      Tab(0).Control(24)=   "Shape1"
      Tab(0).Control(24).Enabled=   0   'False
      Tab(0).Control(25)=   "Label13"
      Tab(0).Control(25).Enabled=   0   'False
      Tab(0).Control(26)=   "Shape2"
      Tab(0).Control(26).Enabled=   0   'False
      Tab(0).Control(27)=   "Label14"
      Tab(0).Control(27).Enabled=   0   'False
      Tab(0).Control(28)=   "Image1"
      Tab(0).Control(28).Enabled=   0   'False
      Tab(0).Control(29)=   "Label15"
      Tab(0).Control(29).Enabled=   0   'False
      Tab(0).Control(30)=   "Label16"
      Tab(0).Control(30).Enabled=   0   'False
      Tab(0).Control(31)=   "DtcCategoriasLubes"
      Tab(0).Control(31).Enabled=   0   'False
      Tab(0).Control(32)=   "dtcCod5"
      Tab(0).Control(32).Enabled=   0   'False
      Tab(0).Control(33)=   "dtcDoc5"
      Tab(0).Control(33).Enabled=   0   'False
      Tab(0).Control(34)=   "dtcCategorias"
      Tab(0).Control(34).Enabled=   0   'False
      Tab(0).Control(35)=   "dtcMedida"
      Tab(0).Control(35).Enabled=   0   'False
      Tab(0).Control(36)=   "dtcCod1"
      Tab(0).Control(36).Enabled=   0   'False
      Tab(0).Control(37)=   "dtcCod2"
      Tab(0).Control(37).Enabled=   0   'False
      Tab(0).Control(38)=   "dtcCod3"
      Tab(0).Control(38).Enabled=   0   'False
      Tab(0).Control(39)=   "dtcCod4"
      Tab(0).Control(39).Enabled=   0   'False
      Tab(0).Control(40)=   "dtcDoc1"
      Tab(0).Control(40).Enabled=   0   'False
      Tab(0).Control(41)=   "dtcDoc2"
      Tab(0).Control(41).Enabled=   0   'False
      Tab(0).Control(42)=   "dtcDoc3"
      Tab(0).Control(42).Enabled=   0   'False
      Tab(0).Control(43)=   "dtcDoc4"
      Tab(0).Control(43).Enabled=   0   'False
      Tab(0).ControlCount=   44
      TabCaption(1)   =   "Opciones Especiales"
      TabPicture(1)   =   "9504000.frx":001C
      Tab(1).ControlEnabled=   0   'False
      Tab(1).Control(0)=   "Label11"
      Tab(1).Control(0).Enabled=   0   'False
      Tab(1).Control(1)=   "Label12"
      Tab(1).Control(1).Enabled=   0   'False
      Tab(1).Control(2)=   "Shape3"
      Tab(1).Control(2).Enabled=   0   'False
      Tab(1).Control(3)=   "chkEat"
      Tab(1).Control(3).Enabled=   0   'False
      Tab(1).Control(4)=   "chkIpt"
      Tab(1).Control(4).Enabled=   0   'False
      Tab(1).Control(5)=   "chkVcd"
      Tab(1).Control(5).Enabled=   0   'False
      Tab(1).Control(6)=   "ctnMonto"
      Tab(1).Control(6).Enabled=   0   'False
      Tab(1).Control(7)=   "txtRutaReportes"
      Tab(1).Control(7).Enabled=   0   'False
      Tab(1).Control(8)=   "fraConexion"
      Tab(1).Control(8).Enabled=   0   'False
      Tab(1).Control(9)=   "chkCadena"
      Tab(1).Control(9).Enabled=   0   'False
      Tab(1).ControlCount=   10
      Begin VB.CheckBox chkCadena 
         Caption         =   "Usa cadena de conexión"
         Height          =   285
         Left            =   -74370
         TabIndex        =   17
         Top             =   3780
         Width           =   2130
      End
      Begin VB.Frame fraConexion 
         Height          =   870
         Left            =   -74505
         TabIndex        =   42
         Top             =   3825
         Width           =   6315
         Begin VB.TextBox txtCadena 
            Height          =   330
            Left            =   1170
            TabIndex        =   18
            Top             =   360
            Width           =   4965
         End
         Begin VB.Label lblCadena 
            Caption         =   "Cadena"
            Height          =   285
            Left            =   495
            TabIndex        =   43
            Top             =   405
            Width           =   690
         End
      End
      Begin VB.TextBox txtRutaReportes 
         Height          =   330
         Left            =   -72255
         TabIndex        =   16
         Top             =   3015
         Width           =   4200
      End
      Begin MiControl.CtrlNumber ctnMonto 
         Height          =   375
         Left            =   -72255
         TabIndex        =   15
         Top             =   2475
         Width           =   1680
         _ExtentX        =   2963
         _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.CheckBox chkVcd 
         Caption         =   "Validar Correlativo de Documento"
         Height          =   240
         Left            =   -74460
         TabIndex        =   14
         Top             =   1800
         Width           =   2940
      End
      Begin VB.CheckBox chkIpt 
         Caption         =   "Ingreso de Placas por Transición"
         Height          =   465
         Left            =   -74460
         TabIndex        =   13
         Top             =   1305
         Width           =   2715
      End
      Begin VB.CheckBox chkEat 
         Caption         =   "Emisión Automática de Tickets"
         Height          =   330
         Left            =   -74460
         TabIndex        =   12
         Top             =   990
         Width           =   3030
      End
      Begin MSDataListLib.DataCombo dtcDoc4 
         Height          =   315
         Left            =   7875
         TabIndex        =   10
         Top             =   3960
         Width           =   2670
         _ExtentX        =   4710
         _ExtentY        =   556
         _Version        =   393216
         Style           =   2
         Text            =   ""
      End
      Begin MSDataListLib.DataCombo dtcDoc3 
         Height          =   315
         Left            =   7875
         TabIndex        =   9
         Top             =   3420
         Width           =   2670
         _ExtentX        =   4710
         _ExtentY        =   556
         _Version        =   393216
         Style           =   2
         Text            =   ""
      End
      Begin MSDataListLib.DataCombo dtcDoc2 
         Height          =   315
         Left            =   7875
         TabIndex        =   8
         Top             =   2880
         Width           =   2670
         _ExtentX        =   4710
         _ExtentY        =   556
         _Version        =   393216
         Style           =   2
         Text            =   ""
      End
      Begin MSDataListLib.DataCombo dtcDoc1 
         Height          =   315
         Left            =   7875
         TabIndex        =   7
         Top             =   2385
         Width           =   2670
         _ExtentX        =   4710
         _ExtentY        =   556
         _Version        =   393216
         Style           =   2
         Text            =   ""
      End
      Begin MSDataListLib.DataCombo dtcCod4 
         Height          =   315
         Left            =   2295
         TabIndex        =   5
         Top             =   3900
         Width           =   2670
         _ExtentX        =   4710
         _ExtentY        =   556
         _Version        =   393216
         Style           =   2
         Text            =   ""
      End
      Begin MSDataListLib.DataCombo dtcCod3 
         Height          =   315
         Left            =   2295
         TabIndex        =   4
         Top             =   3390
         Width           =   2670
         _ExtentX        =   4710
         _ExtentY        =   556
         _Version        =   393216
         Style           =   2
         Text            =   ""
      End
      Begin MSDataListLib.DataCombo dtcCod2 
         Height          =   315
         Left            =   2295
         TabIndex        =   3
         Top             =   2895
         Width           =   2670
         _ExtentX        =   4710
         _ExtentY        =   556
         _Version        =   393216
         Style           =   2
         Text            =   ""
      End
      Begin MSDataListLib.DataCombo dtcCod1 
         Height          =   315
         Left            =   2295
         TabIndex        =   2
         Top             =   2385
         Width           =   2670
         _ExtentX        =   4710
         _ExtentY        =   556
         _Version        =   393216
         Style           =   2
         Text            =   ""
      End
      Begin MSDataListLib.DataCombo dtcMedida 
         Height          =   315
         Left            =   2250
         TabIndex        =   1
         Top             =   1440
         Width           =   2670
         _ExtentX        =   4710
         _ExtentY        =   556
         _Version        =   393216
         Style           =   2
         Text            =   ""
      End
      Begin MSDataListLib.DataCombo dtcCategorias 
         Height          =   315
         Left            =   2250
         TabIndex        =   0
         Top             =   945
         Width           =   2670
         _ExtentX        =   4710
         _ExtentY        =   556
         _Version        =   393216
         Style           =   2
         Text            =   ""
      End
      Begin MSDataListLib.DataCombo dtcDoc5 
         Height          =   315
         Left            =   7875
         TabIndex        =   11
         Top             =   4455
         Width           =   2670
         _ExtentX        =   4710
         _ExtentY        =   556
         _Version        =   393216
         Style           =   2
         Text            =   ""
      End
      Begin MSDataListLib.DataCombo dtcCod5 
         Height          =   315
         Left            =   2295
         TabIndex        =   6
         Top             =   4410
         Width           =   2670
         _ExtentX        =   4710
         _ExtentY        =   556
         _Version        =   393216
         Style           =   2
         Text            =   ""
      End
      Begin MSDataListLib.DataCombo DtcCategoriasLubes 
         Height          =   315
         Left            =   7200
         TabIndex        =   52
         Top             =   945
         Width           =   2670
         _ExtentX        =   4710
         _ExtentY        =   556
         _Version        =   393216
         Style           =   2
         Text            =   ""
      End
      Begin VB.Label Label16 
         BorderStyle     =   1  'Fixed Single
         BeginProperty Font 
            Name            =   "MS Sans Serif"
            Size            =   8.25
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   285
         Left            =   6360
         TabIndex        =   51
         Top             =   945
         Width           =   735
      End
      Begin VB.Label Label15 
         Caption         =   "Categoria de Lubricantes"
         Height          =   420
         Left            =   5280
         TabIndex        =   50
         Top             =   840
         Width           =   960
      End
      Begin VB.Image Image1 
         Height          =   480
         Left            =   270
         Picture         =   "9504000.frx":0038
         Top             =   270
         Width           =   480
      End
      Begin VB.Shape Shape3 
         Height          =   1275
         Left            =   -74730
         Top             =   900
         Width           =   4785
      End
      Begin VB.Label Label14 
         AutoSize        =   -1  'True
         Caption         =   "Códigos de Documentos"
         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            =   6930
         TabIndex        =   49
         Top             =   1935
         Width           =   2565
      End
      Begin VB.Shape Shape2 
         Height          =   3030
         Left            =   5580
         Top             =   2025
         Width           =   5235
      End
      Begin VB.Label Label13 
         AutoSize        =   -1  'True
         Caption         =   "Códigos para Clientes"
         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            =   1575
         TabIndex        =   48
         Top             =   1935
         Width           =   2325
      End
      Begin VB.Shape Shape1 
         Height          =   3030
         Left            =   225
         Top             =   2025
         Width           =   5055
      End
      Begin VB.Label Label5 
         AutoSize        =   -1  'True
         Caption         =   "Crédito Otros"
         Height          =   195
         Left            =   315
         TabIndex        =   47
         Top             =   4410
         Width           =   915
      End
      Begin VB.Label lblCod5 
         BorderStyle     =   1  'Fixed Single
         BeginProperty Font 
            Name            =   "MS Sans Serif"
            Size            =   8.25
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   285
         Left            =   1440
         TabIndex        =   46
         Top             =   4410
         Width           =   735
      End
      Begin VB.Label Label10 
         Caption         =   "Nota de Débito"
         Height          =   240
         Left            =   5760
         TabIndex        =   45
         Top             =   4455
         Width           =   1230
      End
      Begin VB.Label lblDoc5 
         BorderStyle     =   1  'Fixed Single
         BeginProperty Font 
            Name            =   "MS Sans Serif"
            Size            =   8.25
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   285
         Left            =   7065
         TabIndex        =   44
         Top             =   4455
         Width           =   735
      End
      Begin VB.Label Label12 
         Caption         =   "Ruta para Reportes"
         Height          =   240
         Left            =   -74235
         TabIndex        =   41
         Top             =   3060
         Width           =   1770
      End
      Begin VB.Label Label11 
         Caption         =   "Monto Máximo en Tickets - Venta Manual"
         Height          =   510
         Left            =   -74235
         TabIndex        =   40
         Top             =   2475
         Width           =   1770
      End
      Begin VB.Label lblDoc4 
         BorderStyle     =   1  'Fixed Single
         BeginProperty Font 
            Name            =   "MS Sans Serif"
            Size            =   8.25
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   285
         Left            =   7065
         TabIndex        =   39
         Top             =   3960
         Width           =   735
      End
      Begin VB.Label lblDoc3 
         BorderStyle     =   1  'Fixed Single
         BeginProperty Font 
            Name            =   "MS Sans Serif"
            Size            =   8.25
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   285
         Left            =   7065
         TabIndex        =   38
         Top             =   3420
         Width           =   735
      End
      Begin VB.Label lblDoc2 
         BorderStyle     =   1  'Fixed Single
         BeginProperty Font 
            Name            =   "MS Sans Serif"
            Size            =   8.25
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   285
         Left            =   7065
         TabIndex        =   37
         Top             =   2880
         Width           =   735
      End
      Begin VB.Label lblDoc1 
         BorderStyle     =   1  'Fixed Single
         BeginProperty Font 
            Name            =   "MS Sans Serif"
            Size            =   8.25
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   285
         Left            =   7065
         TabIndex        =   36
         Top             =   2385
         Width           =   735
      End
      Begin VB.Label Label9 
         Caption         =   "Nota de Crédito"
         Height          =   375
         Left            =   5760
         TabIndex        =   35
         Top             =   3960
         Width           =   1230
      End
      Begin VB.Label Label8 
         Caption         =   "Factura"
         Height          =   285
         Left            =   5760
         TabIndex        =   34
         Top             =   3465
         Width           =   780
      End
      Begin VB.Label Label7 
         Caption         =   "Boleta"
         Height          =   285
         Left            =   5760
         TabIndex        =   33
         Top             =   2925
         Width           =   735
      End
      Begin VB.Label Label6 
         Caption         =   "Ticket"
         Height          =   285
         Left            =   5760
         TabIndex        =   32
         Top             =   2430
         Width           =   870
      End
      Begin VB.Label lblCod4 
         BorderStyle     =   1  'Fixed Single
         BeginProperty Font 
            Name            =   "MS Sans Serif"
            Size            =   8.25
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   285
         Left            =   1440
         TabIndex        =   31
         Top             =   3915
         Width           =   735
      End
      Begin VB.Label lblCod3 
         BorderStyle     =   1  'Fixed Single
         BeginProperty Font 
            Name            =   "MS Sans Serif"
            Size            =   8.25
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   285
         Left            =   1440
         TabIndex        =   30
         Top             =   3420
         Width           =   735
      End
      Begin VB.Label lblCod2 
         BorderStyle     =   1  'Fixed Single
         BeginProperty Font 
            Name            =   "MS Sans Serif"
            Size            =   8.25
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   285
         Left            =   1440
         TabIndex        =   29
         Top             =   2925
         Width           =   735
      End
      Begin VB.Label lblCod1 
         BorderStyle     =   1  'Fixed Single
         BeginProperty Font 
            Name            =   "MS Sans Serif"
            Size            =   8.25
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   285
         Left            =   1440
         TabIndex        =   28
         Top             =   2430
         Width           =   735
      End
      Begin VB.Label Label4 
         Caption         =   "Crédito Corporativo"
         Height          =   465
         Left            =   315
         TabIndex        =   27
         Top             =   3870
         Width           =   1035
      End
      Begin VB.Label Label3 
         AutoSize        =   -1  'True
         Caption         =   "Crédito Local"
         Height          =   195
         Left            =   315
         TabIndex        =   26
         Top             =   3465
         Width           =   930
      End
      Begin VB.Label Label2 
         AutoSize        =   -1  'True
         Caption         =   "Adelanto"
         Height          =   195
         Left            =   315
         TabIndex        =   25
         Top             =   2970
         Width           =   630
      End
      Begin VB.Label Label1 
         AutoSize        =   -1  'True
         Caption         =   "Contado"
         Height          =   195
         Left            =   315
         TabIndex        =   24
         Top             =   2475
         Width           =   600
      End
      Begin VB.Label lblUnitmed 
         BorderStyle     =   1  'Fixed Single
         BeginProperty Font 
            Name            =   "MS Sans Serif"
            Size            =   8.25
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   285
         Left            =   1440
         TabIndex        =   23
         Top             =   1440
         Width           =   735
      End
      Begin VB.Label lblMedida 
         Caption         =   "Unidad de medida"
         Height          =   420
         Left            =   315
         TabIndex        =   22
         Top             =   1395
         Width           =   960
      End
      Begin VB.Label lblCodCat 
         BorderStyle     =   1  'Fixed Single
         BeginProperty Font 
            Name            =   "MS Sans Serif"
            Size            =   8.25
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   285
         Left            =   1440
         TabIndex        =   21
         Top             =   945
         Width           =   735
      End
      Begin VB.Label lblCatFuel 
         Caption         =   "Categoria de Combustible"
         Height          =   420
         Left            =   315
         TabIndex        =   20
         Top             =   900
         Width           =   960
      End
   End
End
Attribute VB_Name = "FConfigModVentas"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
' CONFIGURACION DEL MODULO DE VENTAS
' EDGAR MARTIN CANCHO RUIZ

Option Explicit
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 GrecibeUbicacion As BookmarkEnum
Public GrecibeColumnaID As String
Public GrecibeColumnaOpcional As String

Public rs_config As ADODB.Recordset
Public objConfig As DB_UT_MANTENIMIENTOS.C_CONFIG_VTA
Public objCategoria As DB_INV_MANTENIMIENTOS.C_CATEGORIA
Public objTCliente As DB_OP_MANTENIMIENTOS.C_TIPO_CLIENTE
Public objDocumento As DB_MA_MANTENIMIENTOS.C_DOCUMENTO
Public objMedida As DB_INV_MANTENIMIENTOS.C_UNIDADMEDIDA



Private Sub chkCadena_Click()
If chkCadena.Value Then
fraConexion.Enabled = True
Else
fraConexion.Enabled = False
End If
End Sub


Private Sub dtcCategorias_Change()
    lblCodCat.Caption = dtcCategorias.BoundText
End Sub

Private Sub dtcCod1_Change()
    lblCod1.Caption = dtcCod1.BoundText
End Sub

Private Sub dtcCod2_Change()
lblCod2.Caption = dtcCod2.BoundText
End Sub

Private Sub dtcCod3_Change()
lblCod3.Caption = dtcCod3.BoundText
End Sub

Private Sub dtcCod4_Change()
lblCod4.Caption = dtcCod4.BoundText
End Sub

Private Sub dtcCod5_Change()
lblCod5.Caption = dtcCod5.BoundText
End Sub

Private Sub dtcDoc1_Change()
lblDoc1.Caption = dtcDoc1.BoundText
End Sub

Private Sub dtcDoc2_Change()
lblDoc2.Caption = dtcDoc2.BoundText
End Sub

Private Sub dtcDoc3_Change()
lblDoc3.Caption = dtcDoc3.BoundText
End Sub

Private Sub dtcDoc4_Change()
lblDoc4.Caption = dtcDoc4.BoundText
End Sub

Private Sub dtcDoc5_Change()
lblDoc5.Caption = dtcDoc5.BoundText
End Sub

Private Sub dtcMedida_Change()
lblUnitmed.Caption = dtcMedida.BoundText
End Sub

Private Sub Form_Activate()

    Call gactualizaopcion(pbderecho_agregar, pbderecho_editar, pbderecho_borrar, pbderecho_imprimir)
    Call gactualiza_barra(Me)
    'lineas nuevas
    If pbderecho_consultar = False Then
        Unload Me
    End If

End Sub

Public Sub primer_registro()
    Call Gprimer_registro(Me, rs_config)
    Call asigna_campos
End Sub

Public Sub ultimo_registro()
    Call Gultimo_registro(Me, rs_config)
    Call asigna_campos
End Sub

Public Sub registro_anterior()
    Call Gregistro_anterior(Me, rs_config)
    Call asigna_campos
End Sub
Public Sub registro_siguiente()
    Call Gregistro_siguiente(Me, rs_config)
    Call asigna_campos
End Sub
Private Sub Form_Initialize()
    Call gHabilitarReg(Me, False)
End Sub

Private Sub Form_Load()
    'seguridad
    Call gseguridad(Me)
    
    If pbderecho_consultar Then
        
        InstanciaObjetos
        Call obtener_datos
        LlenaDataCombos
        Call asigna_campos
        pb_primerregistro = True
    'lineas nuevas
    Else
        'Unload Me
        MsgBox ("No tiene Derechos de Consultar en este formulario"), vbCritical + vbDefaultButton1, "Mensaje"
    End If
     Me.Top = 100
     Me.Left = (Screen.Width - Me.Width) / 2
     
     ctnMonto.Enteros = 7
     ctnMonto.Decimales = GintDecResultado
     
     SSTab1.Tab = 0
     
End Sub
Public Sub borrar_registro()

On Error GoTo errhandler

    Call gborrar_Registro(Me, rs_config, dtcCategorias)
    
Exit Sub

errhandler:
    MsgBox MensajedeError(Err.Number, Err.Description), vbDefaultButton1 + vbCritical, "Error"

End Sub
Function valida_datos()
    If GVDATO(dtcCategorias.BoundText) = Empty Then
        valida_datos = False
        MsgBox "Seleccione categria", vbInformation, "Error"
        SSTab1.Tab = 0
        dtcCategorias.SetFocus
        Exit Function
    End If

    If GVDATO(dtcMedida.BoundText) = Empty Then
        valida_datos = False
        MsgBox "Seleccione Unidad de medida", vbInformation, "Error"
        SSTab1.Tab = 0
        dtcMedida.SetFocus
        Exit Function
    End If

    If GVDATO(txtRutaReportes.Text) = Empty Then
        valida_datos = False
        MsgBox "Ingrese ruta de reportes", vbInformation, "Error"
        SSTab1.Tab = 1
        txtRutaReportes.SetFocus
        Exit Function
    End If

    If chkCadena.Value And GVDATO(txtCadena.Text) = Empty Then
        valida_datos = False
        MsgBox "Ingrese Cadena de Conexión", vbInformation, "Error"
        SSTab1.Tab = 1
        txtCadena.SetFocus
        Exit Function
    End If


    valida_datos = True
End Function
Public Sub grabar_registro()

On Error GoTo errhandler
    If valida_datos() = True Then
        ' llamada al proc de grabacion
        If pb_agregar Then

        Else
            objConfig.ActualizarRegistro chkEat.Value, dtcCategorias.BoundText, chkIpt.Value, _
                                        GFormatodeNumero(CDbl(ctnMonto.Text), GintDecResultado), dtcCod1.BoundText, _
                                        dtcCod2.BoundText, dtcCod3.BoundText, dtcCod4.BoundText, dtcCod5.BoundText, dtcDoc1.BoundText, _
                                        dtcDoc2.BoundText, dtcDoc3.BoundText, dtcDoc4.BoundText, dtcDoc5.BoundText, chkVcd.Value, _
                                        Trim(txtRutaReportes.Text), CInt(chkCadena.Value), Trim(txtCadena.Text), dtcMedida.BoundText
        End If
        
        Call ggrabar_registro(Me)
        actualizar_registro
    End If
Exit Sub
errhandler:
    MsgBox MensajedeError(Err.Number, Err.Description), vbDefaultButton1 + vbCritical, "Error"
     
End Sub
Public Sub actualizar_registro()
    'llamar al procedimiento de carga
    Call obtener_datos
    Call asigna_campos
    'MsgBox ("Registros Actualizados")
End Sub
Public Sub agregar_registro()
    Call gagregar_registro(Me, dtcCategorias)
End Sub
Public Sub modificar_registro()
    Call gmodificar_registro(Me, dtcCategorias)
    dtcCategorias.Enabled = True
End Sub
Public Sub descartar_registro()
    ' Revertir cambios
    'adodc1.Recordset.CancelUpdate
    Call gdescartar_registro(Me)
    Call asigna_campos
End Sub

Sub obtener_datos()
    Set rs_config = objConfig.ObtenerConfiguracion
End Sub

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

Sub asigna_campos() ' falta decidir si va ha ser public o private
    If rs_config.RecordCount <> 0 Then
        
        dtcCategorias.BoundText = rs_config!CATEGORYFUEL
        lblCodCat.Caption = rs_config!CATEGORYFUEL
        dtcMedida.BoundText = rs_config!UNITMEDFUEL
        lblUnitmed.Caption = rs_config!UNITMEDFUEL
        
        dtcCod1.BoundText = rs_config!CCLASSIDCASH
        lblCod1.Caption = rs_config!CCLASSIDCASH
        
        dtcCod2.BoundText = rs_config!CCLASSIDANTICIPATE
        lblCod2.Caption = rs_config!CCLASSIDANTICIPATE
        
        dtcCod3.BoundText = rs_config!CCLASSIDCREDLOCAL
        lblCod3.Caption = rs_config!CCLASSIDCREDLOCAL
        
        dtcCod4.BoundText = rs_config!CCLASSIDCREDCORPORATE
        lblCod4.Caption = rs_config!CCLASSIDCREDCORPORATE
        
        dtcCod5.BoundText = rs_config!CCLASSIDOTHER
        lblCod5.Caption = rs_config!CCLASSIDOTHER
        
        dtcDoc1.BoundText = rs_config!DOCTYPEIDTICKET
        lblDoc1.Caption = rs_config!DOCTYPEIDTICKET
        
        dtcDoc2.BoundText = rs_config!DOCTYPEIDFAC
        lblDoc2.Caption = rs_config!DOCTYPEIDFAC
        
        dtcDoc3.BoundText = rs_config!DOCTYPEIDBOL
        lblDoc3.Caption = rs_config!DOCTYPEIDBOL
        
        dtcDoc4.BoundText = rs_config!DOCTYPEIDNC
        lblDoc4.Caption = rs_config!DOCTYPEIDNC
        
        dtcDoc5.BoundText = rs_config!DOCTYPEIDND
        lblDoc5.Caption = rs_config!DOCTYPEIDND
        
        chkEat.Value = IIf(rs_config!AUTOMATICSALES, 1, 0)
        chkIpt.Value = IIf(rs_config!BADGE, 1, 0)
        chkVcd.Value = IIf(rs_config!STKCORRELATIVE, 1, 0)
        
        ctnMonto.Text = GFormatodeNumero(rs_config!MTOMAXSALES, GintDecResultado)
        txtRutaReportes.Text = GVDATO(rs_config!REPORTPATH)
        
        chkCadena.Value = IIf(rs_config!STKODBCSTRING, 1, 0)
        txtCadena.Text = GVDATO(rs_config!STRINGCONECC)
        
        
    End If
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)
   DestruyeObjetos
End Sub

Sub imprimir()
'    crBancos.ReportFileName = GstrReportesInv + "rpt_bancos.rpt"
'    crBancos.WindowTitle = "Reporte de Bancos"
'    crBancos.Formulas(1) = "formusuario=stringvar strusuario; strusuario:='" & GCUSERID & "'"
'    crBancos.Formulas(2) = "formscreen=stringvar strscreen; strscreen:='01.117.00'"
'    crBancos.WindowState = crptMaximized
'    crBancos.WindowShowPrintSetupBtn = True
'    crBancos.Action = 1
    
End Sub

Public 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

' Procedimiento de carga de los DataCombos del formulario
Private Sub LlenaDataCombos()
    Call CargaDataCombo(dtcCategorias, objCategoria.ListarCategoriasayuda, "CLASSID", "DESCR")
    Call CargaDataCombo(dtcMedida, objMedida.ListarUnitMed, "STKUNITID", "DESCR")
    Call CargaDataCombo(dtcCod1, objTCliente.ListarTipos_ClientesAyuda, "CUSTCLASSID", "DESCR")
    Call CargaDataCombo(dtcCod2, objTCliente.ListarTipos_ClientesAyuda, "CUSTCLASSID", "DESCR")
    Call CargaDataCombo(dtcCod3, objTCliente.ListarTipos_ClientesAyuda, "CUSTCLASSID", "DESCR")
    Call CargaDataCombo(dtcCod4, objTCliente.ListarTipos_ClientesAyuda, "CUSTCLASSID", "DESCR")
    Call CargaDataCombo(dtcCod5, objTCliente.ListarTipos_ClientesAyuda, "CUSTCLASSID", "DESCR")
    Call CargaDataCombo(dtcDoc1, objDocumento.ListarDocumentos, "DOCTYPEID", "DESCR")
    Call CargaDataCombo(dtcDoc2, objDocumento.ListarDocumentos, "DOCTYPEID", "DESCR")
    Call CargaDataCombo(dtcDoc3, objDocumento.ListarDocumentos, "DOCTYPEID", "DESCR")
    Call CargaDataCombo(dtcDoc4, objDocumento.ListarDocumentos, "DOCTYPEID", "DESCR")
    Call CargaDataCombo(dtcDoc5, objDocumento.ListarDocumentos, "DOCTYPEID", "DESCR")
End Sub


Private Sub InstanciaObjetos()
    Set objConfig = New DB_UT_MANTENIMIENTOS.C_CONFIG_VTA
    Set objCategoria = New DB_INV_MANTENIMIENTOS.C_CATEGORIA
    Set objMedida = New DB_INV_MANTENIMIENTOS.C_UNIDADMEDIDA
    Set objTCliente = New DB_OP_MANTENIMIENTOS.C_TIPO_CLIENTE
    Set objDocumento = New DB_MA_MANTENIMIENTOS.C_DOCUMENTO
End Sub

Private Sub DestruyeObjetos()
    Set objConfig = Nothing
    Set rs_config = Nothing
    Set objCategoria = Nothing
    Set objMedida = Nothing
    Set objTCliente = Nothing
    Set objDocumento = Nothing
End Sub

