VERSION 5.00
Object = "{CDE57A40-8B86-11D0-B3C6-00A0C90AEA82}#1.0#0"; "MSDATGRD.OCX"
Object = "{86CF1D34-0C5F-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCT2.OCX"
Object = "{BDC217C8-ED16-11CD-956C-0000C04E4C0A}#1.1#0"; "TABCTL32.OCX"
Object = "{F0D2F211-CCB0-11D0-A316-00AA00688B10}#1.0#0"; "MSDATLST.OCX"
Object = "{00025600-0000-0000-C000-000000000046}#5.2#0"; "crystl32.ocx"
Object = "{69F9D01E-F1DE-11D4-9536-002018603DA2}#7.0#0"; "ControlNumber.ocx"
Begin VB.Form FMaestroClientes 
   BorderStyle     =   1  'Fixed Single
   Caption         =   "Maestro de Clientes (01.110.00)"
   ClientHeight    =   6360
   ClientLeft      =   45
   ClientTop       =   330
   ClientWidth     =   10215
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MDIChild        =   -1  'True
   ScaleHeight     =   6360
   ScaleWidth      =   10215
   Begin TabDlg.SSTab SSTab1 
      Height          =   6375
      Left            =   0
      TabIndex        =   53
      Top             =   0
      Width           =   10215
      _ExtentX        =   18018
      _ExtentY        =   11245
      _Version        =   393216
      Tabs            =   7
      Tab             =   6
      TabsPerRow      =   7
      TabHeight       =   520
      TabCaption(0)   =   "Generales"
      TabPicture(0)   =   "0111000.frx":0000
      Tab(0).ControlEnabled=   0   'False
      Tab(0).Control(0)=   "crCliente"
      Tab(0).Control(1)=   "txtCodigo"
      Tab(0).Control(2)=   "cmdBusVendedor"
      Tab(0).Control(3)=   "dtcVendedor"
      Tab(0).Control(4)=   "txtCodSolomon"
      Tab(0).Control(5)=   "cmdBusDist"
      Tab(0).Control(6)=   "cmdBusDepa"
      Tab(0).Control(7)=   "cmdBusPais"
      Tab(0).Control(8)=   "cmdBusImp2"
      Tab(0).Control(9)=   "cmdBusImp1"
      Tab(0).Control(10)=   "dtcImpuesto2"
      Tab(0).Control(11)=   "dtcImpuesto1"
      Tab(0).Control(12)=   "dtpFechaInsc"
      Tab(0).Control(13)=   "dtpFechaNac"
      Tab(0).Control(14)=   "dtcDistrito"
      Tab(0).Control(15)=   "dtcDepartamento"
      Tab(0).Control(16)=   "dtcPais"
      Tab(0).Control(17)=   "txtRuc"
      Tab(0).Control(18)=   "cmdBuscar"
      Tab(0).Control(19)=   "txtDescripcion"
      Tab(0).Control(20)=   "txtDireccion1"
      Tab(0).Control(21)=   "txtDireccion2"
      Tab(0).Control(22)=   "txtFax"
      Tab(0).Control(23)=   "txtTelefono"
      Tab(0).Control(24)=   "cmdBusMoneda"
      Tab(0).Control(25)=   "cmdBusEstado"
      Tab(0).Control(26)=   "cmdBusZona"
      Tab(0).Control(27)=   "dtcEstado"
      Tab(0).Control(28)=   "dtcZona"
      Tab(0).Control(29)=   "dtcMoneda"
      Tab(0).Control(30)=   "Image1"
      Tab(0).Control(31)=   "lblVendecor"
      Tab(0).Control(32)=   "lblSolomon"
      Tab(0).Control(33)=   "lblImpuesto2"
      Tab(0).Control(34)=   "lblImpuesto1"
      Tab(0).Control(35)=   "lblFechaInsc"
      Tab(0).Control(36)=   "lblFechaNac"
      Tab(0).Control(37)=   "lblDistrito"
      Tab(0).Control(38)=   "lblPais"
      Tab(0).Control(39)=   "lblDepartamento"
      Tab(0).Control(40)=   "lblRuc"
      Tab(0).Control(41)=   "lblCodigo"
      Tab(0).Control(42)=   "lblNombre"
      Tab(0).Control(43)=   "lblDireccion1"
      Tab(0).Control(44)=   "lblDireccion2"
      Tab(0).Control(45)=   "lblFax"
      Tab(0).Control(46)=   "lblTelefono"
      Tab(0).Control(47)=   "lblZona"
      Tab(0).Control(48)=   "lblMoneda"
      Tab(0).Control(49)=   "lblEstado"
      Tab(0).ControlCount=   50
      TabCaption(1)   =   "Mas Datos"
      TabPicture(1)   =   "0111000.frx":001C
      Tab(1).ControlEnabled=   0   'False
      Tab(1).Control(0)=   "lblTipoCliente"
      Tab(1).Control(1)=   "lblTTCambio"
      Tab(1).Control(2)=   "lblCondPagoTicket"
      Tab(1).Control(3)=   "lblCondPagoDoc"
      Tab(1).Control(4)=   "Label1"
      Tab(1).Control(5)=   "lblCodigo2"
      Tab(1).Control(6)=   "Label"
      Tab(1).Control(7)=   "lblNombre2"
      Tab(1).Control(8)=   "lblDiaPago"
      Tab(1).Control(9)=   "lblDiaGracia"
      Tab(1).Control(10)=   "Line3"
      Tab(1).Control(11)=   "Line4"
      Tab(1).Control(12)=   "Label2"
      Tab(1).Control(13)=   "lblSaldo"
      Tab(1).Control(14)=   "lblTotalDeuda"
      Tab(1).Control(15)=   "Image2"
      Tab(1).Control(16)=   "Label7"
      Tab(1).Control(17)=   "lblTotalSaldo"
      Tab(1).Control(18)=   "Label11"
      Tab(1).Control(19)=   "Label13"
      Tab(1).Control(20)=   "CtnDescuento"
      Tab(1).Control(21)=   "ctnMontoTotal"
      Tab(1).Control(22)=   "dtcTipoCliente"
      Tab(1).Control(23)=   "dtcTTCambio"
      Tab(1).Control(24)=   "dtcCondPago1"
      Tab(1).Control(25)=   "dtcCondPago2"
      Tab(1).Control(26)=   "cmdBusTipoCliente"
      Tab(1).Control(27)=   "cmdBusCondPago1"
      Tab(1).Control(28)=   "cmdBusCondPago2"
      Tab(1).Control(29)=   "cmdBusTTCambio"
      Tab(1).Control(30)=   "dtcDiaPago"
      Tab(1).Control(31)=   "cmdBusDiaPago"
      Tab(1).Control(32)=   "txtDiaGracia"
      Tab(1).Control(33)=   "chkAfecto"
      Tab(1).Control(34)=   "Chkcontroldispo"
      Tab(1).ControlCount=   35
      TabCaption(2)   =   "Placas"
      TabPicture(2)   =   "0111000.frx":0038
      Tab(2).ControlEnabled=   0   'False
      Tab(2).Control(0)=   "cmdAgregarPlaca"
      Tab(2).Control(1)=   "dbDetallePlacas"
      Tab(2).Control(2)=   "Image3"
      Tab(2).Control(3)=   "lblNombre3"
      Tab(2).Control(4)=   "Label6"
      Tab(2).Control(5)=   "lblCodigo3"
      Tab(2).Control(6)=   "Label4"
      Tab(2).Control(7)=   "Line2"
      Tab(2).Control(8)=   "Line1"
      Tab(2).ControlCount=   9
      TabCaption(3)   =   "Tarjetas"
      TabPicture(3)   =   "0111000.frx":0054
      Tab(3).ControlEnabled=   0   'False
      Tab(3).Control(0)=   "Label8"
      Tab(3).Control(1)=   "lblCodigo4"
      Tab(3).Control(2)=   "Label10"
      Tab(3).Control(3)=   "lblNombre4"
      Tab(3).Control(4)=   "Line5"
      Tab(3).Control(5)=   "Line6"
      Tab(3).Control(6)=   "Image4"
      Tab(3).Control(7)=   "dbDetalleTarjetas"
      Tab(3).Control(8)=   "cmdAgregaTarjeta"
      Tab(3).Control(9)=   "cmdModificarTarjeta"
      Tab(3).ControlCount=   10
      TabCaption(4)   =   "Garantias"
      TabPicture(4)   =   "0111000.frx":0070
      Tab(4).ControlEnabled=   0   'False
      Tab(4).Control(0)=   "cmdModificarGarantia"
      Tab(4).Control(1)=   "cmdAgregarGarantia"
      Tab(4).Control(2)=   "dbDetalleGarantias"
      Tab(4).Control(3)=   "Image5"
      Tab(4).Control(4)=   "Line8"
      Tab(4).Control(5)=   "Line7"
      Tab(4).Control(6)=   "lblNombre5"
      Tab(4).Control(7)=   "Label14"
      Tab(4).Control(8)=   "lblCodigo5"
      Tab(4).Control(9)=   "Label12"
      Tab(4).ControlCount=   10
      TabCaption(5)   =   "Créditos"
      TabPicture(5)   =   "0111000.frx":008C
      Tab(5).ControlEnabled=   0   'False
      Tab(5).Control(0)=   "cmdAgregarCredito"
      Tab(5).Control(1)=   "cmdModificarCredito"
      Tab(5).Control(2)=   "dbDetalleCreditos"
      Tab(5).Control(3)=   "Label3"
      Tab(5).Control(4)=   "lblTotalMonto"
      Tab(5).Control(5)=   "lblPorcentaje"
      Tab(5).Control(6)=   "lblMensajePorc"
      Tab(5).Control(7)=   "Image6"
      Tab(5).Control(8)=   "Line10"
      Tab(5).Control(9)=   "Line9"
      Tab(5).Control(10)=   "Label9"
      Tab(5).Control(11)=   "lblCodigo6"
      Tab(5).Control(12)=   "Label5"
      Tab(5).Control(13)=   "lblNombre6"
      Tab(5).ControlCount=   14
      TabCaption(6)   =   "Producto"
      TabPicture(6)   =   "0111000.frx":00A8
      Tab(6).ControlEnabled=   -1  'True
      Tab(6).Control(0)=   "Line11"
      Tab(6).Control(0).Enabled=   0   'False
      Tab(6).Control(1)=   "Line12"
      Tab(6).Control(1).Enabled=   0   'False
      Tab(6).Control(2)=   "lblNombre7"
      Tab(6).Control(2).Enabled=   0   'False
      Tab(6).Control(3)=   "Label16"
      Tab(6).Control(3).Enabled=   0   'False
      Tab(6).Control(4)=   "lblCodigo7"
      Tab(6).Control(4).Enabled=   0   'False
      Tab(6).Control(5)=   "Label18"
      Tab(6).Control(5).Enabled=   0   'False
      Tab(6).Control(6)=   "dbDetalleProducto"
      Tab(6).Control(6).Enabled=   0   'False
      Tab(6).Control(7)=   "cmdModificarProducto"
      Tab(6).Control(7).Enabled=   0   'False
      Tab(6).Control(8)=   "cmdAgregarProducto"
      Tab(6).Control(8).Enabled=   0   'False
      Tab(6).ControlCount=   9
      Begin VB.CommandButton cmdAgregarProducto 
         Caption         =   "Agregar"
         Height          =   495
         Left            =   7320
         Picture         =   "0111000.frx":00C4
         Style           =   1  'Graphical
         TabIndex        =   113
         ToolTipText     =   "Agregar Garantia"
         Top             =   4920
         Width           =   1215
      End
      Begin VB.CommandButton cmdModificarProducto 
         Caption         =   "Modificar"
         Height          =   495
         Left            =   8760
         Picture         =   "0111000.frx":05F6
         Style           =   1  'Graphical
         TabIndex        =   112
         ToolTipText     =   "Modificar Garantia"
         Top             =   4920
         Width           =   1095
      End
      Begin VB.CheckBox Chkcontroldispo 
         Alignment       =   1  'Right Justify
         Caption         =   "Controlar Saldo Disponible"
         BeginProperty Font 
            Name            =   "MS Sans Serif"
            Size            =   9.75
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   375
         Left            =   -68760
         TabIndex        =   108
         Top             =   3900
         Width           =   3255
      End
      Begin Crystal.CrystalReport crCliente 
         Left            =   -68040
         Top             =   1980
         _ExtentX        =   741
         _ExtentY        =   741
         _Version        =   348160
         PrintFileLinesPerPage=   60
      End
      Begin VB.CheckBox chkAfecto 
         Alignment       =   1  'Right Justify
         Caption         =   "Afecto"
         BeginProperty Font 
            Name            =   "MS Sans Serif"
            Size            =   12
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   375
         Left            =   -66840
         TabIndex        =   39
         Top             =   3420
         Value           =   1  'Checked
         Width           =   1215
      End
      Begin VB.CommandButton cmdAgregarCredito 
         Caption         =   "Agregar"
         Height          =   495
         Left            =   -67680
         Picture         =   "0111000.frx":0B28
         Style           =   1  'Graphical
         TabIndex        =   50
         ToolTipText     =   "Agregar Crédito"
         Top             =   4860
         Width           =   1215
      End
      Begin VB.CommandButton cmdModificarCredito 
         Caption         =   "Modificar"
         Height          =   495
         Left            =   -66240
         Picture         =   "0111000.frx":105A
         Style           =   1  'Graphical
         TabIndex        =   51
         ToolTipText     =   "Modificar Crédito"
         Top             =   4860
         Width           =   1095
      End
      Begin VB.TextBox txtDiaGracia 
         Alignment       =   1  'Right Justify
         Height          =   285
         Left            =   -72960
         MaxLength       =   3
         TabIndex        =   40
         Text            =   "0"
         Top             =   4020
         Width           =   1935
      End
      Begin VB.CommandButton cmdBusDiaPago 
         Height          =   375
         Left            =   -68520
         MouseIcon       =   "0111000.frx":158C
         MousePointer    =   99  'Custom
         Picture         =   "0111000.frx":16DE
         Style           =   1  'Graphical
         TabIndex        =   38
         ToolTipText     =   "Buscar Almacén"
         Top             =   3420
         Width           =   375
      End
      Begin MSDataListLib.DataCombo dtcDiaPago 
         Height          =   315
         Left            =   -72960
         TabIndex        =   37
         Top             =   3420
         Width           =   4335
         _ExtentX        =   7646
         _ExtentY        =   556
         _Version        =   393216
         Text            =   ""
      End
      Begin MSDataGridLib.DataGrid dbDetalleCreditos 
         Height          =   2295
         Left            =   -74640
         TabIndex        =   52
         Top             =   2340
         Width           =   9495
         _ExtentX        =   16748
         _ExtentY        =   4048
         _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
         Caption         =   "[F3]_Eliminar Registro"
         ColumnCount     =   2
         BeginProperty Column00 
            DataField       =   ""
            Caption         =   ""
            BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
               Type            =   0
               Format          =   ""
               HaveTrueFalseNull=   0
               FirstDayOfWeek  =   0
               FirstWeekOfYear =   0
               LCID            =   3082
               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            =   3082
               SubFormatType   =   0
            EndProperty
         EndProperty
         SplitCount      =   1
         BeginProperty Split0 
            BeginProperty Column00 
            EndProperty
            BeginProperty Column01 
            EndProperty
         EndProperty
      End
      Begin VB.CommandButton cmdModificarGarantia 
         Caption         =   "Modificar"
         Height          =   495
         Left            =   -66240
         Picture         =   "0111000.frx":1C10
         Style           =   1  'Graphical
         TabIndex        =   48
         ToolTipText     =   "Modificar Garantia"
         Top             =   4860
         Width           =   1095
      End
      Begin VB.TextBox txtCodigo 
         Height          =   285
         Left            =   -73560
         MaxLength       =   20
         TabIndex        =   0
         Top             =   1020
         Width           =   1935
      End
      Begin VB.CommandButton cmdModificarTarjeta 
         Caption         =   "Modificar"
         Height          =   495
         Left            =   -66840
         Picture         =   "0111000.frx":2142
         Style           =   1  'Graphical
         TabIndex        =   45
         ToolTipText     =   "Modificar Tarjeta"
         Top             =   4380
         Width           =   1215
      End
      Begin VB.CommandButton cmdBusVendedor 
         Height          =   375
         Left            =   -70440
         MouseIcon       =   "0111000.frx":2674
         MousePointer    =   99  'Custom
         Picture         =   "0111000.frx":27C6
         Style           =   1  'Graphical
         TabIndex        =   10
         ToolTipText     =   "Buscar Vendedor"
         Top             =   3300
         Width           =   375
      End
      Begin MSDataListLib.DataCombo dtcVendedor 
         Height          =   315
         Left            =   -73560
         TabIndex        =   9
         Top             =   3300
         Width           =   3015
         _ExtentX        =   5318
         _ExtentY        =   556
         _Version        =   393216
         Style           =   2
         Text            =   ""
      End
      Begin VB.TextBox txtCodSolomon 
         Height          =   285
         Left            =   -69240
         TabIndex        =   4
         Top             =   1500
         Width           =   2175
      End
      Begin VB.CommandButton cmdAgregarGarantia 
         Caption         =   "Agregar"
         Height          =   495
         Left            =   -67680
         Picture         =   "0111000.frx":2CF8
         Style           =   1  'Graphical
         TabIndex        =   47
         ToolTipText     =   "Agregar Garantia"
         Top             =   4860
         Width           =   1215
      End
      Begin MSDataGridLib.DataGrid dbDetalleGarantias 
         Height          =   2655
         Left            =   -74640
         TabIndex        =   49
         Top             =   1980
         Width           =   9495
         _ExtentX        =   16748
         _ExtentY        =   4683
         _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
         Caption         =   "[F3]_Eliminar Registro"
         ColumnCount     =   2
         BeginProperty Column00 
            DataField       =   ""
            Caption         =   ""
            BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
               Type            =   0
               Format          =   ""
               HaveTrueFalseNull=   0
               FirstDayOfWeek  =   0
               FirstWeekOfYear =   0
               LCID            =   3082
               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            =   3082
               SubFormatType   =   0
            EndProperty
         EndProperty
         SplitCount      =   1
         BeginProperty Split0 
            BeginProperty Column00 
            EndProperty
            BeginProperty Column01 
            EndProperty
         EndProperty
      End
      Begin VB.CommandButton cmdAgregaTarjeta 
         Caption         =   "Agregar"
         Height          =   495
         Left            =   -66840
         Picture         =   "0111000.frx":322A
         Style           =   1  'Graphical
         TabIndex        =   44
         ToolTipText     =   "Agregar Tarjeta"
         Top             =   3780
         Width           =   1215
      End
      Begin MSDataGridLib.DataGrid dbDetalleTarjetas 
         Height          =   2655
         Left            =   -74520
         TabIndex        =   46
         Top             =   2220
         Width           =   7455
         _ExtentX        =   13150
         _ExtentY        =   4683
         _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
         Caption         =   "[F3]_Eliminar Registro"
         ColumnCount     =   2
         BeginProperty Column00 
            DataField       =   ""
            Caption         =   ""
            BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
               Type            =   0
               Format          =   ""
               HaveTrueFalseNull=   0
               FirstDayOfWeek  =   0
               FirstWeekOfYear =   0
               LCID            =   3082
               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            =   3082
               SubFormatType   =   0
            EndProperty
         EndProperty
         SplitCount      =   1
         BeginProperty Split0 
            BeginProperty Column00 
            EndProperty
            BeginProperty Column01 
            EndProperty
         EndProperty
      End
      Begin VB.CommandButton cmdAgregarPlaca 
         Caption         =   "Agregar"
         Height          =   495
         Left            =   -67080
         Picture         =   "0111000.frx":375C
         Style           =   1  'Graphical
         TabIndex        =   42
         ToolTipText     =   "Agregar Placa"
         Top             =   3900
         Width           =   1215
      End
      Begin VB.CommandButton cmdBusTTCambio 
         Height          =   375
         Left            =   -65520
         MouseIcon       =   "0111000.frx":3C8E
         MousePointer    =   99  'Custom
         Picture         =   "0111000.frx":3DE0
         Style           =   1  'Graphical
         TabIndex        =   32
         ToolTipText     =   "Buscar Clase de Tipo Cambio "
         Top             =   2100
         Width           =   375
      End
      Begin VB.CommandButton cmdBusCondPago2 
         Height          =   375
         Left            =   -65520
         MouseIcon       =   "0111000.frx":4312
         MousePointer    =   99  'Custom
         Picture         =   "0111000.frx":4464
         Style           =   1  'Graphical
         TabIndex        =   36
         ToolTipText     =   "Buscar Condicion de Pago"
         Top             =   2745
         Width           =   375
      End
      Begin VB.CommandButton cmdBusCondPago1 
         Height          =   375
         Left            =   -70440
         MouseIcon       =   "0111000.frx":4996
         MousePointer    =   99  'Custom
         Picture         =   "0111000.frx":4AE8
         Style           =   1  'Graphical
         TabIndex        =   34
         ToolTipText     =   "Buscar Condicion de Pago"
         Top             =   2745
         Width           =   375
      End
      Begin VB.CommandButton cmdBusTipoCliente 
         Height          =   375
         Left            =   -70440
         MouseIcon       =   "0111000.frx":501A
         MousePointer    =   99  'Custom
         Picture         =   "0111000.frx":516C
         Style           =   1  'Graphical
         TabIndex        =   30
         ToolTipText     =   "Buscar Tipo de Cliente"
         Top             =   2100
         Width           =   375
      End
      Begin MSDataListLib.DataCombo dtcCondPago2 
         Height          =   315
         Left            =   -68040
         TabIndex        =   35
         Top             =   2745
         Width           =   2415
         _ExtentX        =   4260
         _ExtentY        =   556
         _Version        =   393216
         Style           =   2
         Text            =   ""
      End
      Begin MSDataListLib.DataCombo dtcCondPago1 
         Height          =   315
         Left            =   -72960
         TabIndex        =   33
         Top             =   2745
         Width           =   2415
         _ExtentX        =   4260
         _ExtentY        =   556
         _Version        =   393216
         Style           =   2
         Text            =   ""
      End
      Begin MSDataListLib.DataCombo dtcTTCambio 
         Height          =   315
         Left            =   -68040
         TabIndex        =   31
         Top             =   2100
         Width           =   2415
         _ExtentX        =   4260
         _ExtentY        =   556
         _Version        =   393216
         Style           =   2
         Text            =   ""
      End
      Begin MSDataListLib.DataCombo dtcTipoCliente 
         Height          =   315
         Left            =   -72960
         TabIndex        =   29
         Top             =   2100
         Width           =   2415
         _ExtentX        =   4260
         _ExtentY        =   556
         _Version        =   393216
         Style           =   2
         Text            =   ""
      End
      Begin VB.CommandButton cmdBusDist 
         Height          =   375
         Left            =   -65520
         MouseIcon       =   "0111000.frx":569E
         MousePointer    =   99  'Custom
         Picture         =   "0111000.frx":57F0
         Style           =   1  'Graphical
         TabIndex        =   18
         ToolTipText     =   "Buscar Distrito"
         Top             =   4260
         Width           =   375
      End
      Begin VB.CommandButton cmdBusDepa 
         Height          =   375
         Left            =   -70440
         MouseIcon       =   "0111000.frx":5D22
         MousePointer    =   99  'Custom
         Picture         =   "0111000.frx":5E74
         Style           =   1  'Graphical
         TabIndex        =   16
         ToolTipText     =   "Buscar Departamento"
         Top             =   4260
         Width           =   375
      End
      Begin VB.CommandButton cmdBusPais 
         Height          =   375
         Left            =   -70440
         MouseIcon       =   "0111000.frx":63A6
         MousePointer    =   99  'Custom
         Picture         =   "0111000.frx":64F8
         Style           =   1  'Graphical
         TabIndex        =   12
         ToolTipText     =   "Buscar Pais"
         Top             =   3780
         Width           =   375
      End
      Begin VB.CommandButton cmdBusImp2 
         Height          =   375
         Left            =   -65520
         Picture         =   "0111000.frx":6A2A
         Style           =   1  'Graphical
         TabIndex        =   28
         ToolTipText     =   "Buscar Impuesto"
         Top             =   5700
         Width           =   375
      End
      Begin VB.CommandButton cmdBusImp1 
         Height          =   375
         Left            =   -70440
         Picture         =   "0111000.frx":6F5C
         Style           =   1  'Graphical
         TabIndex        =   26
         ToolTipText     =   "Buscar Impuesto"
         Top             =   5700
         Width           =   375
      End
      Begin MSDataListLib.DataCombo dtcImpuesto2 
         Height          =   315
         Left            =   -68400
         TabIndex        =   27
         Top             =   5700
         Width           =   2775
         _ExtentX        =   4895
         _ExtentY        =   556
         _Version        =   393216
         Style           =   2
         Text            =   ""
      End
      Begin MSDataListLib.DataCombo dtcImpuesto1 
         Height          =   315
         Left            =   -73560
         TabIndex        =   25
         Top             =   5700
         Width           =   3015
         _ExtentX        =   5318
         _ExtentY        =   556
         _Version        =   393216
         Style           =   2
         Text            =   ""
      End
      Begin MSComCtl2.DTPicker dtpFechaInsc 
         Height          =   315
         Left            =   -68400
         TabIndex        =   24
         Top             =   5220
         Width           =   1335
         _ExtentX        =   2355
         _ExtentY        =   556
         _Version        =   393216
         Format          =   65339393
         CurrentDate     =   37576
      End
      Begin MSComCtl2.DTPicker dtpFechaNac 
         Height          =   315
         Left            =   -68400
         TabIndex        =   21
         Top             =   4740
         Width           =   1335
         _ExtentX        =   2355
         _ExtentY        =   556
         _Version        =   393216
         Format          =   65339393
         CurrentDate     =   37576
      End
      Begin MSDataListLib.DataCombo dtcDistrito 
         Height          =   315
         Left            =   -68400
         TabIndex        =   17
         Top             =   4260
         Width           =   2775
         _ExtentX        =   4895
         _ExtentY        =   556
         _Version        =   393216
         Style           =   2
         Text            =   ""
      End
      Begin MSDataListLib.DataCombo dtcDepartamento 
         Height          =   315
         Left            =   -73560
         TabIndex        =   15
         Top             =   4260
         Width           =   3015
         _ExtentX        =   5318
         _ExtentY        =   556
         _Version        =   393216
         Style           =   2
         Text            =   ""
      End
      Begin MSDataListLib.DataCombo dtcPais 
         Height          =   315
         Left            =   -73560
         TabIndex        =   11
         Top             =   3780
         Width           =   3015
         _ExtentX        =   5318
         _ExtentY        =   556
         _Version        =   393216
         Style           =   2
         Text            =   ""
      End
      Begin VB.TextBox txtRuc 
         Height          =   285
         Left            =   -73560
         TabIndex        =   3
         Top             =   1500
         Width           =   1935
      End
      Begin VB.CommandButton cmdBuscar 
         Enabled         =   0   'False
         Height          =   375
         Left            =   -71520
         Picture         =   "0111000.frx":748E
         Style           =   1  'Graphical
         TabIndex        =   1
         ToolTipText     =   "Buscar Cliente"
         Top             =   1020
         Width           =   375
      End
      Begin VB.TextBox txtDescripcion 
         Height          =   285
         Left            =   -69240
         MaxLength       =   50
         TabIndex        =   2
         Top             =   1020
         Width           =   4095
      End
      Begin VB.TextBox txtDireccion1 
         Height          =   285
         Left            =   -73560
         MaxLength       =   50
         TabIndex        =   5
         Top             =   1980
         Width           =   4935
      End
      Begin VB.TextBox txtDireccion2 
         Height          =   285
         Left            =   -73560
         MaxLength       =   50
         TabIndex        =   6
         Top             =   2385
         Width           =   4935
      End
      Begin VB.TextBox txtFax 
         Height          =   285
         Left            =   -68400
         MaxLength       =   10
         TabIndex        =   8
         Top             =   2865
         Width           =   1935
      End
      Begin VB.TextBox txtTelefono 
         Height          =   285
         Left            =   -73560
         MaxLength       =   10
         TabIndex        =   7
         Top             =   2820
         Width           =   1455
      End
      Begin VB.CommandButton cmdBusMoneda 
         Height          =   375
         Left            =   -70440
         MouseIcon       =   "0111000.frx":79C0
         MousePointer    =   99  'Custom
         Picture         =   "0111000.frx":7B12
         Style           =   1  'Graphical
         TabIndex        =   20
         ToolTipText     =   "Buscar Tipo de Moneda"
         Top             =   4740
         Width           =   375
      End
      Begin VB.CommandButton cmdBusEstado 
         Height          =   375
         Left            =   -70440
         MouseIcon       =   "0111000.frx":8044
         MousePointer    =   99  'Custom
         Picture         =   "0111000.frx":8196
         Style           =   1  'Graphical
         TabIndex        =   23
         ToolTipText     =   "Buscar Estado de Cliente"
         Top             =   5220
         Width           =   375
      End
      Begin VB.CommandButton cmdBusZona 
         Height          =   375
         Left            =   -65520
         MouseIcon       =   "0111000.frx":86C8
         MousePointer    =   99  'Custom
         Picture         =   "0111000.frx":881A
         Style           =   1  'Graphical
         TabIndex        =   14
         ToolTipText     =   "Buscar Zona de Cliente"
         Top             =   3780
         Width           =   375
      End
      Begin MSDataListLib.DataCombo dtcEstado 
         Height          =   315
         Left            =   -73560
         TabIndex        =   22
         Top             =   5220
         Width           =   3015
         _ExtentX        =   5318
         _ExtentY        =   556
         _Version        =   393216
         Style           =   2
         Text            =   ""
      End
      Begin MSDataListLib.DataCombo dtcZona 
         Height          =   315
         Left            =   -68400
         TabIndex        =   13
         Top             =   3780
         Width           =   2775
         _ExtentX        =   4895
         _ExtentY        =   556
         _Version        =   393216
         Style           =   2
         Text            =   ""
      End
      Begin MSDataListLib.DataCombo dtcMoneda 
         Height          =   315
         Left            =   -73560
         TabIndex        =   19
         Top             =   4740
         Width           =   3015
         _ExtentX        =   5318
         _ExtentY        =   556
         _Version        =   393216
         Style           =   2
         Text            =   ""
      End
      Begin MSDataGridLib.DataGrid dbDetallePlacas 
         Height          =   2175
         Left            =   -74160
         TabIndex        =   43
         Top             =   2220
         Width           =   6855
         _ExtentX        =   12091
         _ExtentY        =   3836
         _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
         Caption         =   "[F3]_Eliminar Registro"
         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 MiControl.CtrlNumber ctnMontoTotal 
         Height          =   375
         Left            =   -74640
         TabIndex        =   41
         Top             =   5700
         Width           =   2415
         _ExtentX        =   4260
         _ExtentY        =   661
         BackColor       =   -2147483643
         BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
            Name            =   "MS Sans Serif"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
      End
      Begin MiControl.CtrlNumber CtnDescuento 
         Height          =   375
         Left            =   -72960
         TabIndex        =   110
         Top             =   4500
         Width           =   1335
         _ExtentX        =   2355
         _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 MSDataGridLib.DataGrid dbDetalleProducto 
         Height          =   2655
         Left            =   360
         TabIndex        =   114
         Top             =   2040
         Width           =   9495
         _ExtentX        =   16748
         _ExtentY        =   4683
         _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
         Caption         =   "[F3]_Eliminar Registro"
         ColumnCount     =   2
         BeginProperty Column00 
            DataField       =   ""
            Caption         =   ""
            BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
               Type            =   0
               Format          =   ""
               HaveTrueFalseNull=   0
               FirstDayOfWeek  =   0
               FirstWeekOfYear =   0
               LCID            =   3082
               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            =   3082
               SubFormatType   =   0
            EndProperty
         EndProperty
         SplitCount      =   1
         BeginProperty Split0 
            BeginProperty Column00 
            EndProperty
            BeginProperty Column01 
            EndProperty
         EndProperty
      End
      Begin VB.Label Label18 
         Caption         =   "Código"
         Height          =   255
         Left            =   360
         TabIndex        =   118
         Top             =   1080
         Width           =   975
      End
      Begin VB.Label lblCodigo7 
         BorderStyle     =   1  'Fixed Single
         Height          =   255
         Left            =   1440
         TabIndex        =   117
         Top             =   1080
         Width           =   1935
      End
      Begin VB.Label Label16 
         AutoSize        =   -1  'True
         Caption         =   "Razón Social"
         Height          =   195
         Left            =   4440
         TabIndex        =   116
         Top             =   1095
         Width           =   945
      End
      Begin VB.Label lblNombre7 
         BorderStyle     =   1  'Fixed Single
         Height          =   255
         Left            =   5760
         TabIndex        =   115
         Top             =   1080
         Width           =   4095
      End
      Begin VB.Line Line12 
         X1              =   360
         X2              =   9840
         Y1              =   1800
         Y2              =   1800
      End
      Begin VB.Line Line11 
         X1              =   360
         X2              =   9840
         Y1              =   5640
         Y2              =   5640
      End
      Begin VB.Label Label13 
         Caption         =   "%"
         BeginProperty Font 
            Name            =   "MS Sans Serif"
            Size            =   9.75
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   255
         Left            =   -71640
         TabIndex        =   111
         Top             =   4500
         Width           =   255
      End
      Begin VB.Label Label11 
         Caption         =   "Descuento"
         Height          =   255
         Left            =   -74640
         TabIndex        =   109
         Top             =   4500
         Width           =   1095
      End
      Begin VB.Label lblTotalSaldo 
         Alignment       =   1  'Right Justify
         Appearance      =   0  'Flat
         BackColor       =   &H80000004&
         BorderStyle     =   1  'Fixed Single
         Caption         =   "0"
         BeginProperty Font 
            Name            =   "MS Sans Serif"
            Size            =   12
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H80000008&
         Height          =   345
         Left            =   -67320
         TabIndex        =   107
         Top             =   5700
         Width           =   2175
      End
      Begin VB.Label Label7 
         Caption         =   "Deuda"
         BeginProperty Font 
            Name            =   "MS Sans Serif"
            Size            =   9.75
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   255
         Left            =   -70680
         TabIndex        =   106
         Top             =   5340
         Width           =   1335
      End
      Begin VB.Label Label3 
         Caption         =   "Monto Total de Límite de Crédito"
         Height          =   375
         Left            =   -74280
         TabIndex        =   105
         Top             =   1860
         Width           =   1455
      End
      Begin VB.Label lblTotalMonto 
         Alignment       =   1  'Right Justify
         BorderStyle     =   1  'Fixed Single
         BeginProperty Font 
            Name            =   "MS Sans Serif"
            Size            =   9.75
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   270
         Left            =   -72840
         TabIndex        =   104
         Top             =   1920
         Width           =   2415
      End
      Begin VB.Label lblPorcentaje 
         Alignment       =   1  'Right Justify
         Caption         =   "0"
         BeginProperty Font 
            Name            =   "MS Sans Serif"
            Size            =   12
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   375
         Left            =   -74760
         TabIndex        =   103
         Top             =   4740
         Width           =   975
      End
      Begin VB.Label lblMensajePorc 
         Caption         =   "% de Límite de Crédito Asignado"
         BeginProperty Font 
            Name            =   "MS Sans Serif"
            Size            =   12
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   375
         Left            =   -73800
         TabIndex        =   102
         Top             =   4740
         Width           =   4095
      End
      Begin VB.Image Image6 
         Height          =   480
         Left            =   -74640
         Picture         =   "0111000.frx":8D4C
         Top             =   1260
         Width           =   480
      End
      Begin VB.Image Image5 
         Height          =   480
         Left            =   -74640
         Picture         =   "0111000.frx":9056
         Top             =   1260
         Width           =   480
      End
      Begin VB.Image Image4 
         Height          =   480
         Left            =   -74640
         Picture         =   "0111000.frx":9360
         Top             =   1260
         Width           =   480
      End
      Begin VB.Image Image3 
         Height          =   480
         Left            =   -74640
         Picture         =   "0111000.frx":966A
         Top             =   1260
         Width           =   480
      End
      Begin VB.Image Image2 
         Height          =   480
         Left            =   -74640
         Picture         =   "0111000.frx":9974
         Top             =   1260
         Width           =   480
      End
      Begin VB.Image Image1 
         Height          =   1080
         Left            =   -66240
         Picture         =   "0111000.frx":9C7E
         Stretch         =   -1  'True
         Top             =   1500
         Width           =   1065
      End
      Begin VB.Label lblTotalDeuda 
         Alignment       =   1  'Right Justify
         Appearance      =   0  'Flat
         BackColor       =   &H80000004&
         BorderStyle     =   1  'Fixed Single
         Caption         =   "0"
         BeginProperty Font 
            Name            =   "MS Sans Serif"
            Size            =   12
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H80000008&
         Height          =   345
         Left            =   -70680
         TabIndex        =   101
         Top             =   5700
         Width           =   2295
      End
      Begin VB.Label lblSaldo 
         Caption         =   "Total Saldo Disponible"
         BeginProperty Font 
            Name            =   "MS Sans Serif"
            Size            =   9.75
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   495
         Left            =   -67320
         TabIndex        =   100
         Top             =   5180
         Width           =   2175
      End
      Begin VB.Label Label2 
         Caption         =   "Monto Total de Límite de Crédito"
         BeginProperty Font 
            Name            =   "MS Sans Serif"
            Size            =   9.75
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   495
         Left            =   -74640
         TabIndex        =   99
         Top             =   5180
         Width           =   2055
      End
      Begin VB.Line Line10 
         X1              =   -74640
         X2              =   -65160
         Y1              =   5580
         Y2              =   5580
      End
      Begin VB.Line Line9 
         X1              =   -74640
         X2              =   -65160
         Y1              =   1740
         Y2              =   1740
      End
      Begin VB.Line Line4 
         X1              =   -74640
         X2              =   -65160
         Y1              =   5100
         Y2              =   5100
      End
      Begin VB.Line Line3 
         X1              =   -74640
         X2              =   -65160
         Y1              =   1740
         Y2              =   1740
      End
      Begin VB.Label lblDiaGracia 
         Caption         =   "Dia de Gracia"
         Height          =   255
         Left            =   -74640
         TabIndex        =   98
         Top             =   4020
         Width           =   1335
      End
      Begin VB.Label lblDiaPago 
         Caption         =   "Dia de Pago"
         Height          =   255
         Left            =   -74640
         TabIndex        =   97
         Top             =   3465
         Width           =   1215
      End
      Begin VB.Label Label9 
         Caption         =   "Código"
         Height          =   255
         Left            =   -74640
         TabIndex        =   96
         Top             =   1020
         Width           =   975
      End
      Begin VB.Label lblCodigo6 
         BorderStyle     =   1  'Fixed Single
         Height          =   255
         Left            =   -73560
         TabIndex        =   95
         Top             =   1020
         Width           =   1935
      End
      Begin VB.Label Label5 
         AutoSize        =   -1  'True
         Caption         =   "Razón Social"
         Height          =   195
         Left            =   -70560
         TabIndex        =   94
         Top             =   1035
         Width           =   945
      End
      Begin VB.Label lblNombre6 
         BorderStyle     =   1  'Fixed Single
         Height          =   255
         Left            =   -69240
         TabIndex        =   93
         Top             =   1020
         Width           =   4095
      End
      Begin VB.Label lblVendecor 
         AutoSize        =   -1  'True
         Caption         =   "Vendedor"
         Height          =   195
         Left            =   -74640
         TabIndex        =   92
         Top             =   3300
         Width           =   690
      End
      Begin VB.Label lblSolomon 
         Caption         =   "Cod. Solomon"
         Height          =   255
         Left            =   -70560
         TabIndex        =   91
         Top             =   1500
         Width           =   1095
      End
      Begin VB.Line Line8 
         X1              =   -74640
         X2              =   -65160
         Y1              =   5580
         Y2              =   5580
      End
      Begin VB.Line Line7 
         X1              =   -74640
         X2              =   -65160
         Y1              =   1740
         Y2              =   1740
      End
      Begin VB.Line Line6 
         X1              =   -74640
         X2              =   -65160
         Y1              =   5700
         Y2              =   5700
      End
      Begin VB.Line Line5 
         X1              =   -74640
         X2              =   -65160
         Y1              =   1740
         Y2              =   1740
      End
      Begin VB.Label lblNombre5 
         BorderStyle     =   1  'Fixed Single
         Height          =   255
         Left            =   -69240
         TabIndex        =   90
         Top             =   1020
         Width           =   4095
      End
      Begin VB.Label Label14 
         AutoSize        =   -1  'True
         Caption         =   "Razón Social"
         Height          =   195
         Left            =   -70560
         TabIndex        =   89
         Top             =   1035
         Width           =   945
      End
      Begin VB.Label lblCodigo5 
         BorderStyle     =   1  'Fixed Single
         Height          =   255
         Left            =   -73560
         TabIndex        =   88
         Top             =   1020
         Width           =   1935
      End
      Begin VB.Label Label12 
         Caption         =   "Código"
         Height          =   255
         Left            =   -74640
         TabIndex        =   87
         Top             =   1020
         Width           =   975
      End
      Begin VB.Label lblNombre4 
         BorderStyle     =   1  'Fixed Single
         Height          =   255
         Left            =   -69240
         TabIndex        =   86
         Top             =   1020
         Width           =   4095
      End
      Begin VB.Label Label10 
         AutoSize        =   -1  'True
         Caption         =   "Razón Social"
         Height          =   195
         Left            =   -70560
         TabIndex        =   85
         Top             =   1035
         Width           =   945
      End
      Begin VB.Label lblCodigo4 
         BorderStyle     =   1  'Fixed Single
         Height          =   255
         Left            =   -73560
         TabIndex        =   84
         Top             =   1020
         Width           =   1935
      End
      Begin VB.Label Label8 
         Caption         =   "Código"
         Height          =   255
         Left            =   -74640
         TabIndex        =   83
         Top             =   1020
         Width           =   975
      End
      Begin VB.Label lblNombre3 
         BorderStyle     =   1  'Fixed Single
         Height          =   255
         Left            =   -69240
         TabIndex        =   82
         Top             =   1020
         Width           =   4095
      End
      Begin VB.Label Label6 
         AutoSize        =   -1  'True
         Caption         =   "Razón Social"
         Height          =   195
         Left            =   -70560
         TabIndex        =   81
         Top             =   1035
         Width           =   945
      End
      Begin VB.Label lblCodigo3 
         BorderStyle     =   1  'Fixed Single
         Height          =   255
         Left            =   -73560
         TabIndex        =   80
         Top             =   1020
         Width           =   1935
      End
      Begin VB.Label Label4 
         Caption         =   "Código"
         Height          =   255
         Left            =   -74640
         TabIndex        =   79
         Top             =   1020
         Width           =   975
      End
      Begin VB.Label lblNombre2 
         BorderStyle     =   1  'Fixed Single
         Height          =   255
         Left            =   -69240
         TabIndex        =   78
         Top             =   1020
         Width           =   4095
      End
      Begin VB.Label Label 
         AutoSize        =   -1  'True
         Caption         =   "Razón Social"
         Height          =   195
         Left            =   -70560
         TabIndex        =   77
         Top             =   1020
         Width           =   945
      End
      Begin VB.Label lblCodigo2 
         BorderStyle     =   1  'Fixed Single
         Height          =   255
         Left            =   -73560
         TabIndex        =   76
         Top             =   1020
         Width           =   1935
      End
      Begin VB.Label Label1 
         Caption         =   "Código"
         Height          =   255
         Left            =   -74640
         TabIndex        =   75
         Top             =   1020
         Width           =   975
      End
      Begin VB.Line Line2 
         BorderColor     =   &H80000006&
         X1              =   -74520
         X2              =   -65280
         Y1              =   4980
         Y2              =   4980
      End
      Begin VB.Line Line1 
         BorderColor     =   &H80000006&
         X1              =   -74640
         X2              =   -65280
         Y1              =   1740
         Y2              =   1740
      End
      Begin VB.Label lblCondPagoDoc 
         Caption         =   "Condicion de Pago documento generado"
         Height          =   495
         Left            =   -69720
         TabIndex        =   74
         Top             =   2745
         Width           =   1575
      End
      Begin VB.Label lblCondPagoTicket 
         Caption         =   "Condición de Pago para Ticket"
         Height          =   435
         Left            =   -74640
         TabIndex        =   73
         Top             =   2655
         Width           =   1365
      End
      Begin VB.Label lblTTCambio 
         Caption         =   "Clase de Tipo de Cambio"
         Height          =   435
         Left            =   -69720
         TabIndex        =   72
         Top             =   2100
         Width           =   1290
      End
      Begin VB.Label lblTipoCliente 
         AutoSize        =   -1  'True
         Caption         =   "Tipo de Cliente"
         Height          =   195
         Left            =   -74640
         TabIndex        =   71
         Top             =   2100
         Width           =   1065
      End
      Begin VB.Label lblImpuesto2 
         AutoSize        =   -1  'True
         Caption         =   "Impuesto2"
         Height          =   195
         Left            =   -69360
         TabIndex        =   70
         Top             =   5700
         Width           =   735
      End
      Begin VB.Label lblImpuesto1 
         AutoSize        =   -1  'True
         Caption         =   "Impuesto1"
         Height          =   195
         Left            =   -74640
         TabIndex        =   69
         Top             =   5700
         Width           =   735
      End
      Begin VB.Label lblFechaInsc 
         AutoSize        =   -1  'True
         Caption         =   "Fecha Insc."
         Height          =   195
         Left            =   -69360
         TabIndex        =   68
         Top             =   5220
         Width           =   840
      End
      Begin VB.Label lblFechaNac 
         AutoSize        =   -1  'True
         Caption         =   "Fecha Nac."
         Height          =   195
         Left            =   -69360
         TabIndex        =   67
         Top             =   4740
         Width           =   840
      End
      Begin VB.Label lblDistrito 
         AutoSize        =   -1  'True
         Caption         =   "Distrito"
         Height          =   195
         Left            =   -69360
         TabIndex        =   66
         Top             =   4260
         Width           =   480
      End
      Begin VB.Label lblPais 
         AutoSize        =   -1  'True
         Caption         =   "Pais"
         Height          =   195
         Left            =   -74640
         TabIndex        =   65
         Top             =   3780
         Width           =   300
      End
      Begin VB.Label lblDepartamento 
         AutoSize        =   -1  'True
         Caption         =   "Departamento"
         Height          =   195
         Left            =   -74640
         TabIndex        =   64
         Top             =   4260
         Width           =   1005
      End
      Begin VB.Label lblRuc 
         AutoSize        =   -1  'True
         Caption         =   "RUC"
         Height          =   195
         Left            =   -74640
         TabIndex        =   63
         Top             =   1500
         Width           =   345
      End
      Begin VB.Label lblCodigo 
         AutoSize        =   -1  'True
         Caption         =   "Código "
         Height          =   195
         Left            =   -74640
         TabIndex        =   62
         Top             =   1020
         Width           =   540
      End
      Begin VB.Label lblNombre 
         AutoSize        =   -1  'True
         Caption         =   "Razón Social"
         Height          =   195
         Left            =   -70560
         TabIndex        =   61
         Top             =   1035
         Width           =   945
      End
      Begin VB.Label lblDireccion1 
         AutoSize        =   -1  'True
         Caption         =   "Dirección 1"
         Height          =   195
         Left            =   -74640
         TabIndex        =   60
         Top             =   1995
         Width           =   810
      End
      Begin VB.Label lblDireccion2 
         AutoSize        =   -1  'True
         Caption         =   "Dirección 2"
         Height          =   195
         Left            =   -74640
         TabIndex        =   59
         Top             =   2400
         Width           =   810
      End
      Begin VB.Label lblFax 
         AutoSize        =   -1  'True
         Caption         =   "Fax"
         Height          =   195
         Left            =   -69360
         TabIndex        =   58
         Top             =   2865
         Width           =   255
      End
      Begin VB.Label lblTelefono 
         AutoSize        =   -1  'True
         Caption         =   "Teléfono"
         Height          =   195
         Left            =   -74640
         TabIndex        =   57
         Top             =   2820
         Width           =   630
      End
      Begin VB.Label lblZona 
         AutoSize        =   -1  'True
         Caption         =   "Zona"
         Height          =   195
         Left            =   -69360
         TabIndex        =   56
         Top             =   3780
         Width           =   375
      End
      Begin VB.Label lblMoneda 
         AutoSize        =   -1  'True
         Caption         =   "Moneda"
         Height          =   195
         Left            =   -74640
         TabIndex        =   55
         Top             =   4740
         Width           =   585
      End
      Begin VB.Label lblEstado 
         Caption         =   "Estado de Cliente"
         Height          =   495
         Left            =   -74640
         TabIndex        =   54
         Top             =   5100
         Width           =   855
      End
   End
End
Attribute VB_Name = "FMaestroClientes"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
' Programador: Edgar Cancho Ruiz
' Empresa Texaco
' Modulo de Maestra de Clientes
' Fecha : 18/11/2002

'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_Clientes As ADODB.Recordset
Public objCliente As DB_MA_MANTENIMIENTOS.C_CLIENTE
Public objVendedor As DB_OP_MANTENIMIENTOS.C_VENDEDOR
Public objPais As DB_MA_MANTENIMIENTOS.C_PAIS
Public objDepartamento As DB_MA_MANTENIMIENTOS.C_DEPARTAMENTO
Public objDistrito As DB_MA_MANTENIMIENTOS.C_DISTRITO
Public objZona As DB_OP_MANTENIMIENTOS.C_ZONA_CLIENTE
Public objMoneda As DB_MA_MANTENIMIENTOS.C_MONEDA
Public objEstadoCliente As DB_MA_MANTENIMIENTOS.C_ESTADO_CLIENTE
Public objTipoImpuesto As DB_MA_MANTENIMIENTOS.C_TIPOIMPÙESTO

Public objTipocliente As DB_OP_MANTENIMIENTOS.C_TIPO_CLIENTE
Public objTTCambio As DB_MA_MANTENIMIENTOS.C_TDTDCAMBIO
Public objCondPago As DB_MA_MANTENIMIENTOS.C_CONDICIONPAGO

Dim objCorrelativo As DB_CORRELATIVO.C_Correlativos
Dim MlngCorrelativo As Long 'correlativo por usuario, que se almacenara en cada insert en tablas temporales



Private Sub cmdAgregarCredito_Click()

    If CDbl(ctnMontoTotal.Text) = 0 Then
        MsgBox "Ingrese el Monto de Límite de Crédito del Cliente", vbExclamation, "Falta Parametro"
        Exit Sub
    End If
    
    If CDbl(lblPorcentaje.Caption) = 100 Then
        MsgBox "Ya se asigno el 100% del Total de Limite de Credito", vbExclamation, "No se puede Agregar"
        Exit Sub
    End If
    
    
    FClienteCredito.GstrMontoTotal = ctnMontoTotal.Text
    FClienteCredito.Caption = "Agregar Credito de Cliente"
    FClienteCredito.GlngCorrelativo = MlngCorrelativo
    FClienteCredito.GblnModificando = False
    FClienteCredito.GstrCodAlmacen = Empty
    FClienteCredito.GstrPorcentaje = Empty
    FClienteCredito.GstrcodCliente = txtCodigo.Text
    FClienteCredito.Show vbModal
    CargaGrillaCreditos Empty, MlngCorrelativo, False
    lblPorcentaje.Caption = objCliente.ObtienePorcentajeEnTmpCust_Limit(MlngCorrelativo)
    
End Sub

Private Sub cmdAgregarGarantia_Click()
    FClienteGarantia.Caption = "Agregar Garantia de Cliente"
    FClienteGarantia.GlngCorrelativo = MlngCorrelativo
    FClienteGarantia.GblnModificando = False
    FClienteGarantia.GstrTipoGarantia = Empty
    FClienteGarantia.GstrcodCliente = txtCodigo.Text
    FClienteGarantia.Show vbModal
    CargaGrillaGarantias Empty, MlngCorrelativo, False
End Sub

Private Sub cmdAgregarPlaca_Click()
    FClientePlaca.GlngCorrelativo = MlngCorrelativo
    FClientePlaca.GstrcodCliente = txtCodigo.Text
    FClientePlaca.Show vbModal
    CargaGrillaPlacas Empty, MlngCorrelativo, False
End Sub


Private Sub cmdAgregarProducto_Click()
    FClienteProducto.Caption = "Agregar Producto"
    FClienteProducto.GlngCorrelativo = MlngCorrelativo
    FClienteProducto.TxtCodigoPro.Text = Empty
    FClienteProducto.TxtDescripPro.Text = Empty
    FClienteProducto.CtnPorcDesc.ValorPorDefecto
    FClienteProducto.ChkDesc.Value = 0
    FClienteProducto.GblnModificando = False
    FClienteProducto.Show vbModal
    CargaGrillaProductos Empty, MlngCorrelativo, False
End Sub

Private Sub cmdAgregaTarjeta_Click()
    FClienteTarjeta.Caption = "Agregar Tarjeta de Cliente"
    FClienteTarjeta.GlngCorrelativo = MlngCorrelativo
    FClienteTarjeta.GblnModificando = False
    FClienteTarjeta.GstrPassword = Empty
    FClienteTarjeta.GstrcodCliente = txtCodigo.Text
    FClienteTarjeta.Show vbModal
    CargaGrillaTarjetas Empty, MlngCorrelativo, False
End Sub

Private Sub cmdBuscar_Click()
    'Lineas que llaman al Formulario de Búsqueda
    
    Dim ArrayBusqueda(1 To 2, 1 To 3) As Variant
    ArrayBusqueda(1, 1) = "CUSTIDSS"
    ArrayBusqueda(1, 2) = "Código "
    ArrayBusqueda(1, 3) = 1200
    ArrayBusqueda(2, 1) = "CUSTNAME"
    ArrayBusqueda(2, 2) = "Nombre "
    ArrayBusqueda(2, 3) = 4000
      
          
    FBusquedasMa.GObtenerRegistros objCliente.ListarClientesAyuda(0), ArrayBusqueda, 2, 2
    FBusquedasMa.Show vbModal
    If GrecibeUbicacion <> 0 And GrecibeUbicacion <= rs_Clientes.RecordCount Then
          rs_Clientes.AbsolutePosition = GrecibeUbicacion
          asigna_campos
          Call gestadoactualrs(Me, rs_Clientes)
          Call gactualiza_barra(Me)
    End If
  
End Sub

Private Sub cmdBusCondPago1_Click()
   'Lineas que llaman al Formulario de Búsqueda
     
     Dim ArrayBusqueda(1 To 2, 1 To 3) As Variant
     ArrayBusqueda(1, 1) = "TermId"
     ArrayBusqueda(1, 2) = "Código "
     ArrayBusqueda(1, 3) = 1000
     ArrayBusqueda(2, 1) = "Descr"
     ArrayBusqueda(2, 2) = "Descripción "
     ArrayBusqueda(2, 3) = 4000
       
     FBusquedasMa.GObtenerRegistros objCondPago.ListarCondicionesPagoAyuda, ArrayBusqueda, 2, 2
     FBusquedasMa.Show vbModal
     
     If GrecibeUbicacion <> 0 Then
         dtcCondPago1.BoundText = GrecibeColumnaID
     End If
End Sub

Private Sub cmdBusCondPago2_Click()
   'Lineas que llaman al Formulario de Búsqueda
     
     Dim ArrayBusqueda(1 To 2, 1 To 3) As Variant
     ArrayBusqueda(1, 1) = "TermId"
     ArrayBusqueda(1, 2) = "Código "
     ArrayBusqueda(1, 3) = 1000
     ArrayBusqueda(2, 1) = "Descr"
     ArrayBusqueda(2, 2) = "Descripción "
     ArrayBusqueda(2, 3) = 4000
       
     FBusquedasMa.GObtenerRegistros objCondPago.ListarCondicionesPagoAyuda, ArrayBusqueda, 2, 2
     FBusquedasMa.Show vbModal
     
     If GrecibeUbicacion <> 0 Then
         dtcCondPago2.BoundText = GrecibeColumnaID
     End If

End Sub

Private Sub cmdBusDepa_Click()
   'Lineas que llaman al Formulario de Búsqueda
     
     Dim ArrayBusqueda(1 To 2, 1 To 3) As Variant
     ArrayBusqueda(1, 1) = "StateId"
     ArrayBusqueda(1, 2) = "Código "
     ArrayBusqueda(1, 3) = 1000
     ArrayBusqueda(2, 1) = "Descr"
     ArrayBusqueda(2, 2) = "Descripción "
     ArrayBusqueda(2, 3) = 4000
       
     FBusquedasMa.GObtenerRegistros objDepartamento.ListarDepartamentos, ArrayBusqueda, 2, 2
     FBusquedasMa.Show vbModal
     
     If GrecibeUbicacion <> 0 Then
         dtcDepartamento.BoundText = GrecibeColumnaID
     End If
End Sub

Private Sub cmdBusDiaPago_Click()
   'Lineas que llaman al Formulario de Búsqueda
     
     Dim ArrayBusqueda(1 To 2, 1 To 3) As Variant
     ArrayBusqueda(1, 1) = "DIAPAGID"
     ArrayBusqueda(1, 2) = "Código "
     ArrayBusqueda(1, 3) = 1000
     ArrayBusqueda(2, 1) = "Descr"
     ArrayBusqueda(2, 2) = "Descripción "
     ArrayBusqueda(2, 3) = 4000
       
     FBusquedasMa.GObtenerRegistros objCliente.ListarDiasPagoAyuda, ArrayBusqueda, 2, 2
     FBusquedasMa.Show vbModal
     
     If GrecibeUbicacion <> 0 Then
         dtcDiaPago.BoundText = GrecibeColumnaID
     End If
End Sub

Private Sub cmdBusDist_Click()
   'Lineas que llaman al Formulario de Búsqueda
     
     Dim ArrayBusqueda(1 To 2, 1 To 3) As Variant
     ArrayBusqueda(1, 1) = "CityId"
     ArrayBusqueda(1, 2) = "Código "
     ArrayBusqueda(1, 3) = 1000
     ArrayBusqueda(2, 1) = "Descr"
     ArrayBusqueda(2, 2) = "Descripción "
     ArrayBusqueda(2, 3) = 4000
       
     FBusquedasMa.GObtenerRegistros objDistrito.ListarDistritosPorDepartamento(dtcDepartamento.BoundText), ArrayBusqueda, 2, 2
     FBusquedasMa.Show vbModal
     
     If GrecibeUbicacion <> 0 Then
         dtcDistrito.BoundText = GrecibeColumnaID
     End If
End Sub

Private Sub cmdBusEstado_Click()
    'Lineas que llaman al Formulario de Búsqueda
     
     Dim ArrayBusqueda(1 To 2, 1 To 3) As Variant
     ArrayBusqueda(1, 1) = "CUSTSTATUSID"
     ArrayBusqueda(1, 2) = "Código "
     ArrayBusqueda(1, 3) = 1000
     ArrayBusqueda(2, 1) = "DESCRCUST"
     ArrayBusqueda(2, 2) = "Descripción "
     ArrayBusqueda(2, 3) = 4000
       
     FBusquedasMa.GObtenerRegistros objEstadoCliente.ListarEstados_Cliente, ArrayBusqueda, 2, 2
     FBusquedasMa.Show vbModal
     
     If GrecibeUbicacion <> 0 Then
         dtcEstado.BoundText = GrecibeColumnaID
     End If
End Sub

Private Sub cmdBusImp1_Click()
    'Lineas que llaman al Formulario de Búsqueda
     
     Dim ArrayBusqueda(1 To 2, 1 To 3) As Variant
     ArrayBusqueda(1, 1) = "TaxId"
     ArrayBusqueda(1, 2) = "Código "
     ArrayBusqueda(1, 3) = 1000
     ArrayBusqueda(2, 1) = "Descr"
     ArrayBusqueda(2, 2) = "Descripción "
     ArrayBusqueda(2, 3) = 4000
       
     FBusquedasMa.GObtenerRegistros objTipoImpuesto.ListarTiposImpuestos, ArrayBusqueda, 2, 2
     FBusquedasMa.Show vbModal
     
     If GrecibeUbicacion <> 0 Then
         dtcImpuesto1.BoundText = GrecibeColumnaID
     End If
End Sub

Private Sub cmdBusImp2_Click()
    'Lineas que llaman al Formulario de Búsqueda
     
     Dim ArrayBusqueda(1 To 2, 1 To 3) As Variant
     ArrayBusqueda(1, 1) = "TaxId"
     ArrayBusqueda(1, 2) = "Código "
     ArrayBusqueda(1, 3) = 1000
     ArrayBusqueda(2, 1) = "Descr"
     ArrayBusqueda(2, 2) = "Descripción "
     ArrayBusqueda(2, 3) = 4000
       
     FBusquedasMa.GObtenerRegistros objTipoImpuesto.ListarTiposImpuestos, ArrayBusqueda, 2, 2
     FBusquedasMa.Show vbModal
     
     If GrecibeUbicacion <> 0 Then
         dtcImpuesto2.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
       
     FBusquedasMa.GObtenerRegistros objMoneda.ListarMonedas, ArrayBusqueda, 2, 2
     FBusquedasMa.Show vbModal
     
     If GrecibeUbicacion <> 0 Then
         dtcMoneda.BoundText = GrecibeColumnaID
     End If
End Sub


Private Sub cmdBusTTCambio_Click()
  Dim LArrayBusqueda(1 To 2, 1 To 3) As Variant
  LArrayBusqueda(1, 1) = "Curytypeid"
  LArrayBusqueda(1, 2) = "Código"
  LArrayBusqueda(1, 3) = 1000
  LArrayBusqueda(2, 1) = "descr"
  LArrayBusqueda(2, 2) = "Descripción"
  LArrayBusqueda(2, 3) = 4000
    
  GrecibeUbicacion = 0
  GrecibeColumnaID = Empty
  GrecibeColumnaOpcional = Empty

    
  FBusquedasMa.GObtenerRegistros objTTCambio.ListarTiposdeTipodeCambio, LArrayBusqueda, 2, 2
  FBusquedasMa.Show vbModal
  
  If GrecibeUbicacion <> 0 Then
    dtcTTCambio.BoundText = GrecibeColumnaID
  End If

End Sub

Private Sub dtcCondPago_KeyPress(KeyAscii As Integer)
    If KeyAscii = 13 Then
        dtcMoneda.SetFocus
    End If
End Sub

Private Sub cmdBusPais_Click()
    'Lineas que llaman al Formulario de Búsqueda
    
    Dim ArrayBusqueda(1 To 2, 1 To 3) As Variant
    ArrayBusqueda(1, 1) = "Countryid"
    ArrayBusqueda(1, 2) = "Código "
    ArrayBusqueda(1, 3) = 1000
    ArrayBusqueda(2, 1) = "descr"
    ArrayBusqueda(2, 2) = "Descripción "
    ArrayBusqueda(2, 3) = 4000
      
    FBusquedasMa.GObtenerRegistros objPais.ListarPaises, ArrayBusqueda, 2, 2
    FBusquedasMa.Show vbModal
    
    If GrecibeUbicacion <> 0 Then
        dtcPais.BoundText = GrecibeColumnaID
    End If
End Sub

Private Sub cmdBusTipoCliente_Click()
    'Lineas que llaman al Formulario de Búsqueda
    
    Dim ArrayBusqueda(1 To 2, 1 To 3) As Variant
    ArrayBusqueda(1, 1) = "CUSTCLASSID"
    ArrayBusqueda(1, 2) = "Código "
    ArrayBusqueda(1, 3) = 1000
    ArrayBusqueda(2, 1) = "descr"
    ArrayBusqueda(2, 2) = "Descripción "
    ArrayBusqueda(2, 3) = 4000
      
    FBusquedasMa.GObtenerRegistros objTipocliente.ListarTipos_ClientesAyuda, ArrayBusqueda, 2, 2
    FBusquedasMa.Show vbModal
    
    If GrecibeUbicacion <> 0 Then
        dtcTipoCliente.BoundText = GrecibeColumnaID
    End If
End Sub

Private Sub cmdBusVendedor_Click()
    'Lineas que llaman al Formulario de Búsqueda
    
    Dim ArrayBusqueda(1 To 2, 1 To 3) As Variant
    ArrayBusqueda(1, 1) = "SALESPERID"
    ArrayBusqueda(1, 2) = "Código "
    ArrayBusqueda(1, 3) = 1000
    ArrayBusqueda(2, 1) = "SALESPERNAME"
    ArrayBusqueda(2, 2) = "Nombre "
    ArrayBusqueda(2, 3) = 4000
      
    FBusquedasMa.GObtenerRegistros objVendedor.ListarVendedoresAyuda, ArrayBusqueda, 2, 2
    FBusquedasMa.Show vbModal
    
    If GrecibeUbicacion <> 0 Then
        dtcVendedor.BoundText = GrecibeColumnaID
    End If
End Sub

Private Sub cmdBusZona_Click()
    'Lineas que llaman al Formulario de Búsqueda
    
    Dim ArrayBusqueda(1 To 2, 1 To 3) As Variant
    ArrayBusqueda(1, 1) = "CustZoneId"
    ArrayBusqueda(1, 2) = "Código "
    ArrayBusqueda(1, 3) = 1000
    ArrayBusqueda(2, 1) = "descr"
    ArrayBusqueda(2, 2) = "Descripción "
    ArrayBusqueda(2, 3) = 4000
      
    FBusquedasMa.GObtenerRegistros objZona.ListarZonas_ClientesAyuda, ArrayBusqueda, 2, 2
    FBusquedasMa.Show vbModal
    
    If GrecibeUbicacion <> 0 Then
        dtcZona.BoundText = GrecibeColumnaID
    End If
End Sub

Private Sub cmdModificarCredito_Click()
    If dbDetalleCreditos.Bookmark <> 0 Or Not IsNull(dbDetalleCreditos.Bookmark) Then
        FClienteCredito.GlngCorrelativo = MlngCorrelativo
        FClienteCredito.GblnModificando = True
        FClienteCredito.GstrCodAlmacen = dbDetalleCreditos.Columns(0).Text
        FClienteCredito.GstrMontoTotal = ctnMontoTotal.Text
        FClienteCredito.GstrPorcentaje = dbDetalleCreditos.Columns(1).Text
        FClienteCredito.GstrcodCliente = txtCodigo.Text
        FClienteCredito.Caption = "Modificar Crédito de Cliente"
        FClienteCredito.Show vbModal
        CargaGrillaCreditos Empty, MlngCorrelativo, False
        lblPorcentaje.Caption = objCliente.ObtienePorcentajeEnTmpCust_Limit(MlngCorrelativo)
    Else
        MsgBox "No hay Datos que Modificar", vbExclamation, "Mensaje"
        Exit Sub
    End If
End Sub

Private Sub cmdModificarGarantia_Click()
    If dbDetalleGarantias.Bookmark <> 0 Or Not IsNull(dbDetalleGarantias.Bookmark) Then
        FClienteGarantia.GlngCorrelativo = MlngCorrelativo
        FClienteGarantia.GblnModificando = True
        FClienteGarantia.GstrTipoGarantia = dbDetalleGarantias.Columns(0).Text
        FClienteGarantia.GstrcodCliente = txtCodigo.Text
        FClienteGarantia.Caption = "Modificar Garantia de Cliente"
        FClienteGarantia.Show vbModal
        CargaGrillaGarantias Empty, MlngCorrelativo, False
    End If
End Sub

Private Sub cmdModificarProducto_Click()
    If dbDetalleProducto.Bookmark <> 0 Or Not IsNull(dbDetalleProducto.Bookmark) Then
        FClienteProducto.GlngCorrelativo = MlngCorrelativo
        FClienteProducto.GblnModificando = True
        FClienteProducto.GstrCodProducto = dbDetalleProducto.Columns(0).Text
        FClienteProducto.GstrDesProducto = dbDetalleProducto.Columns(1).Text
        FClienteProducto.GstrDestAumt = dbDetalleProducto.Columns(3).Text
        FClienteProducto.GstrPorcDesc = dbDetalleProducto.Columns(2).Text
        FClienteProducto.GstrcodCliente = txtCodigo.Text
        FClienteProducto.Show vbModal
        CargaGrillaProductos Empty, MlngCorrelativo, False
        
    End If
  'dbDetalleProducto
End Sub



Private Sub ctnMontoTotal_change()
    On Error Resume Next
        lblTotalMonto.Caption = ctnMontoTotal.Text
        lblTotalSaldo.Caption = GFormatodeNumero(CDbl(ctnMontoTotal.Text) - CDbl(lblTotalDeuda.Caption), GintDecResultado)
        If Not IsNull(dbDetalleCreditos.Bookmark) Then
            objCliente.RecalculaCreditosClientes MlngCorrelativo, CDbl(ctnMontoTotal.Text), GintDecResultado
            CargaGrillaCreditos Empty, MlngCorrelativo, False
        End If
End Sub

Private Sub dbDetalleCreditos_KeyUp(KeyCode As Integer, Shift As Integer)
    If dbDetalleCreditos.Bookmark <> 0 Or Not IsNull(dbDetalleCreditos.Bookmark) Then
        If KeyCode = vbKeyF3 Then
            If CDbl(dbDetalleCreditos.Columns(5).Text) <> 0 Then
                MsgBox "El Saldo en el Almacen es mayor a cero ", vbCritical, "No se puede Eliminar"
                Exit Sub
            End If
            
            If MsgBox("Está seguro de Eliminar Crédito. ", vbQuestion + vbYesNo, "Eliminar") = vbNo Then
                Exit Sub
            End If
            
            objCliente.EliminarCreditoEnTmp MlngCorrelativo, dbDetalleCreditos.Columns(0).Text
            CargaGrillaCreditos Empty, MlngCorrelativo, False
            lblPorcentaje.Caption = objCliente.ObtienePorcentajeEnTmpCust_Limit(MlngCorrelativo)
            
        End If
    End If
End Sub

Private Sub dbDetalleGarantias_KeyUp(KeyCode As Integer, Shift As Integer)
    If dbDetalleGarantias.Bookmark <> 0 Or Not IsNull(dbDetalleGarantias.Bookmark) Then
        If KeyCode = vbKeyF3 Then
            If MsgBox("Está seguro de Eliminar Garantia. ", vbQuestion + vbYesNo, "Eliminar") = vbNo Then
                Exit Sub
            End If
            
            objCliente.EliminarGarantiaEnTmp MlngCorrelativo, dbDetalleGarantias.Columns(0).Text
            CargaGrillaGarantias Empty, MlngCorrelativo, False
     
        End If
    End If
End Sub

Private Sub dbDetallePlacas_KeyUp(KeyCode As Integer, Shift As Integer)
    If dbDetallePlacas.Bookmark <> 0 Or Not IsNull(dbDetallePlacas.Bookmark) Then
        If KeyCode = vbKeyF3 Then
            If MsgBox("Está seguro de Eliminar Placa. ", vbQuestion + vbYesNo, "Eliminar") = vbNo Then
                Exit Sub
            End If
            
            objCliente.EliminarPlacaEnTmp MlngCorrelativo, dbDetallePlacas.Columns(0).Text
            CargaGrillaPlacas Empty, MlngCorrelativo, False
     
        End If
    End If
End Sub

Private Sub dbDetalleProducto_KeyUp(KeyCode As Integer, Shift As Integer)
    If dbDetalleProducto.Bookmark <> 0 Or Not IsNull(dbDetalleProducto.Bookmark) Then
        If KeyCode = vbKeyF3 Then
            If MsgBox("Está seguro de Eliminar Producto. ", vbQuestion + vbYesNo, "Eliminar") = vbNo Then
                Exit Sub
            End If
            
            objCliente.EliminarCliProEnTmp MlngCorrelativo, dbDetalleProducto.Columns(0).Text
            CargaGrillaProductos Empty, MlngCorrelativo, False
        End If
    End If
End Sub


Private Sub dbDetalleTarjetas_KeyUp(KeyCode As Integer, Shift As Integer)
    If dbDetalleTarjetas.Bookmark <> 0 Or Not IsNull(dbDetalleTarjetas.Bookmark) Then
        If KeyCode = vbKeyF3 Then
            If MsgBox("Está seguro de Eliminar Tarjeta. ", vbQuestion + vbYesNo, "Eliminar") = vbNo Then
                Exit Sub
            End If
            
            objCliente.EliminarTarjetaEnTmp MlngCorrelativo, dbDetalleTarjetas.Columns(0).Text
            CargaGrillaTarjetas Empty, MlngCorrelativo, False
     
        End If
    End If
End Sub

Private Sub dtcDepartamento_Change()
    Call CargaDataCombo(dtcDistrito, objDistrito.ListarDistritosPorDepartamento(dtcDepartamento.BoundText), "CityId", "Descr")
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_Clientes)
    Call asigna_campos
End Sub

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

Public Sub registro_anterior()
    Call Gregistro_anterior(Me, rs_Clientes)
    Call asigna_campos
End Sub
Public Sub registro_siguiente()
    Call Gregistro_siguiente(Me, rs_Clientes)
    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
        ctnMontoTotal.Enteros = 8
        ctnMontoTotal.ValorPorDefecto
        ctnMontoTotal.Decimales = GintDecResultado
        CtnDescuento.Enteros = 8
        CtnDescuento.ValorPorDefecto
        CtnDescuento.Decimales = GintDecResultado
        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
    

    SSTab1.Tab = 0
    
    Me.Top = 100
    Me.Left = (Screen.Width - Me.Width) / 2
    
End Sub
Public Sub borrar_registro()

'On Error GoTo errhandler
'
'    objCliente.EliminarCliente txtCodigo
'    Call gborrar_Registro(Me, rs_Clientes, txtCodigo)
'
'Exit Sub
'errhandler:
'    MsgBox MensajedeError(Err.Number, Err.Description), vbDefaultButton1 + vbCritical, "Error"
'
End Sub
Function valida_datos()
    If GVDATO(txtCodigo.Text) = Empty Then
        valida_datos = False
        MsgBox "Ingrese Código de Cliente", vbExclamation, "Error"
        SSTab1.Tab = 0
        txtCodigo.SetFocus
        Exit Function
    End If

    If GVDATO(txtCodSolomon.Text) = Empty Then
        valida_datos = False
        MsgBox "Ingrese Código Solomon para Cliente", vbExclamation, "Error"
        SSTab1.Tab = 0
        txtCodSolomon.SetFocus
        Exit Function
    End If

    If GVDATO(dtcEstado.Text) = Empty Then
        valida_datos = False
        MsgBox "Ingrese Estado de Cliente", vbExclamation, "Error"
        SSTab1.Tab = 0
        dtcEstado.SetFocus
        Exit Function
    End If

    If GVDATO(dtcImpuesto1.Text) = Empty Then
        valida_datos = False
        MsgBox "Ingrese Impuesto1", vbExclamation, "Error"
        SSTab1.Tab = 0
        dtcImpuesto1.SetFocus
        Exit Function
    End If
    
    If dtcImpuesto1.BoundText = dtcImpuesto2.BoundText Then
        valida_datos = False
        MsgBox "El Tipo Impuesto1 debe ser diferente al Tipo Impuesto2", vbExclamation, "Error"
        SSTab1.Tab = 0
        dtcImpuesto2.SetFocus
        Exit Function
    End If

    If GVDATO(dtcTipoCliente.Text) = Empty Then
        valida_datos = False
        MsgBox "Ingrese Tipo de Cliente", vbExclamation, "Error"
        SSTab1.Tab = 1
        dtcTipoCliente.SetFocus
        Exit Function
    End If

    If GVDATO(dtcTTCambio.Text) = Empty Then
        valida_datos = False
        MsgBox "Ingrese Clase de Tipo de Cambio", vbExclamation, "Error"
        SSTab1.Tab = 1
        dtcTTCambio.SetFocus
        Exit Function
    End If

    If GVDATO(dtcCondPago1.Text) = Empty Then
        valida_datos = False
        MsgBox "Ingrese Condición de Pago para Ticket", vbExclamation, "Error"
        SSTab1.Tab = 1
        dtcCondPago1.SetFocus
        Exit Function
    End If

    If GVDATO(dtcCondPago2.Text) = Empty Then
        valida_datos = False
        MsgBox "Ingrese Condición de Pago para Phantom", vbExclamation, "Error"
        SSTab1.Tab = 1
        dtcCondPago2.SetFocus
        Exit Function
    End If

    If GVDATO(txtDiaGracia.Text) = Empty Then
        valida_datos = False
        MsgBox "Ingrese Número de Dias de Gracia", vbExclamation, "Error"
        SSTab1.Tab = 1
        txtDiaGracia.SetFocus
        Exit Function
    End If

    If CDbl(lblPorcentaje.Caption) > 0 And CDbl(lblPorcentaje.Caption) < 100 Then
        valida_datos = False
        MsgBox "Debe Distribuir el 100% del MOnto Total de Limite de Crédito", vbExclamation, "Error"
        SSTab1.Tab = 5
        cmdAgregarCredito.SetFocus
        Exit Function
    End If

'    If CDbl(lblPorcentaje.Caption) = 100 And CDbl(ctnMontoTotal.Text) = 0 Then
'        valida_datos = False
'        MsgBox "No puede existir una distribución de un Monto de Limite de credito igual a cero", vbExclamation, "Error"
'        SSTab1.Tab = 5
'        cmdAgregarCredito.SetFocus
'        Exit Function
'    End If

    
    valida_datos = True
End Function
Public Sub grabar_registro()

Dim Ldbutmant As DB_UT_MANTENIMIENTOS.C_PROCESOS
Dim strSQL As String

On Error GoTo errhandler

    If valida_datos() = True Then
        ' llamada al proc de grabacion
        If pb_agregar Then
            
            strSQL = " EXEC CustomerInsProc '" & Trim(txtCodigo.Text) & "','" & dtcDiaPago.BoundText & "','" & dtcCondPago2.BoundText & "','" & _
                                        Trim(txtCodSolomon.Text) & "','" & Trim(txtRuc.Text) & "','" & Trim(txtDescripcion.Text) & "','" & _
                                        Trim(txtDireccion1.Text) & "','" & Trim(txtDireccion2.Text) & "','" & Trim(txtTelefono.Text) & "','" & _
                                        Trim(txtFax.Text) & "','" & dtcZona.BoundText & "','" & dtcPais.BoundText & "','" & _
                                        dtcDepartamento.BoundText & "','" & dtcDistrito.BoundText & "','" & dtcTipoCliente.BoundText & "','" & _
                                        dtcImpuesto1.BoundText & "','" & dtcImpuesto2.BoundText & "','" & dtcTTCambio.BoundText & "','" & _
                                        dtcCondPago1.BoundText & "','" & Format(dtpFechaNac.Value, "YYYYMMDD") & "','" & _
                                        Format(dtpFechaInsc.Value, "YYYYMMDD") & "'," & Val(txtDiaGracia.Text) & ",'" & dtcMoneda.BoundText & "','" & _
                                        dtcVendedor.BoundText & "','" & GCUSERID & "','" & dtcEstado.BoundText & "'," & MlngCorrelativo & "," & GFormatodeNumero(CDbl(ctnMontoTotal.Text), GintDecResultado) & "," & chkAfecto.Value & "," & CtnDescuento.Text & " ," & _
                                        "NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL," & Chkcontroldispo.Value & ""
               
            Set Ldbutmant = New DB_UT_MANTENIMIENTOS.C_PROCESOS

            Ldbutmant.Auxiliar1 strSQL
                        
            'objCliente.AgregarCliente Trim(txtCodigo), dtcDiaPago.BoundText, dtcCondPago2.BoundText, _
                                          Trim(txtcodsolomon), Trim(txtRuc), Trim(txtDescripcion), _
                                          Trim(txtDireccion1), Trim(txtDireccion2.Text), Trim(txtTelefono), _
                                          Trim(txtFax), dtcZona.BoundText, dtcPais.BoundText, _
                                          dtcDepartamento.BoundText, dtcDistrito.BoundText, dtcTipoCliente.BoundText, _
                                          dtcImpuesto1.BoundText, dtcImpuesto2.BoundText, dtcTTCambio.BoundText, _
                                          dtcCondPago1.BoundText, dtpFechaNac.Value, _
                                          dtpFechaInsc.Value, Val(txtDiaGracia.Text), dtcMoneda.BoundText, _
                                          dtcVendedor.BoundText, GCUSERID, dtcEstado.BoundText, MlngCorrelativo, GFormatodeNumero(CDbl(ctnMontoTotal.Text), GintDecResultado), chkAfecto.Value
                                                       
                                          
        Else
                            
            strSQL = " EXEC CUSTOMERUpdProc '" & txtCodigo.Text & "','" & dtcDiaPago.BoundText & "','" & dtcCondPago2.BoundText & "','" & _
                                        Trim(txtCodSolomon.Text) & "','" & Trim(txtRuc.Text) & "','" & Trim(txtDescripcion.Text) & "','" & _
                                        Trim(txtDireccion1.Text) & "','" & Trim(txtDireccion2.Text) & "','" & Trim(txtTelefono.Text) & "','" & _
                                        Trim(txtFax.Text) & "','" & dtcZona.BoundText & "','" & dtcPais.BoundText & "','" & _
                                        dtcDepartamento.BoundText & "','" & dtcDistrito.BoundText & "','" & dtcTipoCliente.BoundText & "','" & _
                                        dtcImpuesto1.BoundText & "','" & dtcImpuesto2.BoundText & "','" & dtcTTCambio.BoundText & "','" & _
                                        dtcCondPago1.BoundText & "','" & Format(dtpFechaNac.Value, "YYYYMMDD") & "','" & _
                                        Format(dtpFechaInsc.Value, "yyyymmdd") & "'," & Val(txtDiaGracia.Text) & ",'" & dtcMoneda.BoundText & "','" & _
                                        dtcVendedor.BoundText & "','" & GCUSERID & "','" & dtcEstado.BoundText & "'," & MlngCorrelativo & "," & GFormatodeNumero(CDbl(ctnMontoTotal.Text), GintDecResultado) & "," & chkAfecto.Value & "," & CtnDescuento.Text & "," & Chkcontroldispo.Value

            Set Ldbutmant = New DB_UT_MANTENIMIENTOS.C_PROCESOS
            Ldbutmant.Auxiliar1 strSQL
        
           'objCliente.ActualizarCliente txtCodigo, dtcDiaPago.BoundText, dtcCondPago2.BoundText, _
                                        Trim(txtcodsolomon), Trim(txtRuc), Trim(txtDescripcion), _
                                        Trim(txtDireccion1), Trim(txtDireccion2.Text), Trim(txtTelefono), _
                                        Trim(txtFax), dtcZona.BoundText, dtcPais.BoundText, _
                                        dtcDepartamento.BoundText, dtcDistrito.BoundText, dtcTipoCliente.BoundText, _
                                        dtcImpuesto1.BoundText, dtcImpuesto2.BoundText, dtcTTCambio.BoundText, _
                                        dtcCondPago1.BoundText, Format(dtpFechaNac.Value, "yyyymmdd"), _
                                        Format(dtpFechaInsc.Value, "yyyymmdd"), Val(txtDiaGracia.Text), dtcMoneda.BoundText, _
                                        dtcVendedor.BoundText, GCUSERID, dtcEstado.BoundText, MlngCorrelativo, GFormatodeNumero(CDbl(ctnMontoTotal.Text), GintDecResultado), chkAfecto.Value
                                          
    
        End If
        Call ggrabar_registro(Me)
        actualizar_registro
        SSTab1.Tab = 0
    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, txtCodigo)
    Limpiar
    MlngCorrelativo = objCorrelativo.ObtenerCorrelativo(GCUSERID)
    
End Sub
Public Sub modificar_registro()
    Call gmodificar_registro(Me, txtCodigo)
    MlngCorrelativo = objCorrelativo.ObtenerCorrelativo(GCUSERID)
    objCliente.CargarTablasTemporales MlngCorrelativo, txtCodigo.Text
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_Clientes = objCliente.ListarClientes(0)
End Sub

Sub salir_formulario()
    ' validar que no haya procesos pendientes
    ' si no hay problemas
    MDIFMaestros.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_Clientes.RecordCount <> 0 Then
        txtCodigo.Text = rs_Clientes!CUSTIDSS
        lblCodigo2.Caption = rs_Clientes!CUSTIDSS
        lblCodigo3.Caption = rs_Clientes!CUSTIDSS
        lblCodigo4.Caption = rs_Clientes!CUSTIDSS
        lblCodigo5.Caption = rs_Clientes!CUSTIDSS
        lblCodigo6.Caption = rs_Clientes!CUSTIDSS
        lblCodigo7.Caption = rs_Clientes!CUSTIDSS
        txtDescripcion.Text = rs_Clientes!CUSTNAME
        lblNombre2.Caption = rs_Clientes!CUSTNAME
        lblNombre3.Caption = rs_Clientes!CUSTNAME
        lblNombre4.Caption = rs_Clientes!CUSTNAME
        lblNombre5.Caption = rs_Clientes!CUSTNAME
        lblNombre6.Caption = rs_Clientes!CUSTNAME
        lblNombre7.Caption = rs_Clientes!CUSTNAME
        txtRuc.Text = rs_Clientes!Taxregnbr
        txtCodSolomon.Text = rs_Clientes!CUSTID
        txtDireccion1.Text = rs_Clientes!Addr1
        txtDireccion2.Text = GVDATO(rs_Clientes!Addr2)
        txtTelefono.Text = GVDATO(rs_Clientes!PHONE)
        txtFax.Text = GVDATO(rs_Clientes!Fax)
        dtcVendedor.BoundText = GVDATO(rs_Clientes!SALESPERID)
        dtcPais.BoundText = GVDATO(rs_Clientes!Countryid)
        dtcDepartamento.BoundText = GVDATO(rs_Clientes!Stateid)
        dtcDistrito.BoundText = GVDATO(rs_Clientes!Cityid)
        dtcZona.BoundText = GVDATO(rs_Clientes!CUSTZONEID)
        dtcMoneda.BoundText = GVDATO(rs_Clientes!CURYID)
        dtcEstado.BoundText = rs_Clientes!CUSTSTATUSID
        dtcImpuesto1.BoundText = GVDATO(rs_Clientes!TAXID1)
        dtcImpuesto2.BoundText = GVDATO(rs_Clientes!TAXID2)
        dtpFechaNac.Value = IIf(IsNull(rs_Clientes!DATEORIG), "01/01/1900", rs_Clientes!DATEORIG)
        dtpFechaInsc.Value = IIf(IsNull(rs_Clientes!DATEPROC), "01/01/1900", rs_Clientes!DATEPROC)
        
        
        ' Si controla el saldo para clientes adelantados
                                          
          Chkcontroldispo.Value = IIf(IsNull(rs_Clientes!user9), 0, rs_Clientes!user9)
        
        ' Fin de Control de saldos para Clientes adelantados
        
        
        
        dtcTipoCliente.BoundText = rs_Clientes!CUSTCLASSID
        dtcTTCambio.BoundText = rs_Clientes!CURYTYPEID
        dtcCondPago1.BoundText = rs_Clientes!TERMIDDOC
        dtcCondPago2.BoundText = rs_Clientes!TERMIDSUM
        dtcDiaPago.BoundText = IIf(IsNull(rs_Clientes!DIAPAGID), "", rs_Clientes!DIAPAGID)
        txtDiaGracia.Text = rs_Clientes!DAYGRACE
        ctnMontoTotal.Text = GFormatodeNumero(rs_Clientes!MTOTOTLIMIT, GintDecResultado)
        chkAfecto.Value = IIf(rs_Clientes!AFFECT, 1, 0)
        lblTotalDeuda.Caption = GFormatodeNumero(rs_Clientes!TOTCURRBAL, GintDecResultado)
        lblTotalSaldo.Caption = GFormatodeNumero(CDbl(ctnMontoTotal.Text) - CDbl(lblTotalDeuda.Caption), GintDecResultado)
        CtnDescuento.Text = GFormatodeNumero(IIf(IsNull(rs_Clientes!DECSPORC), 0, rs_Clientes!DECSPORC), GintDecResultado)
        
        CargaGrillaPlacas rs_Clientes!CUSTIDSS, Empty, True
        CargaGrillaTarjetas rs_Clientes!CUSTIDSS, Empty, True
        CargaGrillaGarantias rs_Clientes!CUSTIDSS, Empty, True
        CargaGrillaCreditos rs_Clientes!CUSTIDSS, Empty, True
        CargaGrillaProductos rs_Clientes!CUSTIDSS, Empty, True
        
        If dbDetalleCreditos.Bookmark <> 0 Or Not IsNull(dbDetalleCreditos.Bookmark) Then
            lblPorcentaje.Caption = "100"
        Else
            lblPorcentaje.Caption = "0"
        End If
        
    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

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

Private Sub Form_Unload(Cancel As Integer)
   DestruyeObjetos
End Sub

Private Sub txtCodigo_KeyPress(KeyAscii As Integer)
    KeyAscii = GBloqueaCaracter(KeyAscii)
    If KeyAscii = 13 Then
        txtDescripcion.SetFocus
    End If
End Sub

Private Sub txtCodSolomon_KeyPress(KeyAscii As Integer)
    KeyAscii = GBloqueaCaracter(KeyAscii)
    If KeyAscii = 13 Then
        txtDireccion1.SetFocus
    End If
End Sub

Private Sub txtDescripcion_KeyPress(KeyAscii As Integer)
    KeyAscii = GBloqueaCaracter(KeyAscii)
    If KeyAscii = 13 Then
        txtRuc.SetFocus
    End If
End Sub

Private Sub txtDiaGracia_KeyPress(KeyAscii As Integer)
KeyAscii = MValidaNumeros(KeyAscii)
End Sub

Private Sub txtDireccion1_KeyPress(KeyAscii As Integer)
    KeyAscii = GBloqueaCaracter(KeyAscii)
    If KeyAscii = 13 Then
        txtDireccion2.SetFocus
    End If

End Sub

Private Sub txtDireccion2_KeyPress(KeyAscii As Integer)
    KeyAscii = GBloqueaCaracter(KeyAscii)
    If KeyAscii = 13 Then
        txtTelefono.SetFocus
    End If
End Sub

Private Sub txtFax_KeyPress(KeyAscii As Integer)
    KeyAscii = MValidaNumeros(KeyAscii)
    If KeyAscii = 13 Then
        dtcVendedor.SetFocus
    End If
End Sub

Private Sub txtRuc_KeyPress(KeyAscii As Integer)
    KeyAscii = GBloqueaCaracter(KeyAscii)
    If KeyAscii = 13 Then
        txtCodSolomon.SetFocus
    End If
End Sub

Private Sub txtTelefono_KeyPress(KeyAscii As Integer)
    KeyAscii = MValidaNumeros(KeyAscii)
    If KeyAscii = 13 Then
        txtFax.SetFocus
    End If
End Sub

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

Sub imprimir()
 
     Fimpcustomer.Show vbModal

'    crCliente.ReportFileName = GstrReportesInv + "rpt_Cliente.rpt"
'    crCliente.WindowTitle = "Reporte de Clientes"
'    crCliente.Formulas(1) = "formusuario=stringvar strusuario; strusuario:='" & GCUSERID & "'"
'    crCliente.Formulas(2) = "formscreen=stringvar strscreen; strscreen:='01.110.00'"
'    crCliente.WindowState = crptMaximized
'    crCliente.WindowShowPrintSetupBtn = True
'    crCliente.Action = 1
  
End Sub


' Procedimiento de carga de los DataCombos del formulario
Private Sub LlenaDataCombos()
    Call CargaDataCombo(dtcVendedor, objVendedor.ListarVendedoresAyuda, "SALESPERID", "SALESPERNAME")
    Call CargaDataCombo(dtcPais, objPais.ListarPaises, "CountryId", "Descr")
    Call CargaDataCombo(dtcDepartamento, objDepartamento.ListarDepartamentos, "StateId", "Descr")
    Call CargaDataCombo(dtcDistrito, objDistrito.ListarDistritosPorDepartamento(dtcDepartamento.BoundText), "CityId", "Descr")
    Call CargaDataCombo(dtcZona, objZona.ListarZonas_ClientesAyuda, "CustZoneId", "Descr")
    Call CargaDataCombo(dtcMoneda, objMoneda.ListarMonedas, "CuryId", "Descr")
    Call CargaDataCombo(dtcEstado, objEstadoCliente.ListarEstados_Cliente, "CUSTSTATUSID", "DESCRCUST")
    Call CargaDataCombo(dtcImpuesto1, objTipoImpuesto.ListarTiposImpuestos, "TaxId", "Descr")
    Call CargaDataCombo(dtcImpuesto2, objTipoImpuesto.ListarTiposImpuestos, "TaxId", "Descr")
    Call CargaDataCombo(dtcTipoCliente, objTipocliente.ListarTipos_ClientesAyuda, "CUSTCLASSID", "Descr")
    Call CargaDataCombo(dtcTTCambio, objTTCambio.ListarTiposdeTipodeCambioAyuda, "CURYTYPEid", "Descr")
    Call CargaDataCombo(dtcCondPago1, objCondPago.ListarCondicionesPagoAyuda, "TermId", "Descr")
    Call CargaDataCombo(dtcCondPago2, objCondPago.ListarCondicionesPagoAyuda, "TermId", "Descr")
    Call CargaDataCombo(dtcDiaPago, objCliente.ListarDiasPagoAyuda, "DIAPAGID", "Descr")
End Sub

Private Sub UbicaItemEnDataCombo()
On Error Resume Next
'    dtcTipoIngreso.BoundText = MstrTipoMovimiento
'    dtcAlmacen.BoundText = MstrAlmacen
'    dtcProveedor.BoundText = MstrProveedor
'    dtcTipoDoc.BoundText = MstrTipoDoc
'    dtcMoneda.BoundText = MstrMoneda
'    txtArticulo.Text = MstrArticulo
End Sub

Private Sub InstanciaObjetos()
    
    Set objCorrelativo = New DB_CORRELATIVO.C_Correlativos
    Set rs_Clientes = New ADODB.Recordset
    Set objCliente = New DB_MA_MANTENIMIENTOS.C_CLIENTE
    Set objVendedor = New DB_OP_MANTENIMIENTOS.C_VENDEDOR
    Set objPais = New DB_MA_MANTENIMIENTOS.C_PAIS
    Set objDepartamento = New DB_MA_MANTENIMIENTOS.C_DEPARTAMENTO
    Set objDistrito = New DB_MA_MANTENIMIENTOS.C_DISTRITO
    Set objZona = New DB_OP_MANTENIMIENTOS.C_ZONA_CLIENTE
    Set objMoneda = New DB_MA_MANTENIMIENTOS.C_MONEDA
    Set objEstadoCliente = New DB_MA_MANTENIMIENTOS.C_ESTADO_CLIENTE
    Set objTipoImpuesto = New DB_MA_MANTENIMIENTOS.C_TIPOIMPÙESTO
    
    Set objTipocliente = New DB_OP_MANTENIMIENTOS.C_TIPO_CLIENTE
    Set objCondPago = New DB_MA_MANTENIMIENTOS.C_CONDICIONPAGO
    Set objTTCambio = New DB_MA_MANTENIMIENTOS.C_TDTDCAMBIO
    
End Sub

Private Sub DestruyeObjetos()
    Set objCorrelativo = Nothing
    Set rs_Clientes = Nothing
    Set objCliente = Nothing
    Set objVendedor = Nothing
    Set objPais = Nothing
    Set objDepartamento = Nothing
    Set objDistrito = Nothing
    Set objZona = Nothing
    Set objMoneda = Nothing
    Set objEstadoCliente = Nothing
    Set objTipoImpuesto = Nothing
    
    Set objTipocliente = Nothing
    Set objCondPago = Nothing
    Set objTTCambio = Nothing

End Sub

Private Sub CargaGrillaPlacas(CodCliente As String, Correlativo As Long, Flag As Boolean)
    If Flag Then
        Set dbDetallePlacas.DataSource = objCliente.ListarPlacas(CodCliente)
    Else
        Set dbDetallePlacas.DataSource = objCliente.SeleccionaEnTmpCustBadge(Correlativo)
    End If
    dbDetallePlacas.Columns(0).Width = 2000
    dbDetallePlacas.Refresh
End Sub
Private Sub CargaGrillaTarjetas(CodCliente As String, Correlativo As Long, Flag As Boolean)
    
    If Flag Then
        Set dbDetalleTarjetas.DataSource = objCliente.ListarTarjetas(CodCliente)
    Else
        Set dbDetalleTarjetas.DataSource = objCliente.SeleccionaEnTmpCustCard(Correlativo)
    End If
    
    dbDetalleTarjetas.Columns(0).Width = 1000
    dbDetalleTarjetas.Columns(1).Width = 4500
    dbDetalleTarjetas.Columns(2).Width = 1000
    dbDetalleTarjetas.Refresh
    
End Sub
Public Sub CargaGrillaGarantias(CodCliente As String, Correlativo As Long, Flag As Boolean)
    
    If Flag Then
        Set dbDetalleGarantias.DataSource = objCliente.ListarGarantias(CodCliente)
    Else
        Set dbDetalleGarantias.DataSource = objCliente.SeleccionaEnTmpCustWarranty(Correlativo)
    End If
    
    dbDetalleGarantias.Columns(0).Width = 1000
    dbDetalleGarantias.Columns(1).Width = 4000
    dbDetalleGarantias.Columns(2).Width = 1500
    dbDetalleGarantias.Columns(2).Alignment = dbgRight
    dbDetalleGarantias.Columns(2).NumberFormat = GMascara(GintDecResultado)
    dbDetalleGarantias.Columns(3).Width = 1000
    dbDetalleGarantias.Columns(4).Width = 1000
    dbDetalleGarantias.Refresh
    
End Sub

Public Sub CargaGrillaCreditos(CodCliente As String, Correlativo As Long, Flag As Boolean)
    
    If Flag Then
        Set dbDetalleCreditos.DataSource = objCliente.ListarCreditos(CodCliente)
    Else
        Set dbDetalleCreditos.DataSource = objCliente.SeleccionaEnTmpCust_Limit(Correlativo)
    End If
    
    dbDetalleCreditos.Columns(0).Width = 1000
    dbDetalleCreditos.Columns(1).Width = 1500
    dbDetalleCreditos.Columns(1).Alignment = dbgRight
    dbDetalleCreditos.Columns(1).NumberFormat = GMascara(2)
    dbDetalleCreditos.Columns(2).Width = 1500
    dbDetalleCreditos.Columns(2).Alignment = dbgRight
    dbDetalleCreditos.Columns(2).NumberFormat = GMascara(GintDecResultado)
    dbDetalleCreditos.Columns(3).Width = 1750
    dbDetalleCreditos.Columns(3).Alignment = dbgRight
    dbDetalleCreditos.Columns(3).NumberFormat = GMascara(2)
    dbDetalleCreditos.Columns(4).Width = 1500
    dbDetalleCreditos.Columns(4).Alignment = dbgRight
    dbDetalleCreditos.Columns(4).NumberFormat = GMascara(GintDecResultado)
    dbDetalleCreditos.Columns(5).Width = 1500
    dbDetalleCreditos.Columns(5).Alignment = dbgRight
    dbDetalleCreditos.Columns(5).NumberFormat = GMascara(GintDecResultado)
    dbDetalleCreditos.Columns(6).Width = 1500
    dbDetalleCreditos.Columns(6).Alignment = dbgRight
    dbDetalleCreditos.Columns(6).NumberFormat = GMascara(GintDecResultado)
    dbDetalleCreditos.Refresh
    
End Sub

Public Sub CargaGrillaProductos(CodCliente As String, Correlativo As Long, Flag As Boolean)
    
    If Flag Then
    'objCliente
       Set dbDetalleProducto.DataSource = objCliente.ListarProductos(CodCliente)
    Else
       Set dbDetalleProducto.DataSource = objCliente.SeleccionaEnTmpCustPro(Correlativo)
    End If

    dbDetalleProducto.Columns(0).Width = 1000
    dbDetalleProducto.Columns(1).Width = 3000
    dbDetalleProducto.Columns(2).Width = 1500
    dbDetalleProducto.Columns(2).Alignment = dbgRight
    dbDetalleProducto.Columns(2).NumberFormat = GMascara(GintDecResultado)
    dbDetalleProducto.Columns(3).Width = 1000
    dbDetalleProducto.Columns(3).Alignment = dbgRight
    dbDetalleProducto.Refresh

End Sub


Private Sub Limpiar()
    
    CargaGrillaPlacas Empty, Empty, True
    CargaGrillaTarjetas Empty, Empty, True
    CargaGrillaGarantias Empty, Empty, True
    CargaGrillaCreditos Empty, Empty, True
    CargaGrillaProductos Empty, Empty, True
        
    lblCodigo2.Caption = Empty
    lblCodigo3.Caption = Empty
    lblCodigo4.Caption = Empty
    lblCodigo5.Caption = Empty
    lblCodigo6.Caption = Empty
    lblCodigo7.Caption = Empty
    
    lblNombre2.Caption = Empty
    lblNombre3.Caption = Empty
    lblNombre4.Caption = Empty
    lblNombre5.Caption = Empty
    lblNombre6.Caption = Empty
    lblNombre7.Caption = Empty
    
    lblTotalDeuda.Caption = GFormatodeNumero(0, GintDecResultado)
    lblTotalSaldo.Caption = GFormatodeNumero(0, GintDecResultado)
    lblPorcentaje.Caption = "0"
    txtDiaGracia.Text = "0"
    chkAfecto.Value = 1
    Chkcontroldispo.Value = 0
    SSTab1.Tab = 0
    
End Sub

